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 15, 14:45 UTC
Add support to modelopt quantization of Mixtral model (#15961)
Signed-off-by: Yue <yueshen@nvidia.com>
yueshen2016 committed
Apr 8, 2025 at 18:53 UTC
1f4b09b525bc53d464219d72710c8f229fe2d5ca
1 file changed
+7
-1
vllm/model_executor/models/mixtral_quant.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
@@ -420,6 +421,11 @@ class MixtralForCausalLM(nn.Module, SupportsPP):
421
for name, loaded_weight in weights:
422
if "rotary_emb.inv_freq" in name:
423
continue
424
+ if name.endswith("scale"):
425
+ # Remapping the name of FP8 kv-scale.
426
+ name = maybe_remap_kv_scale_name(name, params_dict)
427
+ if name is None:
428
+ continue
429
for (param_name, weight_name, shard_id) in stacked_params_mapping:
430
if weight_name not in name:
431
continue