@tduncan / Nvidia-Optimization-Stack-VLLM Mirror · read-only / commits / cf6bbcb493
Fork 0

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 16, 02:00 UTC

[Misc] Fix Deepseek V2 fp8 kv-scale remapping (#11947)

Signed-off-by: Yida Wu <yidawu@alumni.cmu.edu>

Concurrensee committed Jan 13, 2025 at 01:05 UTC cf6bbcb49324c24fc0f6f9381400c299c9c2d7ac
1 file changed +7 -1
vllm/model_executor/models/deepseek_v2.py
+7 -1
@@ -45,7 +45,8 @@ from vllm.model_executor.layers.rotary_embedding import get_rope
45 from vllm.model_executor.layers.sampler import SamplerOutput, get_sampler
46 from vllm.model_executor.layers.vocab_parallel_embedding import (
47 ParallelLMHead, VocabParallelEmbedding)
48 -from vllm.model_executor.model_loader.weight_utils import default_weight_loader
48 +from vllm.model_executor.model_loader.weight_utils import (
49 + default_weight_loader, maybe_remap_kv_scale_name)
50 from vllm.model_executor.sampling_metadata import SamplingMetadata
51 from vllm.sequence import IntermediateTensors
52
@@ -635,6 +636,11 @@ class DeepseekV2ForCausalLM(nn.Module, SupportsPP):
636 if name.endswith(".bias") and name not in params_dict:
637 continue
638
639 + # Remapping the name of FP8 kv-scale.
640 + name = maybe_remap_kv_scale_name(name, params_dict)
641 + if name is None:
642 + continue
643 +
644 if is_pp_missing_parameter(name, self):
645 continue
646