| 文件 | 最后提交记录 | 最后更新时间 |
|---|---|---|
style: 统一 Autofuse 代码格式 Co-authored-by: Ling-DT<lingxing@huawei.com> # message auto-generated for no-merge-commit merge: !921 merge style/clang-format-autofuse-20260611 into develop style: 统一 Autofuse 代码格式 Created-by: ling-DT Commit-by: Ling-DT Merged-by: cann-robot Description: # Pull Request ## 描述 基于 cann/graph-autofusion:develop 最新提交 46a23b0,使用仓库根目录 .clang-format 对 autofuse/ 目录内受版本管理的 C/C++/AscendC 源文件执行统一格式化。 本 PR 仅包含 autofuse/ 目录格式化变更;super_kernel/ 目录格式化变更按要求暂留本地,未提交到本 PR。 格式化工具:clang-format 18.1.8,参数:--style=file。 ## 变更类型 请选择本次引入的变更类型: <!-- [x] 表示选中 --> - [ ] 🐛 Bug 修复 - [ ] ✨ 新功能 - [x] 💄 代码风格更新(格式化,局部变量) - [ ] ♻️ 重构(既不修复错误也不增加功能的代码变动) - [ ] 📦 构建过程或辅助工具的变动 - [ ] 📝 文档内容更新 ## 关联的Issue 无。 ## 如何测试 描述测试此变更的步骤和前提条件: 1. /tmp/opencode/clang-format-18-venv/bin/clang-format -i --style=file <autofuse C/C++/AscendC files> 2. git diff --cached --check 3. git diff --name-only HEAD~1..HEAD | cut -d/ -f1 | sort | uniq -c 确认 PR 提交仅包含 autofuse/。 ## 核对清单 <!-- [x] 表示选中 --> - [x] 我的代码遵循了项目的代码风格 - [x] 我已对代码进行了自测 - [x] 我已更新了相关的文档 - [x] 我在标题中使用了合适的类型标签(如:feat:, fix:) - [x] 我已经详细阅读了贡献指南(CONTRIBUTING.md),并遵守了其中的所有规定,包括但不限于commit message的格式、无效commit的合并等 ## 其他信息 本 PR 为纯格式化变更,不涉及功能逻辑、接口、构建脚本或打包内容修改。 See merge request: cann/graph-autofusion!921 | 2 个月前 | |
【PR】: [fix] [autofuse] modify the header files with the same names as ge and metadef. Co-authored-by: xingzhixiong<xingzhixiong@huawei.com> # message auto-generated for no-merge-commit merge: !1300 merge develop_change_same_name_headers into develop 【PR】: [fix] [autofuse] modify the header files with the same names as ge and metadef. Created-by: xingzhixiong Commit-by: xingzhixiong Merged-by: cann-robot Description: # Pull Request ## 描述 修改gaf仓与ge仓以及metadef仓同名的头文件。 ## 变更类型 请选择本次引入的变更类型: <!-- [x] 表示选中 --> - [ ] 🐛 Bug 修复 - [ ] ✨ 新功能 - [ ] 💄 代码风格更新(格式化,局部变量) - [x] ♻️ 重构(既不修复错误也不增加功能的代码变动) - [ ] 📦 构建过程或辅助工具的变动 - [ ] 📝 文档内容更新 ## 关联的Issue <!-- 如果这个PR是为了解决特定的Issue,请在当前页面的右侧'关联Issue'部分添加相应Issue链接,并勾选'合并后关闭已关联的 Issue'选项。 --> ## 如何测试 描述测试此变更的步骤和前提条件: 1. ci流水线pass 2. RDV pass ## 核对清单 <!-- [x] 表示选中 --> - [x] 我的代码遵循了项目的代码风格 - [x] 我已对代码进行了自测 - [x] 我已更新了相关的文档 - [x] 我在标题中使用了合适的类型标签(如: feat:, fix:) - [x] 我已经详细阅读了贡献指南(CONTRIBUTING.md),并遵守了其中的所有规定,包括但不限于commit message的格式、无效commit的合并等 ## 其他信息 在此添加任何其他关于本次 PR 的说明。 See merge request: cann/graph-autofusion!1300 | 1 个月前 | |
style: 统一 Autofuse 代码格式 Co-authored-by: Ling-DT<lingxing@huawei.com> # message auto-generated for no-merge-commit merge: !921 merge style/clang-format-autofuse-20260611 into develop style: 统一 Autofuse 代码格式 Created-by: ling-DT Commit-by: Ling-DT Merged-by: cann-robot Description: # Pull Request ## 描述 基于 cann/graph-autofusion:develop 最新提交 46a23b0,使用仓库根目录 .clang-format 对 autofuse/ 目录内受版本管理的 C/C++/AscendC 源文件执行统一格式化。 本 PR 仅包含 autofuse/ 目录格式化变更;super_kernel/ 目录格式化变更按要求暂留本地,未提交到本 PR。 格式化工具:clang-format 18.1.8,参数:--style=file。 ## 变更类型 请选择本次引入的变更类型: <!-- [x] 表示选中 --> - [ ] 🐛 Bug 修复 - [ ] ✨ 新功能 - [x] 💄 代码风格更新(格式化,局部变量) - [ ] ♻️ 重构(既不修复错误也不增加功能的代码变动) - [ ] 📦 构建过程或辅助工具的变动 - [ ] 📝 文档内容更新 ## 关联的Issue 无。 ## 如何测试 描述测试此变更的步骤和前提条件: 1. /tmp/opencode/clang-format-18-venv/bin/clang-format -i --style=file <autofuse C/C++/AscendC files> 2. git diff --cached --check 3. git diff --name-only HEAD~1..HEAD | cut -d/ -f1 | sort | uniq -c 确认 PR 提交仅包含 autofuse/。 ## 核对清单 <!-- [x] 表示选中 --> - [x] 我的代码遵循了项目的代码风格 - [x] 我已对代码进行了自测 - [x] 我已更新了相关的文档 - [x] 我在标题中使用了合适的类型标签(如:feat:, fix:) - [x] 我已经详细阅读了贡献指南(CONTRIBUTING.md),并遵守了其中的所有规定,包括但不限于commit message的格式、无效commit的合并等 ## 其他信息 本 PR 为纯格式化变更,不涉及功能逻辑、接口、构建脚本或打包内容修改。 See merge request: cann/graph-autofusion!921 | 2 个月前 | |
style: 统一 Autofuse 代码格式 Co-authored-by: Ling-DT<lingxing@huawei.com> # message auto-generated for no-merge-commit merge: !921 merge style/clang-format-autofuse-20260611 into develop style: 统一 Autofuse 代码格式 Created-by: ling-DT Commit-by: Ling-DT Merged-by: cann-robot Description: # Pull Request ## 描述 基于 cann/graph-autofusion:develop 最新提交 46a23b0,使用仓库根目录 .clang-format 对 autofuse/ 目录内受版本管理的 C/C++/AscendC 源文件执行统一格式化。 本 PR 仅包含 autofuse/ 目录格式化变更;super_kernel/ 目录格式化变更按要求暂留本地,未提交到本 PR。 格式化工具:clang-format 18.1.8,参数:--style=file。 ## 变更类型 请选择本次引入的变更类型: <!-- [x] 表示选中 --> - [ ] 🐛 Bug 修复 - [ ] ✨ 新功能 - [x] 💄 代码风格更新(格式化,局部变量) - [ ] ♻️ 重构(既不修复错误也不增加功能的代码变动) - [ ] 📦 构建过程或辅助工具的变动 - [ ] 📝 文档内容更新 ## 关联的Issue 无。 ## 如何测试 描述测试此变更的步骤和前提条件: 1. /tmp/opencode/clang-format-18-venv/bin/clang-format -i --style=file <autofuse C/C++/AscendC files> 2. git diff --cached --check 3. git diff --name-only HEAD~1..HEAD | cut -d/ -f1 | sort | uniq -c 确认 PR 提交仅包含 autofuse/。 ## 核对清单 <!-- [x] 表示选中 --> - [x] 我的代码遵循了项目的代码风格 - [x] 我已对代码进行了自测 - [x] 我已更新了相关的文档 - [x] 我在标题中使用了合适的类型标签(如:feat:, fix:) - [x] 我已经详细阅读了贡献指南(CONTRIBUTING.md),并遵守了其中的所有规定,包括但不限于commit message的格式、无效commit的合并等 ## 其他信息 本 PR 为纯格式化变更,不涉及功能逻辑、接口、构建脚本或打包内容修改。 See merge request: cann/graph-autofusion!921 | 2 个月前 | |
feat: support IndexExpr and Arange autofusion Co-authored-by: Jett_Woo<wujinteng1@huawei.com> # message auto-generated for no-merge-commit merge: !1961 merge index-expr-device-validation-pr into develop feat: support IndexExpr and Arange autofusion Created-by: Jett_Woo Commit-by: Jett_Woo Merged-by: cann-robot Description: # Pull Request ## 描述 支持 IndexExpr 和 Arange 自动融合,补充 ASCIR/Python 接口、调度与 codegen 支持,并完善设备验证、UT 和 Backend E2E 用例。Arange 仅保留连续物理布局,数学上的非单位 step 仍受支持。 ## 变更类型 请选择本次引入的变更类型: <!-- [x] 表示选中 --> - [x] Bug 修复 - [x] 新功能 - [ ] 代码风格更新(格式化,局部变量) - [ ] 重构(既不修复错误也不增加功能的代码变动) - [x] 构建过程或辅助工具的变动 - [ ] 文档内容更新 ## 关联的Issue 无 ## 如何测试 描述测试此变更的步骤和前提条件: 1. 已完成 IndexExpr/Arange 相关 C++ 定向 UT,12 passed。 2. 已完成 device-validation Python 定向测试,259 passed;Ascend950 fused 精度验证有效 133 个 cell,其中 131 个通过,reduce_mask 的两个既有通用 Reduce codegen 问题仍按实测结果保留。 3. 已完成相关构建目标编译验证,构建并行度限制为 -j 8。 ## 核对清单 <!-- [x] 表示选中 --> - [x] 我的代码遵循了项目的代码风格 - [x] 我已对代码进行了自测 - [ ] 我已更新了相关的文档 - [x] 我在标题中使用了合适的类型标签(如:feat:, fix:) - [x] 我已经详细阅读了贡献指南(CONTRIBUTING.md),并遵守了其中的所有规定,包括但不限于commit message的格式、无效commit的合并等 ## 其他信息 本 PR 基于远端 develop 分支新建。未包含 docs/、tool/、temp/、验证日志或生成产物。 See merge request: cann/graph-autofusion!1961 | 4 天前 | |
fix: ensure deterministic codegen and reliable PGO fallback Co-authored-by: zhang_shengjie<804425610@qq.com> # message auto-generated for no-merge-commit merge: !1662 merge fix/codegen-determinism-p0 into develop fix: ensure deterministic codegen and reliable PGO fallback Created-by: zhang_shengjie Commit-by: zhang_shengjie Merged-by: cann-robot Description: ## 描述 ### 一、主要解决的问题 #### 1.1 跨进程 codegen 产物不确定 相同静态图在独立进程中可能生成不同的源码和缓存 hash,导致 Inductor PGO 无法稳定复用 codegen 结果。根因包括: - VF 并行节点和边界锚点排序依赖节点 ID、插入顺序。 - VF 拓扑排序只考虑数据边,未纳入控制依赖。 - 临时 Buffer 分配顺序受裸指针地址影响。 #### 1.2 PGO skip 场景未可靠回退 - fallback 程序返回 0,调用方将 no-op 误判为调优成功。 - PGO 搜索结果文件缺失时直接抛出 OSError,中断正常回退流程。 ### 二、问题解决前后对比 | 场景 | 解决前 | 解决后 | 效果 | |------|--------|--------|------| | VF 并行节点排序 | 使用节点 ID,同级节点顺序受插入顺序影响 | 使用节点名作为稳定主键,入口校验节点名唯一 | 跨进程节点顺序一致 | | VF 依赖建模 | 仅统计数据边 | 数据边、控制边共同参与拓扑排序,并对相同后继去重 | 保留执行顺序约束 | | VF 边界锚点 | 沿节点和 peer 遍历顺序收集 | 按节点名、anchor index 排序 | 输入输出 tensor 编号稳定 | | 临时 Buffer 分配 | 按指针地址或不完整的生命期键排序 | 按生命期、allocation_order、group_id 排序 | Buffer ID 和源码稳定 | | PGO skip 返回码 | 返回 0,被误判为成功 | 返回 1 | 正确回退原始解 | | 搜索文件缺失 | 抛出 OSError | 返回失败三元组 | 编译流程不中断 | | optimize_ut 编译 | 缺少 AscGraphBuilder 声明 | 显式包含 asc_graph_builder.h | 阻塞编译恢复 | | NBNC 告警 | MergeTensorByGroupId 为 51 | 删除一次性类型别名,等价表达后为 50 | 满足 codecheck 门限 | mermaid flowchart LR subgraph Before[解决前] B1[VF 顺序受 ID 和插入顺序影响] --> B2[边界顺序不稳定] B2 -->|影响| B3[Buffer ID 受指针地址影响] B3 -->|导致| B4[源码和缓存 hash 波动] B5[PGO skip 返回 0] --> B6[误判调优成功] B7[测试缺少直接 include] --> B8[optimize_ut 编译失败] end subgraph After[解决后] A1[节点名和控制依赖稳定拓扑] --> A2[稳定边界锚点] A2 -->|保证| A3[稳定生命期分配] A3 -->|实现| A4[源码和缓存 hash 一致] A5[PGO skip 返回 1] --> A6[回退原始解] A7[显式 include] --> A8[optimize_ut 编译通过] end B4 -.修复.-> A4 B6 -.修复.-> A6 B8 -.修复.-> A8 ### 三、修改方案 #### 3.1 VF 排序稳定化 - Partition 入口校验节点名唯一,避免稳定排序键产生歧义。 - 并行节点优先按节点名排序;拓扑依赖从 GetOutDataNodes 改为 GetOutAllNodes。 - VF 输入输出边界按节点名和 anchor index 排序。 #### 3.2 Buffer 分配稳定化 - TensorInfo、TensorGroup 增加 allocation_order,并按图遍历顺序赋值。 - TensorGroupLifeLess 以 merged_life_start 为主键,以 allocation_order、group_id 为稳定次键。 - AllocTmpBuff 将指针 map 内容收集到 vector 后稳定排序,再分配 Buffer。 #### 3.3 PGO 回退可靠化 - PGO fallback 生成代码返回值从 0 改为 1,使 pgo_program_exec 进入失败回退路径。 - pgo_get_top_result 捕获 OSError,结果文件缺失时返回 (None, None, None)。 #### 3.4 Review 阻塞项修复 - test_vf_partition.cpp 显式包含 asc_graph_builder.h,消除传递 include 依赖。 - MergeTensorByGroupId 直接使用 int64_t map key,并用 const auto 保存 group_id;不改变分组逻辑,NBNC 从 51 降至 50。 ## 变更类型 - [x] Bug 修复 - [ ] 新功能 - [ ] 代码风格更新 - [ ] 重构 - [ ] 构建过程或辅助工具的变动 - [ ] 文档内容更新 ## 关联的 Issue 无。 ## 如何测试 ### 一、本地验证 | 验证项 | 命令或范围 | 结果 | |--------|------------|------| | optimize UT 构建 | cmake --build build --target optimize_ut -j 8 | 通过,生成最新 optimize_ut | | 定向回归 | Buffer 分配 1 项、VF 分区 4 项 | 5/5 通过 | | Python UT | test_compile_adapter.py | 41 项通过 | | Codegen UT | PgoTilingKeyCountOverflowShouldFallbackTfAndPgoRunner | 1 项通过 | | 格式与补丁 | git diff --check、git clang-format --diff | 通过 | | 提交门禁 | pre-commit | clang-format、codespell、OAT 等全部通过 | | NBNC | MergeTensorByGroupId | 50 | 定向回归覆盖: - 临时 Buffer 按生命期稳定分配。 - VF 控制依赖保序。 - 重复节点名在改图前被拒绝。 - VF 输出和 tensor 顺序不受并行节点插入顺序影响。 ### 二、远端 compile - 流水线 #1004745,HEAD 1cac68b542f8:success。 - static-check、compile、llt 均完成;X86、ARM、Ubuntu 24 构建及 API_Check、PreSmoke 通过。 - ci-pipeline-passed label 已回写,结果对应最新提交。 ### 三、系统与上板验证 - Ascend 950 环境下,SR001、SR007、SR012 多进程重复生成的 cache hash 均唯一。 - NC018 静态 shape 场景中,baseline Top1 与 PGO Top3 的 prepare、profile 均通过,cache_reused=True。 - 验证时成套加载同一次构建的 Graph-autofusion 动态库,避免新旧组件混用。 ## 核对清单 - [x] 代码遵循项目代码风格 - [x] 已完成针对性自测 - [x] 本变更不涉及公开文档更新 - [x] PR 标题使用合适的类型标签 - [x] 已阅读并遵守 CONTRIBUTING.md ## 其他信息 ### 兼容性与影响 - 不修改公开 API/ABI、Python/C++ 绑定、构建打包或 runtime 接口。 - 图优化只固定同级节点和边界锚点顺序,并补全既有控制依赖,不引入新 pass。 - Buffer 变更只消除非确定性遍历顺序;PGO 返回码调整是既有失败语义修正。 - 未新增高频日志、额外 runtime 调用或显著复杂度,性能影响可忽略。 ### 提交记录 | Commit | 描述 | 修改文件数 | |--------|------|-----------| | b71a34a0 | ensure deterministic codegen across processes | 7 | | 58571b25 | preserve control dependencies in VF ordering | 2 | | 269b71d9 | fallback when TF PGO search is skipped | 5 | | 1cac68b5 | address review build and codecheck issues | 2 | ### 修改文件清单 | 文件路径 | 说明 | |----------|------| | autofuse/v35/optimize/partition/vector_func_partitioner.cpp | VF 拓扑与边界锚点稳定排序,纳入控制依赖 | | autofuse/v35/optimize/partition/vector_func_partitioner.h | 声明节点名唯一性校验 | | autofuse/optimize/buffer_allocate/buf_que_allocator.cpp | 记录临时 Buffer allocation_order | | autofuse/optimize/buffer_allocate/mem_reuse_manager.cpp | 稳定分配顺序并修复 NBNC 告警 | | autofuse/optimize/buffer_allocate/mem_reuse_manager.h | 声明单组临时 Buffer 分配函数 | | autofuse/optimize/buffer_allocate/tensor_mem_defs.h | 增加 allocation_order | | autofuse/codegen/codegen_tiling_pgo_runtime.cpp | 修正 PGO fallback 返回码 | | autofuse/compiler/python/compile_adapter.py | 处理 PGO 搜索文件缺失 | | autofuse/tests/v35/ut/optimize/test_vf_partition.cpp | VF 稳定性、控制依赖和重复名 UT;补直接 include | | autofuse/tests/ut/optimize/test_buf_que_allocator.cpp | Buffer 稳定分配 UT | | autofuse/tests/ut/python/test_compile_adapter.py | 搜索文件缺失 UT | | autofuse/tests/ut/codegen/test_codegen_tiling.cpp | 适配 PGO fallback 返回码 | | autofuse/tests/st/backend_e2e/pgo_add_abs_inductor_test/pgo_add_abs_inductor_backend_generate.cpp | 适配 fallback 生成代码 | See merge request: cann/graph-autofusion!1662 | 30 天前 |
| 文件 | 最后提交记录 | 最后更新时间 |
|---|---|---|
| 2 个月前 | ||
| 1 个月前 | ||
| 2 个月前 | ||
| 2 个月前 | ||
| 4 天前 | ||
| 30 天前 |