From 909a2710e4d32d73a1efb022f5483ae553b1101e Mon Sep 17 00:00:00 2001 From: biondizzle Date: Tue, 19 May 2026 03:54:14 +0000 Subject: [PATCH] Fix double lm_head mapping: NVFP4 checkpoint already uses correct names MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The checkpoint has lm_head.weight and model.embed_tokens.weight already — the suffix mappings head.weight→lm_head.weight and embed.weight→embed_tokens.weight were incorrectly applying to keys that already had the right prefix, producing lm_lm_head.weight. --- vllm/patches/deepseek_v4.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/vllm/patches/deepseek_v4.py b/vllm/patches/deepseek_v4.py index 4ebfffcd..e079de8e 100644 --- a/vllm/patches/deepseek_v4.py +++ b/vllm/patches/deepseek_v4.py @@ -1645,8 +1645,8 @@ def _make_deepseek_v4_nvfp4_weights_mapper() -> WeightsMapper: }, orig_to_new_regex=expert_rename_regex, orig_to_new_suffix={ - "head.weight": "lm_head.weight", - "embed.weight": "embed_tokens.weight", + # NVFP4 checkpoint already uses lm_head.weight and + # model.embed_tokens.weight — no suffix renames needed. ".ffn.gate.bias": ".ffn.gate.e_score_correction_bias", }, orig_to_new_substr={