已合并
fix: fix npugrphs backend bug and add indexput test case #31724
luochao60创建于 3月12日
fix: fix npugrphs backend bug and add indexput test case #31724
已合并
Pull Request已成功合入, 合并人@ascend-robot
(感谢 luochao60 的贡献)AtlasAccount
3月12日 评论:
3月12日 评论:
ascend-robot
3月12日 评论:
3月12日 评论:
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
PR Approval Progress
✅ Congratulations! All modules have met the lgtm and approve requirements.
Module Approval Details
| module | lgtm status | approve status |
|---|---|---|
| test | ✅ adrian07110, suhaibo (2/2) | ✅ adrian07110 (1/1) |
| torch_npu/_inductor | ✅ adrian07110, suhaibo (2/2) | ✅ adrian07110 (1/1) |
💡 Tip:
- Committer can comment
/approveor/lgtm- Commenting
/approveimplies both code review (lgtm) and intent to merge (approve)
CLA Signature Pass
luochao60, thanks for your pull request. All authors of the commits have signed the CLA. 👍


3月12日 添加了label:ascend-cla/yes
此处折叠了80条消息 查看更多
3月25日 添加了label:approved
3月25日 添加了label:lgtm
ascend-robot
3月25日 评论:
3月25日 评论:
Review Guide
This pull-request passes review.
Committers who wrote a comment of /approve are: adrian07110.
Reviewers who wrote a comment of /lgtm are: adrian07110, suhaibo.


3月25日 合入了pull request
【合入来源】
【修改方案】
修复
patch_get_first_incompatible_cudagraph_nodemonkey patch 不生效的问题(torch_npu/_inductor/utils.py):compile_fx和cudagraphs模块 patch 时的hasattr条件判断,改为直接赋值覆盖,因为 torch_npu 与 torch 是固定版本匹配的,不需要兼容性判断torch_npu.utils._graph_tree模块的 patch:该模块通过from torch._inductor.utils import get_first_incompatible_cudagraph_node拿走了原始引用,必须显式覆盖该模块命名空间中的引用,否则 npugraphs 后端无法正确检测 cudagraph-unsafe 算子修复
_graph_tree.py中的代码格式问题(torch_npu/npu/_graph_tree.py):新增 ACL graph 特殊算子的测试用例(
test_acl_graph_special_op.py):test_masked_assign_forward:验证tensor[bool_mask] = -1(aten.index_put_ with bool indices)在 inductor 后端 cudagraphs 模式下被正确检测为 cudagraph-unsafe 并回退到 eager 执行,支持 float32/float16 参数化测试test_masked_assign_forward_backward:验证包含 bool index_put 的前向+反向传播在 inductor 后端下的正确性test_npugraphs_masked_assign_forward:同上,使用 npugraphs 后端验证test_npugraphs_masked_assign_forward_backward:同上,使用 npugraphs 后端验证前向输出和梯度正确性【资料变更】
不涉及
【接口变更】
不涉及
【功能验证】
已新增 UT 测试用例
test_acl_graph_special_op.py,覆盖以下场景:torch.compile编译后与 eager 模式对比输出和梯度一致性【CheckList】