Unverified Commit 1f4b09b5 authored by yueshen2016's avatar yueshen2016 Committed by GitHub
Browse files

Add support to modelopt quantization of Mixtral model (#15961)


Signed-off-by: default avatarYue <yueshen@nvidia.com>
parent 86c3369e
......@@ -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
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment