diff --git a/vllm/model_executor/models/gpt_oss.py b/vllm/model_executor/models/gpt_oss.py index 863d8ea3ba7f..01f2752ac54b 100644 --- a/vllm/model_executor/models/gpt_oss.py +++ b/vllm/model_executor/models/gpt_oss.py @@ -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: @@ -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: diff --git a/vllm/models/deepseek_v4/amd/model.py b/vllm/models/deepseek_v4/amd/model.py index 2c6501452f87..edb923511501 100644 --- a/vllm/models/deepseek_v4/amd/model.py +++ b/vllm/models/deepseek_v4/amd/model.py @@ -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: @@ -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) @@ -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