From 24dd2aec81d780b9d3085fbc83fa81af970a3ba8 Mon Sep 17 00:00:00 2001 From: lcheng Date: Tue, 7 Jul 2026 00:16:46 +0800 Subject: [PATCH] [Bugfix] Preserve FP8 indexer WK pairs across incremental load_weights (#46168) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: lcheng Signed-off-by: NickLucche Co-authored-by: Isotr0py Co-authored-by: Nicolò Lucchesi Co-authored-by: NickLucche --- vllm/model_executor/models/deepseek_v2.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/vllm/model_executor/models/deepseek_v2.py b/vllm/model_executor/models/deepseek_v2.py index 539e912327d..d9102cb5c9f 100644 --- a/vllm/model_executor/models/deepseek_v2.py +++ b/vllm/model_executor/models/deepseek_v2.py @@ -1511,7 +1511,10 @@ class DeepseekV2Model(nn.Module): ("qkv_proj", "v_proj", "v"), ] # Fused indexer wk + weights_proj (shard 0 = wk, shard 1 = weights_proj) - _pending_wk_fp8: dict = {} # When WK is in FP8, we dequant to BF16 for fusion + _pending_wk_fp8 = getattr(self, "_pending_indexer_wk_fp8", None) + if _pending_wk_fp8 is None: + self._pending_indexer_wk_fp8 = _pending_wk_fp8 = {} + indexer_fused_mapping = [ ("wk_weights_proj", "wk", 0), ("wk_weights_proj", "weights_proj", 1),