Open
【11月贡献大赛-缺陷修复】fix(w8a8-llm-quant-npu): [Bug] compute scale product in fp32, drop consumed weight_scale keys, and support sharded safetensors in dequantize_w8a8.py #7334
liuhongweiAdd on 3 hours ago
【11月贡献大赛-缺陷修复】fix(w8a8-llm-quant-npu): [Bug] compute scale product in fp32, drop consumed weight_scale keys, and support sharded safetensors in dequantize_w8a8.py #7334
Open
Merge blocked
3 hours ago Added label: ascend-cla/yes
ascend-robot
3 hours ago Comments:
3 hours ago Comments:
Thanks for your pull-request.
The full list of commands accepted by me can be found at here.
You can get sig-info at here.
You can self-configure the PR merge rules for this repository. For more details, please refer to Here.
PR Approval Progress
⚠️ This PR does not yet meet the following requirements:lgtm (requires ≥ 2 person(s) per module)、approve (requires ≥ 1 person(s) per module)
Module Approval Details
| module | lgtm status | approve status |
|---|---|---|
| sig-model-agent | ❌ (0/2)(You can also ask: 花新宇, 张玉橙, starmountain, 焦泽昱, cookieyyds) | ❌ (0/1)(You can also ask: 陈少宏, 胡晓曼, 顾梦沁, 张玉橙, 刘磊) |
💡 Tip:
- Committer can comment
/approveor/lgtm- Commenting
/approveimplies both code review (lgtm) and intent to merge (approve)
CLA Signature Pass
liuhongwei-2026, thanks for your pull request. All authors of the commits have signed the CLA. 👍


关联 Issue
改动说明
skills/quantization/w8a8-llm-quant-npu/scripts/dequantize_w8a8.py中小尺度weight_scale先转float16下溢归零的问题,改为(t.float() * scale.float()).to(torch.float16)在 FP32 完成缩放后再转回float16。*.weight/*.weight_scale(避免.replace(".weight", ...)误改中间层名),剔除已被消费的*.weight_scale键并同步清理model.safetensors.index.json中的weight_map。_find_weight_shards()与_index_shards_and_consumed_scales()支持单分片model.safetensors与多分片model-*.safetensors,同时防护src == dst同路径覆盖及缺失config.json场景。skills/quantization/w8a8-llm-quant-npu/tests/test_dequantize_w8a8.py。改动类型
自检清单
测试结果
python -m pytest -q skills/quantization/w8a8-llm-quant-npu/tests/test_dequantize_w8a8.py # 3 passed in 1.79s