Pull Request已成功合入, 合并人@CANN-robot
(感谢 xiebangrui2025 的贡献)变更摘要
本 PR 主要修复 Ascend950 场景下 IndirectLoad SIMT 的 kernel API 声明顺序问题,并支持非重叠 zero-stride 且带物理 gap 的 Broadcast 布局。ClassifyIndirectLoadLayout 新增 allow_non_overlapping_zero_stride 参数,使 SIMT 场景下此类布局由 kUnsupported 归类为 kStrided;同时调整 IndirectLoadAscIrCodegenImplV2::LoadApiHeaderFiles 的头文件返回顺序并补充 datacopy_reg_base.h。此外新增与给定 ASCGraph 严格等价的 C++ E2E ST,用同一宏注册 codegen 与 E2E 执行集合,覆盖 GraphHint reduce 用例。
主要改动
-
扩展
ClassifyIndirectLoadLayout布局分类: 新增默认值为false的allow_non_overlapping_zero_stride参数;当启用且布局同时存在 zero-stride 与物理 gap 时,将布局归类为IndirectLoadLayoutKind::kStrided并设置layout.physical_repeats,使该 Broadcast 布局不再被判定为kUnsupported。 -
SIMT 场景接入新布局支持:
AnalyzeInputPath中当template_id == kIndirectLoadSimt且存在 broadcast 时传入该参数;ValidateSimtTemplateRegion将编译期Scalar视为由 SIMT 求值器生成为本地常量而不再要求显式绑定,仅ScalarData仍需 context/GM 绑定。 -
修复 kernel API 声明顺序:
LoadApiHeaderFiles返回的头文件序列调整为以datacopy_reg_base.h开头,匹配 kernel 声明对基础头文件的依赖顺序。 -
新增 GraphHint reduce E2E ST:
indirect_load_store_backend_generator.cpp新增IL_GRAPH_HINT_REDUCE分支,按原 ASCIR 图顺序构建Data/Load/Broadcast/Scalar/Cast/Eq/Where/IndirectLoad/Sum/Store节点并生成 SIMT kernel;新增test_e2e_indirect_load_graph_hint_reduce_kernel.cpp运行生成 kernel 并与参考结果比对。 -
补充单元测试: 新增 kernel API 头文件声明顺序 UT,以及 SIMT 下 mixed zero-stride + physical gap 布局分类为
kStrided的 UT。


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/graph-autofusion | ✅ 张德鹏, liyuewei, yangyongqiang0606 (3/2) | ✅ 张德鹏 (1/1) |
💡 Tip:
- Committer can comment
/approveor/lgtm- Commenting
/approveimplies both code review (lgtm) and intent to merge (approve)
CLA Signature Pass
xiebangrui2025, thanks for your pull request. All authors of the commits have signed the CLA. 👍


描述
完善 IndirectLoad 的 SIMD/SIMT/SK 调度与 regbase codegen,实现 SIMD/SIMT 地址计算和调用路径整理,修正 strided 参数生成中的类型转换问题,并修复 SIMD 场景下对公共 SIMT helper 的误判。
同步扩展 IndirectLoad 的 codegen/E2E 回归覆盖,涵盖广播、非连续布局、索引预处理、后融合 Reduce、embedding、LayerNorm、分叉拓扑及多种 SIMD/SIMT 组合;同时更新线上测试脚本,使线上集合与本地构建入口保持一致。
变更类型
关联的 Issue
无。
如何测试
aihac_codegen、test_main及相关 v35 IndirectLoad codegen/E2E target,统一使用-j 20。uint32_t输入类型回归用例。indirect_load_rank4_axis1_full_prefix_bessel_k0_sum_simd_codegen_v2通过,相关 70 个 codegen target 中 69 个通过。indirect_load_rank4_axis1_full_prefix_bessel_k0_sum_simd_e2e_v2:生成代码编译和模拟器执行通过。当前剩余的
indirect_load_user_add_gather_codegen_v2失败来自双 IndirectLoad 图尚未被调度器支持(ValidateSingleIndirectLoadNode明确报错),与本次 SIMD/SIMT codegen 修复无关。核对清单