From 85c1365bd9711bde5484a3de7d7b2eaa44a03868 Mon Sep 17 00:00:00 2001 From: Juhi Mittal <39641197+juhi10071998@users.noreply.github.com> Date: Mon, 31 Aug 2026 12:10:24 -0700 Subject: [PATCH] [Bugfix] NemotronHMTP: add hf_to_vllm_mapper so quant exclusions reach the MTP draft (#53790) Signed-off-by: Juhi Mittal Co-authored-by: Claude Opus 5 (1M context) --- vllm/model_executor/models/nemotron_h_mtp.py | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/vllm/model_executor/models/nemotron_h_mtp.py b/vllm/model_executor/models/nemotron_h_mtp.py index f52587ae81..6db6868bda 100644 --- a/vllm/model_executor/models/nemotron_h_mtp.py +++ b/vllm/model_executor/models/nemotron_h_mtp.py @@ -24,6 +24,7 @@ from vllm.model_executor.layers.vocab_parallel_embedding import ( ) from vllm.model_executor.model_loader.weight_utils import default_weight_loader from vllm.model_executor.models.utils import ( + WeightsMapper, make_empty_intermediate_tensors_factory, maybe_prefix, ) @@ -312,6 +313,16 @@ class NemotronHMultiTokenPredictor(nn.Module): class NemotronHMTP(nn.Module, SupportsPP): """NemotronH MTP model.""" + # Quant configs name modules in checkpoint space ("language_model.mtp.layers.0*"), + # but this draft is built under "mtp" (maybe_prefix below). SupportsQuant only + # re-roots exclude_modules when the model defines a mapper, so without one the + # exclusions never match and the MTP experts are wrongly quantized. Mirrors the + # prefix handling load_weights() already does by hand. + hf_to_vllm_mapper = WeightsMapper( + orig_to_new_prefix={"language_model.": ""}, + orig_to_new_substr={"embeddings": "embed_tokens"}, + ) + packed_modules_mapping = { "qkv_proj": [ "q_proj",