[Model]Support Step-3.7-Flash (#43859)
Signed-off-by: luotingdan <luotingdan@stepfun.com> Signed-off-by: Isotr0py <Isotr0py@outlook.com> Signed-off-by: Jee Jee Li <jeejeelee@inferact.ai> Co-authored-by: luotingdan <luotingdan@stepfun.com> Co-authored-by: Isotr0py <Isotr0py@outlook.com> Co-authored-by: Yu Huang <yuhuang@nvidia.com> Co-authored-by: Jee Jee Li <jeejeelee@inferact.ai>
This commit is contained in:
co-authored by
luotingdan
Isotr0py
Yu Huang
Jee Jee Li
parent
325a1ec4fb
commit
b690b2bb67
@@ -192,7 +192,11 @@ class ModelOptQuantConfigBase(QuantizationConfig):
|
||||
# exclude_modules config. But need to keep them for loading quantized
|
||||
# checkpoints generated by older versions. Then check substring matching
|
||||
# for patterns not caught by exact match
|
||||
if "vision_tower" in prefix or "vision_model" in prefix:
|
||||
if (
|
||||
"vision_tower" in prefix
|
||||
or "vision_model" in prefix
|
||||
or "vit_large_projector" in prefix
|
||||
):
|
||||
return UnquantizedLinearMethod()
|
||||
|
||||
# now, the layer is quantized, handle it here
|
||||
@@ -2340,6 +2344,14 @@ class ModelOptMixedPrecisionConfig(ModelOptQuantConfigBase):
|
||||
if key.startswith(prefix_dot):
|
||||
return info["quant_algo"].upper()
|
||||
|
||||
# FusedMoE expert prefix is e.g. "...moe.experts", while ModelOpt's
|
||||
# quantized_layers entries use "...moe.gate_proj" / "...moe.up_proj".
|
||||
if prefix.endswith(".experts"):
|
||||
parent_dot = prefix.rsplit(".experts", 1)[0] + "."
|
||||
for key, info in self.quantized_layers.items():
|
||||
if key.startswith(parent_dot):
|
||||
return info["quant_algo"].upper()
|
||||
|
||||
return None
|
||||
|
||||
@staticmethod
|
||||
|
||||
Reference in New Issue
Block a user