已合并
【26.2.0众测】ArgoNorthrop 任务1+任务2 交付件 #39
【26.2.0众测】ArgoNorthrop 任务1+任务2 交付件 #39
已合并
程康博创建于 9月15日
程康博
程康博
9月15日

提交内容

本次提交 TorchNPU 26.1.0 众测任务1、任务2全部交付件,位于 01_tasks/2026/torch_npu_public_beta/ArgoNorthrop/,顶层文件夹名为 GitCode 账号名。

任务1-安装与快速入门

  • transfer_to_npu 自动迁移 + AMP 混合精度 MNIST 训练脚本(10 epoch,train_acc 0.9789,产出 checkpoint.pth.tar)
  • pip list、torch_npu 导入(device='npu:0')、训练成功、权重文件共 4 张截图

任务2-torch.compile 体验与实践

统一使用自选模型 distilbert-base-uncased(DistilBertForMaskedLM) 完成 13 个示例:

  • Guard Filter 6 个示例(字典版本 / 运行时状态 / 组合多类 / 按变量名 / 全局变量 / 内置 helper):
    编译对象为 DistilBertForMaskedLM 实例本身、或内部调用该模型的普通 Python 函数,不含任何自建网络模型;
    每示例均在 910B3 实跑验证重编译消除(fail_on_recompile)、正确性(allclose atol=1e-4,max|Δ| 2.5e-05~4.8e-05)、
    性能对比,共 18 张证据截图(官方要求的重编译/正确性/性能 3 张 + 示例2~6 各 3 张)。
  • 7 个后端(AOT_Eager、NPUGraphs、NPUGraph_EX、TorchAir-GE、Inductor-Triton/MLIR/DVM)各 1 脚本 +
    正确性/性能 2 图;正确性全部通过(allclose atol=1e-4);
    图类后端稳态延迟:TorchAir-GE 2.34x、NPUGraph_EX 2.01x、NPUGraphs 1.69x;
    Inductor 三后端在小算子密集推理上的真实表现如实呈现(Triton 0.68x / MLIR 0.77x / DVM 0.22x)。

实验环境

Atlas 800T A2(910B3) / CANN 9.1.0 / Python 3.12 aarch64
torch 2.7.1 + torch_npu 2.7.1.post8(7 后端);torch/torch_npu 2.9.0.post8(Guard Filter,guard_filter_fn 需 2.9+)

关联代码仓 Issue(Ascend/pytorch,共 14 个,均实测复现;PR 在生态仓故用完整链接跨仓关联)

26.2.0 新组合(910B2 / CANN 9.1.0 / torch 2.12.0+cpu / torch_npu 2.12.0 / triton-ascend 3.5.0)补充实测 4 个:

另在 #4925(AOTI 入口不触发 torch_npu 懒注册,Device npu not supported)下补充了 26.2.0 正式发版组合的实测评论。

交付清单

共 54 个文件(单提交):

  • 任务1:7 个(README.txt + 训练脚本 + 4 截图 + xls)
  • 任务2:47 个(Guard Filter 6 脚本 + 18 截图;7 后端各 3 文件;交付件说明 + xls)
  • PR:本 MR(Ascend/pytorch-ecosystem #39)

修订记录(按审核意见)

  1. Guard Filter 6 个示例已全部改为实际使用 DistilBertForMaskedLM,旧版自建小模型类已全部移除;
  2. 补齐示例2~6 的重编译消除/正确性/性能三类证据截图;
  3. 示例6 补充真实重编译消除实验(内建 Linear 换同语义异型子类:baseline 重编译、helper 过滤后不重编译);
  4. Issue 已按通知统一提交至代码仓 Ascend/pytorch,并更新两个链接交付件.xls。
  5. 26.2.0 新组合补充实测 4 个 issue(#5111-#5114,已同步更新两份链接交付件.xls)。
likedislike
Pull Request已成功合入, 合并人@ascend-robot
(感谢 程康博 的贡献)
程康博程康博
9月15日 关联了issue:【26.2.0 众测】transfer_to_npu 文档描述容易误导使用者,误以为需要函数调用,【26.2.0 众测】快速入门案例 AMP 混合精度训练容易出现梯度溢出,缺少提示,【26.2.0众测】torch 2.9 guard_filter_fn 移除 GRAD_MODE 等运行时状态 guard 后仍被判定重编译,【26.2.0众测】torchair configure 将驱动日志 “DrvMngGetConsoleLogLevel failed” 误作编译选项导致 c++ 编译失败,【26.2.0众测】inductor 在 CI=true 下触发 make_fallback 断言、低内存编译需单线程等环境注意事项建议补充文档
ascend-robotascend-robot成员
9月15日 添加了label:ascend-cla/no
ascend-robot
ascend-robot成员
9月15日 评论:

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

✅ Congratulations! All modules have met the lgtm and approve requirements.

Module Approval Details

module lgtm status approve status
repo-Ascend/pytorch-ecosystem ✅ qianxiyue, yi_jiabin (2/2) ✅ yi_jiabin, qianxiyue (2/1)

💡 Tip:

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

CLA Signature Pass

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

likedislike
程康博程康博
9月15日 推送  1 个提交:877b706b-【26.2.0众测】ArgoNorthrop 回填两个链接交付件.xls 的 PR 链接
ascend-robotascend-robot成员
9月15日 添加了label:stat/needs-squash
此处折叠了60条消息 查看更多
ascend-robotascend-robot成员
12 天前 添加了label:approved
hid87721478成员
12 天前 评论:

/approve

likedislike
ascend-robotascend-robot成员
12 天前 添加了label:lgtm
ascend-robotascend-robot成员
12 天前 关闭了关联的issue
ascend-robotascend-robot成员
12 天前 合入了pull request