Open
test: QAT FP8 整改用例(切片 2/9) #202
zhaiyaxing001Add on 22 hours ago
test: QAT FP8 整改用例(切片 2/9) #202
Open
Merged fromzhaiyaxing001/torchao_npuqat/pr2intoAscend/torchao-ascendmain
Merge blocked
22 hours ago Created pull request, commit 83ddbddc
22 hours ago Associated issue: [Test]: 补充 QAT 量化感知训练 NPU 测试(FP8/INT4/INT8/INTx),[RFC] KernelPreference 扩展:新增原生内核成员 ASCEND
22 hours ago Associated issue: [Test]: 补充 QAT 量化感知训练 NPU 测试(FP8/INT4/INT8/INTx),[RFC] KernelPreference 扩展:新增原生内核成员 ASCEND
22 hours ago Added label: ascend-cla/yes
ascend-robot
22 hours ago Comments:
22 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 |
|---|---|---|
| repo-Ascend/torchao-ascend | ❌ (0/2)(You can also ask: wanglijun55, chujinjin, chengpeng25, jishuangfeng, weixin_38374194) | ❌ (0/1)(You can also ask: li_jing_hw, liangsongwei, chujinjin, 褚博宁, 楚浩田) |
💡 Tip:
- Committer can comment
/approveor/lgtm- Commenting
/approveimplies both code review (lgtm) and intent to merge (approve)
CLA Signature Pass
zhaiyaxing001, thanks for your pull request. All authors of the commits have signed the CLA. 👍


zhaiyaxing001
22 hours ago Comments:
22 hours ago Comments:
compile


22 hours ago Pre merge succeeded (commit_id: ce2e6b0b6292ce1ae08e4470109c40688e7b0095)
22 hours ago Added label: ci-pipeline-running
22 hours ago Removed label: ci-pipeline-running
22 hours ago Added label: ci-pipeline-passed
AtlasAccount
22 hours ago Comments:
22 hours ago Comments:
流水线 PR-pipeline_torchao_npu#319 [ commitID:4d43fde8 ] 已完成
>>>代码风格自动修复执行成功(无修复内容)
| 阶段 | 任务名 | 状态 | 详情 |
|---|---|---|---|
| 编译构建 | Build_x86 | ✅ COMPLETED | >>> |
| 恶意代码检查 | Antipoison | ✅ COMPLETED | >>> |
| 编码安全与规范检查 | pre-commit | ✅ COMPLETED | >>> |
| 开源片段检查 | SCA | ✅ COMPLETED | >>> |
| 流水线 | PR-pipeline_torchao_npu | ✅ COMPLETED | >>> |
- compile : 运行流水线
- retry : 重试流水线所有失败子任务
- retry <任务名> : 仅重试指定失败子任务
- stop : 停止流水线


34 minutes ago Modify description of pull request
24 minutes ago Modify description of pull request
1 minute ago Modify description of pull request
一、背景
QAT 迁移系列切片 2/9(前置:切片 1 = PR #10 已合入;本次增量合入:+73 行,单文件,纯测试迁移无 patch)。
二、变更
test/quantization/test_qat.py新增 3 方法 5 实例(FP8 整改迁移):test_quantize_api_fp8_fp8(2)Float8DynamicActivationFloat8WeightConfig下 prepare(fake-quant 前向)输出对照一步 PTQ 基线(SQNR≥15);convert 后 linear1/linear2/sub.linear 权重均为Float8Tensor且输出与 PTQ 逐位一致_test_quantize_api_against_ptqhelper 对照 PTQtest_float8_fake_quantize(2)Float8FakeQuantizer前向伪量化数值正确性:fp8 量化/反量化往返输出对照Float8Tensor.from_hp().dequantize()参照(SQNR>16)from_hp().dequantize()为同语义参照实现,SQNR>16 判据沿用上游test_fake_quantizer_enabled_attribute(1)FakeQuantizer.enabled门控语义:False 时输出与输入逐位一致(直通)、True 时输出改变(执行量化)——Int4 权重假量化器开/关两态 + Float8 假量化器关态直通_convert_weight_to_int4pack等)无 NPU 实现(能力矩阵已定案),上设备会因算子缺口失败而非语义失败;Float8 仅覆盖 disabled 直通——enabled 路径需 fp8 算子面,由test_float8_fake_quantize承接,避免同实例混入设计内失败三、功能验证
(链条 27→32 与设计一致);切片 2 5P 全过;同跑切片 1 复跑 21P/6F——6F 为
MX forward e5m2×6(950DT 原生
_scaled_mm不支持 e5m2 矩阵乘,先保留登记issue,后续随策略补齐)。四、资料变更
含自 pytorch/ao(BSD-3-Clause)
test/quantization/test_qat.py迁移适配用例,方法名与上游对齐、适配点见 docstring;无新增第三方依赖。
五、Checklist