已合并
fix: 修复 AutoFuse unit repeat 轴映射 #4551
fix: 修复 AutoFuse unit repeat 轴映射 #4551
已合并
ling-DT创建于 7 天前
ling-DT成员
7 天前

Pull Request

描述

修复 GE AutoFuse Fuse 阶段 unit-repeat 轴映射采用倒序贪心匹配导致同下标 unit 轴交换的问题。新增同下标优先的轴映射逻辑,补充轴映射诊断日志和 DSSM 007 回归测试。

变更类型

关联的Issue

无。

如何测试

  1. 编译 AutoFuse UT 和 GE AutoFuse 运行库:cmake --build build --target autofusion_ut -j8cmake --build build/ge-compiler --target aihac_autofusion -j8
  2. 运行 AutoFuse UT,相关轴映射用例和完整 AutoFuse UT 通过。
  3. 运行 python3 -m pre_commit run --files,所有 hooks 通过。
  4. INSTALL.md 流程覆盖 CANN 库并执行 tc_af_tf1_DSSM_0007,结果 Pass,主 plog [ERROR] 数量为 0。

核对清单

其他信息

本次修改仅提交 GE 源码和测试代码;本地 CANN 安装包中的运行库替换不属于 PR 文件。

likedislike
Pull Request已成功合入, 合并人@CANN-robot
(感谢 ling-DT 的贡献)
Lling-DT成员
7 天前 创建了 pull request,commit 02b9d665
atomgit-bot
atomgit-bot
7 天前 评论:

变更摘要

本 PR 修复 GE AutoFuse Fuse 阶段 unit-repeat 轴映射的问题:原 BuildUnitRepeatAxisIndex 采用倒序贪心匹配,在存在同下标 unit 轴时会导致同下标轴被错误交换。本次修改在 asc_graph_axis_mapping.cppBuildUnitRepeatAxisIndex 中新增同下标优先的预映射逻辑(先保留 node_repeats[index] == base_repeats[index] || node_repeats[index] == 1 || base_repeats[index] == 1 的同下标映射,剩余轴再走倒序贪心匹配),并在 AscBackendFusionDecider::UnifySubgraphAxisAscBackendFusionDecider::FuseAscGraphAxisMapping::CanLoopMergeAscGraphAxisMapping::CheckSubGraphHorizontalAxisMapping 中补充 [AxisDiag] 轴映射诊断日志,同时更新并新增 DSSM 007 相关回归测试用例。

主要改动

  • 同下标优先轴映射逻辑:在 BuildUnitRepeatAxisIndex 中新增 same_index_can_map / reserve_same_index / is_unmapped 辅助逻辑,先为满足同下标匹配条件的轴建立映射(node_to_base[index] = index),倒序贪心匹配时跳过已映射的轴,避免同下标 unit 轴被交换。
  • 轴映射诊断日志:在 AscBackendFusionDecider::UnifySubgraphAxisAscBackendFusionDecider::FuseCanLoopMergeCheckSubGraphHorizontalAxisMapping 中新增 [AxisDiag] 日志,输出节点名、原始轴信息、映射结果及子集关系(is_axis_subsetgraph_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}})。
likedislike
atomgit-bot
atomgit-bot
7 天前 评论:

代码审查

✅ 未发现问题

likedislike
CANN-robotCANN-robot成员
7 天前 添加了label:cann-cla/yes
CANN-robot
CANN-robot成员
7 天前 评论:

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 /approve or /lgtm
  • Commenting /approve implies 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. 👍

likedislike
此处折叠了50条消息 查看更多
CANN-robotCANN-robot成员
7 天前 添加了label:ci-pipeline-passed
张德鹏成员
7 天前 评论:

/approve

likedislike
CANN-robot
CANN-robot成员
7 天前 评论:

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

likedislike
CANN-robotCANN-robot成员
7 天前 添加了label:approved
CANN-robotCANN-robot成员
7 天前 合入了pull request