[Model] Remap FP8 kv_scale in CommandR and DBRX (#9174)

This commit is contained in:
Hui Liu
2024-10-09 06:43:06 +00:00
committed by GitHub
parent 7627172bf4
commit cdc72e3c80
2 changed files with 14 additions and 2 deletions
+7 -1
View File
@@ -18,7 +18,8 @@ from vllm.model_executor.layers.rotary_embedding import get_rope
from vllm.model_executor.layers.sampler import Sampler, SamplerOutput
from vllm.model_executor.layers.vocab_parallel_embedding import (
DEFAULT_VOCAB_PADDING_SIZE, ParallelLMHead, VocabParallelEmbedding)
from vllm.model_executor.model_loader.weight_utils import default_weight_loader
from vllm.model_executor.model_loader.weight_utils import (
default_weight_loader, maybe_remap_kv_scale_name)
from vllm.model_executor.sampling_metadata import SamplingMetadata
from vllm.sequence import IntermediateTensors
from vllm.transformers_utils.configs.dbrx import DbrxConfig
@@ -425,6 +426,11 @@ class DbrxForCausalLM(nn.Module, SupportsPP):
weight_loader(param, loaded_weight, weight_name)
break
else:
# Remapping the name of FP8 kv-scale.
name = maybe_remap_kv_scale_name(name, params_dict)
if name is None:
continue
if is_pp_missing_parameter(name, self):
continue
param = params_dict[name]