已合并
[fix][inductor] fix master triton acc-check bug #43556
lv-kaimeng创建于 8月1日
[fix][inductor] fix master triton acc-check bug #43556
已合并
lv-kaimeng创建于 8月1日
lv-kaimeng成员
8月1日

【合入来源】

如有社区issue,请关联issue链接
请勿携带内部流程信息(需求链接、问题单、内部issue等)

【修改方案】

  1. 修复master上导入问题
  2. 修复动态shape问题
  3. 修复wrap_neg
  4. 修复stream重复传参问题
  5. 修复catkernel问题
  6. 修复多次调用覆盖写问题

【资料变更】

请确认是否涉及资料变更。如涉及,需要在PR中体现,并简要说明修改内容。如不涉及,需填写“不涉及”

【接口变更】

请确认是否涉及跨代码仓或者客户面可见的接口变更。如涉及,需要详细说明接口以及对应的变更内容,同时需要在资料中体现。如不涉及,需填写“不涉及”

【功能验证】

说明测试场景,测试方法。如果本次测试方式与常规单元测试不同,请详细说明您的测试步骤
新增/变更内容是否已新增/适配UT测试用例看护,并补充测试自验证截图

【CheckList】

PR提交人对以下CheckList自检项进行全量自检,自检通过或不涉及,均修改 [ ] 为 [x]

likedislike
Pull Request已成功合入, 合并人@ascend-robot
(感谢 lv-kaimeng 的贡献)
Llv-kaimeng成员
8月1日 创建了 pull request,commit 3a7f5393
atomgit-bot
atomgit-bot
8月1日 评论:

变更摘要

本 PR 为 bug 修复(fix master bug),主要围绕 torch_npu/_inductor 中与 FX 图导出/精度校验(INDUCTOR_ASCEND_CHECK_ACCURACY)相关的链路进行修正与补齐。核心改动包括:_patch_mark_reuse 透传可变关键字参数,确保 mark_reuse 调用与上游签名一致;NPUTritonKernelinductor_meta 中重新注入 traced_graph_hash / traced_graph_dir 占位符,供精度校验工具定位导出的 FX 图;lowering.py 补齐 create_fake_inputsubtract_graphsnodes_to_fxgenerate_fx_graph_code 等符号的导入。

主要改动

  • _patch_mark_reuse 支持 **kwargs 透传torch_npu/_inductor/codegen/ir_fx.py_patch_mark_reuse(self, users, **kwargs) 将额外的关键字参数传递给 self.data.mark_reuse(users, **kwargs)(有/无 traced_graph 两个分支均如此),避免调用签名不匹配导致的兼容性问题。

  • NPUTritonKernel 重新注入 FX 图定位元数据torch_npu/_inductor/codegen/triton.pycreate_inductor_meta 中通过 setdefaulttraced_graph_hashtraced_graph_dir 占位符写回 inductor_meta,因为上游 super().codegen_kernel() 重写 inductor_meta 时会丢弃这些字段;实际值由 SchedulerNodeCodeGenerator.define_kernel 在启用 dump_fx_graph 时文本替换。

  • 补齐 lowering.py 缺失的符号导入torch_npu/_inductor/lowering.py 新增从 .lowering_common 导入 create_fake_inputsubtract_graph,从 .lowering_fx 导入 create_fx_from_snodes_by_traced_graphcreate_compile_kwargsgenerate_fx_graph_codedump_fx_graph_codesnodes_to_fx,修复相关函数引用导致的运行时错误。

likedislike
atomgit-bot
atomgit-bot
8月1日 评论:

代码审查

✅ 未发现问题

likedislike
ascend-robotascend-robot成员
8月1日 添加了label:ascend-cla/yes
此处折叠了154条消息 查看更多
ascend-robotascend-robot成员
29 天前 添加了label:approvedlgtm
ascend-robotascend-robot成员
29 天前 关闭了关联的issue
ascend-robotascend-robot成员
29 天前 合入了pull request
ascend-robot
ascend-robot成员
29 天前 评论:
流水线 pytorch_gitcode_PR_multiVersion#13754 [ commitID:fea375ca ] 运行失败
likedislike
Llv-kaimeng成员
28 天前 修改了pull request 的描述