已关闭
feat(w4a16): 添加 Qwen3 整网训练、推理与评测示例 #199
chen_pengyu创建于 1 天前关闭于 23 小时前
feat(w4a16): 添加 Qwen3 整网训练、推理与评测示例 #199
已关闭
chen_pengyu创建于 1 天前关闭于 23 小时前
chen_pengyu
chen_pengyu
1 天前

【合入来源】

基于已合入的 PR #145,补齐 Qwen3 Dense 和 MoE 的整网训练、推理和评测示例。

【修改方案】

  1. 训练与导出。新增 Qwen3 W4A16 QAT 示例,使用 FSDP2 训练 Dense 和 MoE 模型,复用已有权重转换和 safetensors 序列化接口导出 W4A16 checkpoint。
  2. 整网推理。新增 inference_w4a16.py,支持从本地 BF16 基模或已打包的 W4A16 checkpoint 加载 Qwen3,并在 Ascend NPU 上生成文本。Dense 前向通过已有 W4A16 Tensor 调用融合权重量化矩阵乘。
  3. 批量评测。新增 Qwen3 W4A16 的 lm_eval 入口,复用示例模型加载逻辑。评测脚本支持加载已导出的 checkpoint,并汇总 BF16 与 W4A16 的对比结果。

【资料变更】

更新 W4A16 推理使用说明和评测 README,补充训练、推理、评测命令及实测口径。完整模型的精度、时延和显存数据见 Qwen3 W4A16 测评文档。

【接口变更】

新增示例脚本和评测入口,沿用 PR #145 的库 API 和 checkpoint 格式。

【功能验证】

  • 当前 PR 提交通过 git diff --check 和 Python 语法检查。
  • rebase 前在 Ascend 950DT 上完成 Qwen3-32B Dense 和 Qwen3-30B-A3B MoE 的 200 步 QAT 和权重导出。整网推理与 BF16 对照评测的模型、配置及源码快照见测评文档。

【CheckList】

likedislike
当前Pull Request已关闭, 关闭人@chen_pengyu
chen_pengyuchen_pengyu
1 天前 创建了 pull request,commit 811489ef
ascend-robotascend-robot成员
1 天前 添加了label:stat/needs-squash
ascend-robotascend-robot成员
1 天前 添加了label:ascend-cla/yes
ascend-robot
ascend-robot成员
1 天前 评论:

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: chujinjin, li_jing_hw, 褚博宁, lizhihai137, weixin_38374194) ❌ (0/1)(You can also ask: 褚博宁, 楚浩田, chengpeng25, wanglijun55, li_jing_hw)

💡 Tip:

  • Committer can comment /approve or /lgtm
  • Commenting /approve implies both code review (lgtm) and intent to merge (approve)

CLA Signature Pass

chen_pengyu, thanks for your pull request. All authors of the commits have signed the CLA. 👍

likedislike
chen_pengyuchen_pengyu
1 天前 修改了pull request 的描述
此处折叠了62条消息 查看更多
chen_pengyuchen_pengyu
23 小时前 预合并成功(commit_id: b6d9ee3ff72d3282a603748993aee490dbf47321)
ascend-robot
ascend-robot成员
23 小时前 评论:

Warning

The PR commit(s) can not be got, please check it!

likedislike
ascend-robotascend-robot成员
23 小时前 删除了label:ascend-cla/yes
ascend-robotascend-robot成员
23 小时前 添加了label:ascend-cla/yes
chen_pengyuchen_pengyu
23 小时前 关闭了 pull request