Fix loading of ModelOpt FP8 checkpoints for Cosmos3 (#5076)
Signed-off-by: Wojciech Kutak <wkutak@nvidia.com>
This commit is contained in:
1 parent
6603450d71
commit
a7b6a174bc
3 files changed
+136
-11
No files matched your search
@@ -1018,6 +1018,9 @@ class Cosmos3OmniDiffusersPipeline(
|
||||
|
||||
return None
|
||||
|
||||
# Checkpoint adapters use this hook before model-specific weight loading.
|
||||
remap_checkpoint_key = _remap_ckpt_key
|
||||
|
||||
def load_weights(self, weights: Iterable[tuple[str, torch.Tensor]]) -> set[str]:
|
||||
"""Stream-remap checkpoint weights and load via AutoWeightsLoader.
|
||||
|
||||
@@ -1032,6 +1035,10 @@ class Cosmos3OmniDiffusersPipeline(
|
||||
total = kept = 0
|
||||
for name, tensor in weights:
|
||||
total += 1
|
||||
if name in allowed or name in tp_aware:
|
||||
kept += 1
|
||||
yield name, tensor
|
||||
continue
|
||||
remapped = self._remap_ckpt_key(name)
|
||||
if remapped is not None and (remapped in allowed or remapped in tp_aware):
|
||||
kept += 1
|
||||
|
||||
Reference in new issue
Block a user