Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 9 additions & 0 deletions vllm/models/deepseek_v4/nvidia/model.py
Original file line number Diff line number Diff line change
Expand Up @@ -1431,6 +1431,8 @@ def load_weights(self, weights: Iterable[tuple[str, torch.Tensor]]) -> set[str]:
and loaded_weight.dtype == torch.float8_e8m0fnu
):
loaded_weight = loaded_weight.view(torch.uint8)
name_mapped = None
success = False
for mapping in expert_mapping:
param_name, weight_name, expert_id, expert_shard_id = mapping
if weight_name not in name:
Expand All @@ -1456,6 +1458,13 @@ def load_weights(self, weights: Iterable[tuple[str, torch.Tensor]]) -> set[str]:
if success:
name = name_mapped
break
if not success:
# No expert mapping matched, or the loader did not
# load this weight for the current rank (e.g. a
# non-canonical checkpoint, or this rank holds no
# replica). Skip it instead of marking it loaded or
# raising UnboundLocalError.
continue
loaded_params.add(name_mapped)
continue
elif "attn_sink" in name:
Expand Down
Loading