Skip to content
Merged
Show file tree
Hide file tree
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
15 changes: 0 additions & 15 deletions vllm/model_executor/models/gpt_oss.py
Original file line number Diff line number Diff line change
Expand Up @@ -413,14 +413,6 @@ def _load_weights_mxfp4(
if is_pp_missing_parameter(name, self):
continue

# Skip checkpoint weights for layers dropped by an hf_overrides
# `num_hidden_layers` prune: the model only builds params for the
# layers it keeps, so extra-layer weights have no destination param.
if "layers." in name:
idx_str = name.split("layers.", 1)[1].split(".", 1)[0]
if idx_str.isdigit() and int(idx_str) >= self.config.num_hidden_layers:
continue

if ".w13_weight_scale" in name:
# Handle MLP gate and up projection weights scale
if use_ep:
Expand Down Expand Up @@ -643,13 +635,6 @@ def _get_moe_weight_dtype(layer_id: int = 0) -> str | None:
if is_pp_missing_parameter(name, self):
continue

# Skip checkpoint weights for layers dropped by an hf_overrides
# `num_hidden_layers` prune (mirrors _load_weights_mxfp4).
if "layers." in name:
idx_str = name.split("layers.", 1)[1].split(".", 1)[0]
if idx_str.isdigit() and int(idx_str) >= self.config.num_hidden_layers:
continue

layer_id, expert_id, fused_name = None, None, None
moe_quant_method = None
if "experts" in name:
Expand Down
17 changes: 0 additions & 17 deletions vllm/models/deepseek_v4/amd/model.py
Original file line number Diff line number Diff line change
Expand Up @@ -626,16 +626,6 @@ def load_weights(self, weights: Iterable[tuple[str, torch.Tensor]]) -> set[str]:
expert_mapping = self.get_expert_mapping()

for name, loaded_weight in weights:
# Skip checkpoint weights for transformer layers pruned by a
# num_hidden_layers hf_override (keeps load + run tractable on the
# FFM simulator). Names here are already vLLM-mapped ("layers.N.").
if "layers." in name:
try:
_li = int(name.split("layers.", 1)[1].split(".", 1)[0])
if _li >= self.config.num_hidden_layers:
continue
except (IndexError, ValueError):
pass
for param_name, weight_name, shard_id in stacked_params_mapping:
# Skip non-stacked layers and experts (experts handled below).
if ".experts." in name:
Expand Down Expand Up @@ -692,10 +682,6 @@ def load_weights(self, weights: Iterable[tuple[str, torch.Tensor]]) -> set[str]:
elif "attn_sink" in name:
if is_pp_missing_parameter(name, self):
continue
if name not in params_dict:
# Layer pruned via a num_hidden_layers hf_override; skip
# its checkpoint weights instead of KeyError-ing.
continue
narrow_weight = loaded_weight[head_rank_start:head_rank_end]
n = narrow_weight.shape[0]
params_dict[name][:n].copy_(narrow_weight)
Expand All @@ -704,9 +690,6 @@ def load_weights(self, weights: Iterable[tuple[str, torch.Tensor]]) -> set[str]:
else:
if is_pp_missing_parameter(name, self):
continue
if name not in params_dict:
# Layer pruned via a num_hidden_layers hf_override; skip.
continue
param = params_dict[name]
weight_loader = getattr(
param, "weight_loader", default_weight_loader
Expand Down
Loading