已合并
fix: adapt graph-autofusion for gcc15 and gcc16 #1859
fix: adapt graph-autofusion for gcc15 and gcc16 #1859
已合并
ling-DT创建于 8 天前
ling-DT成员
8 天前

Pull Request

描述

将 gcc15/gcc16 适配相关修改重新整理为单个提交并发起 PR,包含 workflow 的 gcc_version 透传、AutoFuse 测试/代码生成适配、以及 SuperKernel 兼容头文件补充。

变更类型

如何测试

  1. git cherry-pick 732f14b2 已验证可干净应用到 upstream/develop
  2. git push origin fix/gcc15-16-adapt-develop-pr -u 已完成,Git hooks 检查通过。

核对清单

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

变更摘要

本 PR 将 gcc15/gcc16 的适配改动整理为单个提交,核心目标是在不硬编码编译器版本的前提下让 graph-autofusion 的编译、单测/ST 与代码生成链路兼容新版 gcc/glibc。改动包括:CI 工作流与脚本新增 gcc_version 透传与 select_compilers() 编译器选择逻辑(替代原先固定的 gcc-14 切换);各 CMake 测试用例改为通过 cmake -E env 注入 LD_LIBRARY_PATH 并配合 BUILD_RPATH/-Wl,--disable-new-dtags 保证运行期动态库解析;新增 SuperKernel 兼容头文件 bits/floatn.h 禁用 float128 分支;修复若干头文件包含、include guard 与日志格式串问题,并重构 PGO 后端 E2E 测试以复用公共测试工具。

主要改动

  • CI 工作流与脚本的 gcc 版本透传:在 compile_action.ymlut_action.ymlgraph-autofusion_action.yml 中新增 gcc_version 输入参数并导出为 GCC_VERSION 环境变量;compile.shut.shrun_autofuse_test.sh 新增 select_compilers() 函数,依据 CC/CXX/GCC_VERSION 推导并导出编译器,替换原先的 update-alternatives --set gcc /usr/bin/gcc-14 硬编码,同时将各构建函数中写死的 CMAKE_C_COMPILER=gcc/CMAKE_CXX_COMPILER=g++ 改为使用所选编译器变量。

  • 测试运行期动态库路径适配autofuse/tests/st/backend_e2e/backend_e2e.cmakeautofuse/tests/st/codegen/e2e/e2e.cmakeautofuse/tests/ut/e2e/e2e.cmakeautofuse/tests/v35/st/backend_e2e_v2/backend_e2e.cmakeautofuse/tests/v35/st/codegen/e2e_v2/e2e.cmake 统一为测试目标设置 BUILD_RPATH、链接选项 -Wl,--disable-new-dtags,并通过 cmake -E env "LD_LIBRARY_PATH=..." 执行测试可执行文件,确保新版本链接器下能正确加载构建目录内的本地运行库。

  • PGO 后端 E2E 测试重构:新增公共头文件 pgo_common/pgo_test_utils.h,集中声明 PgoTensorArgsResLimitProfilingCallback 等结构及 PgoTilingSearch 外部接口,并提供 PgoTensorArgPackRunPgoTilingSearch/RunPgoTilingSearchWithPruning 辅助函数(后者负责设置/恢复 AUTOFUSE_DFX_FLAGS);pgo_add_abs_testpgo_sub_transpose_abs_test 两个用例改用它构造参数并按 std::filesystem::path(__FILE__) 定位 search.txt/config.txt,同时以 GTEST_SKIP() 跳过不稳定的 pruning 路径用例。

  • SuperKernel 兼容头文件补充:新增 super_kernel/kernel/ascendc_compat/bits/floatn.h,通过将 __HAVE_FLOAT128__HAVE_DISTINCT_FLOAT128 置 0 并 #include_next <bits/floatn-common.h>,规避新 gcc/glibc 下 x86 float128 分支使用 __float128/__mode__(__TC__) 与 AscendC 编译目标不兼容的问题。

  • gcc15/16 下的头文件与代码生成兼容性修复:修正 extra_info_generator.h 中拼写错误的 include guard(ATT_EXRTA_INFO_GENERATOR_H_ATT_EXTRA_INFO_GENERATOR_H_);在 atrace_types.heasy_graph/infra/status.h 中对 <stdbool.h> 增加 #ifndef __cplusplus 保护,移除 ascgen_log.h<cstdbool>,并为 large_bm.haligned_ptr.h 补充 <cstddef>/<cstdint>transpose_api_call.cpp 将日志格式串由 %d 修正为 %zu 并输出 permute 内容;test_codegen_tiling.cpp 通过宏 push_macro/pop_macro 保护 FALSE/TRUE/FAILED 后引入 transpose_api_call.h,并新增 TransposeApiCallGetTransposeTypeInvalid 用例及 load_transpose_store 非法 transpose 代码生成失败用例;att_generator_unittest.cpp 中期望 PGO 代码由 block_dim 累加改为取 Max

likedislike
atomgit-bot
atomgit-bot
8 天前 评论:

代码审查

✅ 未发现问题

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

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
.gitcode/** xuyafei, tanghaoran7, sjtulxh (3/2) tanghaoran7 (1/1)
repo-cann/graph-autofusion yangyongqiang0606, sjtulxh, xuyafei (3/2) yangyongqiang0606 (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
此处折叠了56条消息 查看更多
CANN-robotCANN-robot成员
8 天前 添加了label:ci-pipeline-passed
yangyongqiang
yangyongqiang成员
8 天前 评论:

/approve

likedislike
tanghaoran
tanghaoran成员
8 天前 评论:

/approve

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