已合并
fix: npugraph_ex补充用户自定义backend和自定义pass缺失的接口 #30367
Xu Zhenhua创建于 2月2日
fix: npugraph_ex补充用户自定义backend和自定义pass缺失的接口 #30367
已合并
Pull Request已成功合入, 合并人@ascend-robot
(感谢 Xu Zhenhua 的贡献)2月2日 创建了 pull request,commit 22979574
AtlasAccount
2月2日 评论:
2月2日 评论:
ascend-robot
2月2日 评论:
2月2日 评论:
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
以下是根据您提交的修改文件推荐的Reviewer和Committer序列,需各模块评审通过后方可合入.
| Module List | Reviewers | Committers |
|---|---|---|
| repo-Ascend/pytorch | kuhn7, liangsongwei, dilililiwhy, wangchao430, zqwenn | liwei386, dilililiwhy, shaoyf, wangchao285, wangqiang160 |


2月2日 添加了label:stat/needs-squash
2月2日 添加了label:ascend-cla/yes
Xu Zhenhua
2月2日 评论:
2月2日 评论:
compile


2月2日 添加了label:ci-pipeline-running
此处折叠了5条事件消息 查看更多
2月2日 添加了label:ci-pipeline-failed
ascend-robot
2月2日 评论:
2月2日 评论:
流水线 PR-pipeline_pytorch#5671 (重试第1次)运行失败
| 阶段 | 任务名 | 状态 | 详情 |
|---|---|---|---|
| 编译构建 | Build_X86 | 🕚 | >>> |
| Build_LibTorch | 🕚 | >>> | |
| Build_ARM | 🕚 | >>> | |
| Build_ARM_inductor | 🕚 | >>> | |
| Build_X86_py311 | 🕚 | >>> | |
| Build_ARM_py311 | 🕚 | >>> | |
| 恶意代码检查 | Antipoison | ✅ | >>> |
| 编码安全与规范检查 | CodeCheck | ❌ | >>> |
| check_error | ✅ | >>> | |
| 开源片段检查 | SCA | ✅ | >>> |
| 开发者测试 | UT_DIST_X86 | 🕚 | >>> |
| UT_X86_Part_01 | 🕚 | >>> | |
| UT_X86_Part_02 | 🕚 | >>> | |
| UT_ARM_A2_Part_01 | 🕚 | >>> | |
| UT_ARM_A2_Part_02 | 🕚 | >>> | |
| UT_inductor_Part_01 | 🕚 | >>> | |
| UT_inductor_Part_02 | 🕚 | >>> | |
| UT_inductor_Part_03 | 🕚 | >>> | |
| UT_inductor_Part_04 | 🕚 | >>> | |
| 流水线 | PR-pipeline_pytorch | ❌ | >>> |


Xu Zhenhua
2月2日 评论:
2月2日 评论:
compile


2月2日 删除了label:ci-pipeline-failed
2月2日 添加了label:ci-pipeline-running
2月2日 删除了label:ci-pipeline-running
2月2日 添加了label:ci-pipeline-failed
ascend-robot
2月2日 评论:
2月2日 评论:
流水线 PR-pipeline_pytorch#5683 运行失败
| 阶段 | 任务名 | 状态 | 详情 |
|---|---|---|---|
| 编译构建 | Build_X86 | 🕚 | >>> |
| Build_LibTorch | 🕚 | >>> | |
| Build_ARM | 🕚 | >>> | |
| Build_ARM_inductor | 🕚 | >>> | |
| Build_X86_py311 | 🕚 | >>> | |
| Build_ARM_py311 | 🕚 | >>> | |
| 恶意代码检查 | Antipoison | ✅ | >>> |
| 编码安全与规范检查 | CodeCheck | ❌ | >>> |
| check_error | ✅ | >>> | |
| 开源片段检查 | SCA | ✅ | >>> |
| 开发者测试 | UT_DIST_X86 | 🕚 | >>> |
| UT_X86_Part_01 | 🕚 | >>> | |
| UT_X86_Part_02 | 🕚 | >>> | |
| UT_ARM_A2_Part_01 | 🕚 | >>> | |
| UT_ARM_A2_Part_02 | 🕚 | >>> | |
| UT_inductor_Part_01 | 🕚 | >>> | |
| UT_inductor_Part_02 | 🕚 | >>> | |
| UT_inductor_Part_03 | 🕚 | >>> | |
| UT_inductor_Part_04 | 🕚 | >>> | |
| 流水线 | PR-pipeline_pytorch | ❌ | >>> |


