Pull Request已成功合入, 合并人@CANN-robot
(感谢 ling-DT 的贡献)变更摘要
本 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.yml、ut_action.yml、graph-autofusion_action.yml中新增gcc_version输入参数并导出为GCC_VERSION环境变量;compile.sh、ut.sh及run_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.cmake、autofuse/tests/st/codegen/e2e/e2e.cmake、autofuse/tests/ut/e2e/e2e.cmake、autofuse/tests/v35/st/backend_e2e_v2/backend_e2e.cmake、autofuse/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,集中声明PgoTensorArgs、ResLimit、ProfilingCallback等结构及PgoTilingSearch外部接口,并提供PgoTensorArgPack与RunPgoTilingSearch/RunPgoTilingSearchWithPruning辅助函数(后者负责设置/恢复AUTOFUSE_DFX_FLAGS);pgo_add_abs_test与pgo_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.h、easy_graph/infra/status.h中对<stdbool.h>增加#ifndef __cplusplus保护,移除ascgen_log.h的<cstdbool>,并为large_bm.h、aligned_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。


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
/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. 👍


/approve


/approve


Pull Request
描述
将 gcc15/gcc16 适配相关修改重新整理为单个提交并发起 PR,包含 workflow 的 gcc_version 透传、AutoFuse 测试/代码生成适配、以及 SuperKernel 兼容头文件补充。
变更类型
如何测试
git cherry-pick 732f14b2已验证可干净应用到upstream/develop。git push origin fix/gcc15-16-adapt-develop-pr -u已完成,Git hooks 检查通过。核对清单