已关闭
[Bug]: Qwen3-30B-A3B模型执行w4a8量化叠加gptq量化算法,量化报错ERROR - Original exception: ZeroDivisionError('division by zero') #30
mominhua创建于 2月6日关闭于 2月13日
SuperMeixc
2月6日 评论:
2月6日 评论:
您好,问题已收到,我们会尽快修复,请关注此issue进展


SuperMeixc
2月6日 评论:
2月6日 评论:
/label add triaged


2月6日 添加了label:triaged
2月9日 关联了pull request:【bugfix】MOE模型GPTQ量化报错场景优化
SuperMeixc
2月10日 评论:
2月10日 评论:
/label add resolved


2月10日 添加了label:resolved
SuperMeixc
2月10日 评论:
2月10日 评论:
/label remove triaged


2月10日 删除了label:triaged
2月11日 issue状态由 TODO 改变为 DONE
2月11日 关闭了 issue
2月13日 issue状态由 DONE 改变为 TODO
2月13日 重新打开了 issue
SuperMeixc
2月13日 评论:
2月13日 评论:
问题已解决,请进行验证


mominhua
2月13日 评论:
2月13日 评论:
测试通过,问题已解决
1、检查资料增加moe模型相关限制说明
资料增加限制:https://gitcode.com/Ascend/msmodelslim/blob/master/docs/zh/algorithms_instruction/gptq.md

2、使用moe模型,跑gptq算法,报错日志清晰



3月11日 关联了里程碑:MindStudio 26.0.0
在提交新问题之前,请确保您已经在社区中搜索过相关问题,并使用了社区中提供的资源/工具后,仍未找到满意的解决方式。
⚠️ 安全信息提醒:请仔细检查提供的文本内容,确保其不包含敏感数据信息,包括但不限于:
在分享配置信息或代码示例时,请将敏感信息脱敏处理,或使用
<TOKEN>等占位符替代原有内容。环境信息
msmodelslim拉取的本代码仓master源码
环境为A2环境
🐛 问题描述
yaml配置如下:
apiversion: modelslim_v1
default_w8a8_dynamic: &default_w8a8_dynamic
act:
scope: "per_token"
dtype: "int8"
symmetric: True
method: "minmax"
weight:
scope: "per_channel"
dtype: "int8"
symmetric: True
method: "ssz"
default_w4a8_dynamic: &default_w4a8_dynamic
act:
scope: "per_token"
dtype: "int8"
symmetric: True
method: "minmax"
weight:
scope: "per_channel"
dtype: "int4"
symmetric: True
method: "gptq"
ext:
group_size: 64
spec:
process:
- type: "flex_smooth_quant"
enable_subgraph_type:
- 'norm-linear'
- 'ov'
include:
- ""
- type: "group"
configs:
- type: "linear_quant"
qconfig: default_w8a8_dynamic
include: ["self_attn"]
- type: "linear_quant"
qconfig: default_w8a8_dynamic
include: ["mlp"]
exclude: ["gate", "mlp.experts."]
- type: "linear_quant"
qconfig: default_w8a8_dynamic
include: ["model.layers.41.mlp.experts", "model.layers.41.mlp.experts", "model.layers.42.mlp.experts", "model.layers.43.mlp.experts", "model.layers.44.mlp.experts", "model.layers.45.mlp.experts", "model.layers.46.mlp.experts", "model.layers.47.mlp.experts"]
- type: "linear_quant"
qconfig: default_w4a8_dynamic
include: ["mlp.experts"]
exclude: ["model.layers.41.", "model.layers.42.", "model.layers.43.", "model.layers.44.", "model.layers.45.", "model.layers.46.", "model.layers.47."]
save:
- type: "ascendv1_saver"
part_file_size: 4
执行量化命令:
msmodelslim quant --model_path /packages/models_weight/Qwen3-30B-A3B/ --save_path /home/msmodelslim/model_quant/Qwen3-30B-A3B-w4a8-gptq-per-token-per-channel --model_type Qwen3-30B --device npu --config_path /home/msmodelslim/yaml/qwen3-30b-w4a8-per_token_gptq_per_channel.yaml --trust_remote_code True
量化报错:


2026-02-06 15:07:52,674 - msmodelslim.app.naive_quantization - ERROR - [UnexpectedError] Code: 500, Message: Unexpected error., TIP: Please report this issue to the msModelSlim developers. Repository: https://gitcode.com/Ascend/msmodelslim Q&A: https://gitcode.com/Ascend/msmodelslim/blob/master/docs/zh/faq.md
2026-02-06 15:07:52,674 - msmodelslim.app.naive_quantization - ERROR - Original exception: ZeroDivisionError('division by zero')
欢迎加入社区,感谢您对社区的贡献 🎉!