From 1f4b09b525bc53d464219d72710c8f229fe2d5ca Mon Sep 17 00:00:00 2001 From: yueshen2016 <39203804+yueshen2016@users.noreply.github.com> Date: Tue, 8 Apr 2025 18:53:31 -0700 Subject: [PATCH] Add support to modelopt quantization of Mixtral model (#15961) Signed-off-by: Yue --- vllm/model_executor/models/mixtral_quant.py | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/vllm/model_executor/models/mixtral_quant.py b/vllm/model_executor/models/mixtral_quant.py index 5be91f40bb258..96eb925cf894d 100644 --- a/vllm/model_executor/models/mixtral_quant.py +++ b/vllm/model_executor/models/mixtral_quant.py @@ -45,7 +45,8 @@ from vllm.model_executor.layers.rotary_embedding import get_rope from vllm.model_executor.layers.sampler import SamplerOutput, get_sampler from vllm.model_executor.layers.vocab_parallel_embedding import ( 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 @@ -420,6 +421,11 @@ class MixtralForCausalLM(nn.Module, SupportsPP): for name, loaded_weight in weights: if "rotary_emb.inv_freq" in name: continue + if name.endswith("scale"): + # Remapping the name of FP8 kv-scale. + name = maybe_remap_kv_scale_name(name, params_dict) + if name is None: + continue for (param_name, weight_name, shard_id) in stacked_params_mapping: if weight_name not in name: continue