2月2日 update merge request[project id: 7404318, iid: 30367, commit_id: 049342cf1dcb6a8be02041b3316b3e42d4f4d672] virtual merging success
2月2日 update merge request[project id: 7404318, iid: 30367, commit_id: 049342cf1dcb6a8be02041b3316b3e42d4f4d672] virtual merging success
2月2日 推送 1 个提交:3a4a4064-Decouple npugraph_ex and torchair-ge
2月2日 update merge request[project id: 7404318, iid: 30367, commit_id: 748608f788d8370b87aec18099497eb9d5835915] virtual merging success
2月2日 update merge request[project id: 7404318, iid: 30367, commit_id: 748608f788d8370b87aec18099497eb9d5835915] virtual merging success
ascend-robot
2月2日 评论:
2月2日 评论:
2月2日 删除了label:ci-pipeline-failed
2月2日 添加了label:ci-pipeline-failed
Xu Zhenhua
2月2日 评论:
2月2日 评论:
compile


2月2日 删除了label:ci-pipeline-failed
2月2日 添加了label:ci-pipeline-running
2月2日 删除了label:ci-pipeline-running
2月2日 添加了label:ci-pipeline-passed
ascend-robot
2月2日 评论:
2月2日 评论:
流水线 PR-pipeline_pytorch#5684 已完成
| 阶段 | 任务名 | 状态 | 详情 |
|---|---|---|---|
| 编译构建 | Build_X86 | ✅ | >>> |
| Build_LibTorch | ✅ | >>> | |
| Build_ARM | ✅ | >>> | |
| Build_ARM_inductor | 🛑 | >>> | |
| Build_X86_py311 | 🛑 | >>> | |
| Build_ARM_py311 | 🛑 | >>> | |
| 恶意代码检查 | Antipoison | ✅ | >>> |
| 编码安全与规范检查 | CodeCheck | ✅ | >>> |
| check_error | ✅ | >>> | |
| 开源片段检查 | SCA | ✅ | >>> |
| 开发者测试 | UT_DIST_X86 | 🛑 | >>> |
| UT_X86_Part_01 | ✅ | >>> | |
| UT_X86_Part_02 | ✅ | >>> | |
| UT_ARM_A2_Part_01 | 🛑 | >>> | |
| UT_ARM_A2_Part_02 | 🛑 | >>> | |
| UT_inductor_Part_01 | 🛑 | >>> | |
| UT_inductor_Part_02 | 🛑 | >>> | |
| UT_inductor_Part_03 | 🛑 | >>> | |
| UT_inductor_Part_04 | 🛑 | >>> | |
| 流水线 | PR-pipeline_pytorch | ✅ | >>> |


2月4日 修改标题为 “fix: npugraph_ex补充用户自定义backend和自定义pass缺失的接口”,原标题为“Provides npugraph_ex APIs for user-defined backends and passes”
2月4日 修改标题为 “fix: npugraph_ex补充用户自定义backend和自定义pass缺失的接口”,原标题为“Provides npugraph_ex APIs for user-defined backends and passes”
2月4日 修改了pull request 的描述
yushikang
2月4日 评论:
2月4日 评论:
/approve


2月4日 添加了label:lgtm
薛鹏
2月4日 评论:
2月4日 评论:
/approve


2月4日 添加了label:approved
ascend-robot
2月4日 评论:
2月4日 评论:
Review Guide
This Pull-Request Passes Review.
Committers who wrote a comment of /approve are: wasd1111222, medivh-x.
Reviewers who wrote a comment of /lgtm are: wasd1111222, medivh-x.


2月4日 合入了pull request
薛鹏
2月4日 评论:
2月4日 评论:
/approve


【合入来源】
【修改方案】
2.1 补充注册replacement接口
2.2 补充自定义pass流record接口
【资料变更】
已在新版本资料中补充接口说明,资料配套发布。
【接口变更】
def my_backend(gm: torch.fx.GraphModule, example_inputs): compiler = torch.npu.npugraph_ex.compile_fx() return aot_module_simplified(gm, example_inputs, fw_compiler=compiler)# record and wait should be used in pairs with torch.npu.npugraph_ex.scope.npu_stream_switch('1'): # ... record = torch.npu.npugraph_ex.ops.record() # ... torch.npu.npugraph_ex.ops.wait([record])【功能验证】
新增测试用例看护:
/test/dynamo/test_npugraph_ex.TestNpuGraphEx.test_compile_fx
/test/dynamo/test_npugraph_ex.TestNpuGraphEx.test_register_replacement
/test/dynamo/test_npugraph_ex.TestNpuGraphEx.test_record_and_wait
【CheckList】