已合并
fix(mfusion): preserve output container kind in contract restore #38662
shaoshengqi创建于 6月16日
fix(mfusion): preserve output container kind in contract restore #38662
已合并
Pull Request已成功合入, 合并人@ascend-robot
(感谢 shaoshengqi 的贡献)6月16日 创建了 pull request,commit 2423fae4
ascend-robot
6月16日 评论:
6月16日 评论:
当前仓库存在以下 保护分支 :
| Protected Branch | Version | Release |
|---|---|---|
| master | ||
| v2.7.1 | ||
| v2.12.0 | ||
| v2.11.0 | ||
| v2.10.0 | ||
| v2.9.0 | ||
| v2.12.0-26.1.0 | ||
| v2.10.0-26.1.0 | ||
| v2.11.0-26.1.0 | ||
| v2.9.0-26.1.0 | ||
| v2.7.1-26.1.0 | ||
| ci-test | ||
| sync-pr28113--to-v2.9.0 |
评论 /sync <branch1> <branch2> ... 可将当前 PR 修改同步到其它分支(创建同步 PR):
a) 如果当前 PR 是 Open 状态,同步操作将延迟到 PR 被合并时执行
b) 如果当前 PR 已经 Merged,将立即执行同步操作
注意:
- /sync 命令可以指定同步到多个分支,仅最后一个 /sync 命令生效
- 如果创建的同步 PR 不正确,可通过向同步 PR 的源分支提交轻量级 PR 完善,或使用 /close 命令关闭


Sshaoshengqi
6月16日 修改标题为 “fix(mfusion): preserve output container kind in contract restore”,原标题为“style(test): remove unnecessary mypy type:ignore suppressions”
6月16日 修改标题为 “fix(mfusion): preserve output container kind in contract restore”,原标题为“style(test): remove unnecessary mypy type:ignore suppressions”
6月16日 修改了pull request 的描述
shaoshengqi
6月16日 评论:
6月16日 评论:
compile


AtlasAccount
6月16日 评论:
6月16日 评论:
/torch_npu/_inductor/mfusion/graph_fusion.py


6月16日 添加了label:ascend-cla/yes
ascend-robot
6月16日 评论:
6月16日 评论:
ascend-robot
6月16日 评论:
6月16日 评论:
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 | ✅ zichun_ye, hbhu_bin (2/2) | ✅ zichun_ye (1/1) |
| torch_npu/_inductor | ✅ zichun_ye, hbhu_bin (2/2) | ✅ zichun_ye (1/1) |
💡 Tip:
- Committer can comment
/approveor/lgtm- Commenting
/approveimplies both code review (lgtm) and intent to merge (approve)
CLA Signature Pass
propathee, thanks for your pull request. All authors of the commits have signed the CLA. 👍


shaoshengqi
6月16日 评论:
6月16日 评论:
compile


6月16日 添加了label:ci-pipeline-running
AtlasAccount
6月16日 评论:
6月16日 评论:
/torch_npu/_inductor/mfusion/graph_fusion.py


ascend-robot
6月16日 评论:
6月16日 评论:
Ascend docs pipeline is running...


6月16日 添加了label:docs-ci-pipeline-running
ascend-robot
6月16日 评论:
6月16日 评论:
✅ 跳过 docs ci 检查,没有需要检查的文档文件


6月16日 删除了label:docs-ci-pipeline-running
6月16日 添加了label:docs-ci-pipeline-success
6月16日 删除了label:ci-pipeline-running
6月16日 添加了label:ci-pipeline-passed
ascend-robot
6月16日 评论:
6月16日 评论:
流水线 PR-pipeline_pytorch#32832 已完成
| 阶段 | 任务名 | 状态 | 详情 |
|---|---|---|---|
| 编译构建 | Build_X86 | ✅ | >>> |
| Build_ARM | ✅ | >>> | |
| Build_LibTorch_x86 | ✅ | >>> | |
| Build_LibTorch_ARM | ✅ | >>> | |
| Build_X86_torchair | 🛑 | >>> | |
| Build_ARM_torchair | 🛑 | >>> | |
| patch_test | 🛑 | >>> | |
| 恶意代码检查 | Antipoison | ✅ | >>> |
| 编码安全与规范检查 | CodeCheck | ✅ | >>> |
| check_error | ✅ | >>> | |
| CodeCheck_lintrunner | ✅ | >>> | |
| 开源片段检查 | SCA | ✅ | >>> |
| 开发者测试 | UT_X86_Part_01 | ✅ | >>> |
| UT_X86_Part_02 | ✅ | >>> | |
| UT_ARM_A3_Part_01 | ✅ | >>> | |
| UT_ARM_A3_Part_02 | ✅ | >>> | |
| UT_ARM_A2_Part_01 | ✅ | >>> | |
| UT_ARM_A2_Part_02 | ✅ | >>> | |
| UT_ARM_A2_Part_03 | ✅ | >>> | |
| UT_inductor_Part_01 | ✅ | >>> | |
| UT_inductor_Part_02 | ✅ | >>> | |
| UT_inductor_Part_03 | ✅ | >>> | |
| UT_inductor_Part_04 | ✅ | >>> | |
| UT_DIST_ARM_Part_01 | 🛑 | >>> | |
| UT_DIST_ARM_Part_02 | 🛑 | >>> | |
| UT_DIST_ARM_Part_03 | 🛑 | >>> | |
| UT_DIST_ARM_Part_04 | 🛑 | >>> | |
| UT_ARM_A2_Select_Part_01 | ✅ | >>> | |
| UT_ARM_A2_Select_Part_02 | ✅ | >>> | |
| 流水线 | PR-pipeline_pytorch | ✅ | >>> |


zichun_ye
6月17日 评论:
6月17日 评论:
/approve


6月17日 添加了label:approved
6月17日 添加了label:lgtm
6月17日 合入了pull request
ascend-robot
6月17日 评论:
6月17日 评论:
流水线 pytorch_gitcode_PR_multiVersion#10864 [ commitID:5a5f0204 ] 运行失败


【合入来源】
https://gitcode.com/Ascend/pytorch/issues/1962
【修改方案】
torch_npu/_inductor/mfusion/graph_fusion.py:修复_restore_output_contract在恢复 output contract 时始终将输出容器类型强制转换为 tuple 的问题。新增_output_container_kind()函数检测原始输出容器类型(tuple/list/single),_snapshot_output_contract记录该信息,_restore_output_contract按原始类型恢复。test/_inductor/test_mfusion_graph_fusion.py:新增test_restore_output_contract_preserves_single_output和test_restore_output_contract_preserves_list_output两个单测用例,覆盖单输出和列表输出的容器类型保持场景。同时清理了 ImportError fallback 中无用的# type: ignore[misc, assignment]注释。【资料变更】
不涉及
【接口变更】
不涉及
【功能验证】
运行
test/_inductor/test_mfusion_graph_fusion.py中的TestMfusionOutputContract全部用例:cd test python test_mfusion_graph_fusion.py -v -k TestMfusionOutputContract新增 2 个 UT 覆盖单输出和 list 输出的容器类型保持,已有用例覆盖 tuple 输出 + None 槽位 + stride 元数据保持。
【CheckList】