Pull Request已成功合入, 合并人@CANN-robot
(感谢 ling-DT 的贡献)变更摘要
本 PR 修复 GE AutoFuse Fuse 阶段 unit-repeat 轴映射的问题:原 BuildUnitRepeatAxisIndex 采用倒序贪心匹配,在存在同下标 unit 轴时会导致同下标轴被错误交换。本次修改在 asc_graph_axis_mapping.cpp 的 BuildUnitRepeatAxisIndex 中新增同下标优先的预映射逻辑(先保留 node_repeats[index] == base_repeats[index] || node_repeats[index] == 1 || base_repeats[index] == 1 的同下标映射,剩余轴再走倒序贪心匹配),并在 AscBackendFusionDecider::UnifySubgraphAxis、AscBackendFusionDecider::Fuse、AscGraphAxisMapping::CanLoopMerge、AscGraphAxisMapping::CheckSubGraphHorizontalAxisMapping 中补充 [AxisDiag] 轴映射诊断日志,同时更新并新增 DSSM 007 相关回归测试用例。
主要改动
- 同下标优先轴映射逻辑:在
BuildUnitRepeatAxisIndex中新增same_index_can_map/reserve_same_index/is_unmapped辅助逻辑,先为满足同下标匹配条件的轴建立映射(node_to_base[index] = index),倒序贪心匹配时跳过已映射的轴,避免同下标 unit 轴被交换。 - 轴映射诊断日志:在
AscBackendFusionDecider::UnifySubgraphAxis、AscBackendFusionDecider::Fuse、CanLoopMerge、CheckSubGraphHorizontalAxisMapping中新增[AxisDiag]日志,输出节点名、原始轴信息、映射结果及子集关系(is_axis_subset、graph_axis_fallback等),便于定位轴映射问题。 - 回归测试更新与新增:
asc_graph_axis_mapping_unittest2.cpp中原AscGraphAxisMapping_CanAxisMapAllowUnitRepeat_Rank1用例期望由{{0, 2}, {1, 4}}更新为{{0, 2}, {1, 3}},并新增AscGraphAxisMapping_CanAxisMapAllowUnitRepeat_PreserveSameIndex用例验证同下标映射优先(temp_node2_map == {{0, 0}, {1, 1}, {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.
You can self-configure the PR merge rules for this repository. For more details, please refer to Here.
For more, you also can visit HICANN.
PR Approval Progress
✅ Congratulations! All modules have met the lgtm and approve requirements.
Module Approval Details
| module | lgtm status | approve status |
|---|---|---|
| repo-cann/ge | ✅ 张德鹏, wangxiaotian995, xchu42 (3/2) | ✅ 张德鹏 (1/1) |
💡 Tip:
- Committer can comment
/approveor/lgtm- Commenting
/approveimplies both code review (lgtm) and intent to merge (approve)
CLA Signature Pass
ling-DT, thanks for your pull request. All authors of the commits have signed the CLA. 👍


The following users do not have permission to comment /lgtm or /approve on any module in this PR:
xuyafei


Pull Request
描述
修复 GE AutoFuse Fuse 阶段 unit-repeat 轴映射采用倒序贪心匹配导致同下标 unit 轴交换的问题。新增同下标优先的轴映射逻辑,补充轴映射诊断日志和 DSSM 007 回归测试。
变更类型
关联的Issue
无。
如何测试
cmake --build build --target autofusion_ut -j8、cmake --build build/ge-compiler --target aihac_autofusion -j8。python3 -m pre_commit run --files,所有 hooks 通过。INSTALL.md流程覆盖 CANN 库并执行tc_af_tf1_DSSM_0007,结果Pass,主 plog[ERROR]数量为 0。核对清单
其他信息
本次修改仅提交 GE 源码和测试代码;本地 CANN 安装包中的运行库替换不属于 PR 文件。