A high-throughput and memory-efficient inference and serving engine for LLMs
Mirrored from https://github.com/tduncan-lum/Nvidia-Optimization-Stack---VLLM.git
Synced Nov 8, 20:15 UTC
[Bugfix] Fix Kimi-K2.5 NVFP4 checkpoints weight loading (#33876)
Signed-off-by: Isotr0py <mozf@mail2.sysu.edu.cn>
Isotr0py committed
Feb 5, 2026 at 18:29 UTC
a2522839d87d2b81b57458dfdbbcb27afb8191ae
2 files changed
+15
-5
vllm/model_executor/models/deepseek_v2.py
+1
-1
@@ -1485,7 +1485,7 @@ class DeepseekV2ForCausalLM(
1485
param, "weight_loader", default_weight_loader
1486
)
1487
weight_loader(param, loaded_weight)
1488
- if not is_fusion_moe_shared_experts_layer:
1488
+ if name is not None and not is_fusion_moe_shared_experts_layer:
1489
loaded_params.add(name)
1490
1491
return loaded_params
vllm/model_executor/models/kimi_k25.py
+14
-4
@@ -24,7 +24,11 @@ from transformers.processing_utils import ProcessorMixin
24
from vllm.config import VllmConfig
25
from vllm.config.multimodal import BaseDummyOptions
26
from vllm.logger import init_logger
27
-from vllm.model_executor.models.interfaces import SupportsMultiModal, SupportsPP
27
+from vllm.model_executor.models.interfaces import (
28
+ SupportsMultiModal,
29
+ SupportsPP,
30
+ SupportsQuant,
31
+)
32
from vllm.model_executor.models.kimi_k25_vit import (
33
KimiK25MultiModalProjector,
34
MoonViT3dPretrainedModel,
@@ -302,7 +306,9 @@ class KimiK25MultiModalProcessor(BaseMultiModalProcessor[KimiK25ProcessingInfo])
306
info=KimiK25ProcessingInfo,
307
dummy_inputs=KimiK25DummyInputsBuilder,
308
)
305
-class KimiK25ForConditionalGeneration(nn.Module, SupportsMultiModal, SupportsPP):
309
+class KimiK25ForConditionalGeneration(
310
+ nn.Module, SupportsMultiModal, SupportsPP, SupportsQuant
311
+):
312
"""Kimi-K2.5 model for conditional generation.
313
314
Supports both image and video-chunk modalities.
@@ -312,8 +318,12 @@ class KimiK25ForConditionalGeneration(nn.Module, SupportsMultiModal, SupportsPP)
318
319
supports_encoder_tp_data = True
320
315
- weights_mapper = WeightsMapper(
321
+ hf_to_vllm_mapper = WeightsMapper(
322
orig_to_new_prefix={
323
+ # For legacy NVFP4 checkpoint compatibility:
324
+ # see https://github.com/vllm-project/vllm/pull/33346#issuecomment-3851475033
325
+ "language_model.layers.": "language_model.model.layers.",
326
+ # mm projector
327
"mm_projector.proj.0": "mm_projector.linear_1",
328
"mm_projector.proj.2": "mm_projector.linear_2",
329
}
@@ -465,4 +475,4 @@ class KimiK25ForConditionalGeneration(nn.Module, SupportsMultiModal, SupportsPP)
475
476
def load_weights(self, weights: Iterable[tuple[str, torch.Tensor]]):
477
loader = AutoWeightsLoader(self)
468
- return loader.load_weights(weights, mapper=self.weights_mapper)
478
+ return loader.load_weights(weights, mapper=self.hf_to_vllm_mapper)