已关闭
[Bug-Report|缺陷反馈]: GCC 12.3.0下编译UT测试组件有编译器内部错误 #285
init__zhb__创建于  7月2日关闭于  7月3日
init__zhb__成员
7月2日 创建

感谢提出缺陷反馈的相关Issue,请按照下述模板以描述遇到的问题。
Thanks for sending an issue! Please fill in the following template to help quickly solve your problem.

Describe the current behavior / 问题描述 (Mandatory / 必填)

在编译Gemm/Tile层单元测试组件时(执行bash scripts/build.sh --tests catlass_unittest -DENABLE_COVERAGE=ON),编译阶段出现Segmentation fault报错:

[ 72%] Building CXX object tests/unittest/CMakeFiles/test_tile_copy_gm_to_l1_tla_stub_2201.dir/catlass/gemm/tile/test_tile_copy_gm_to_l1_tla.cpp.o
[ 72%] Building CXX object tests/unittest/CMakeFiles/test_tile_copy_l1_to_l0b_stub_3510.dir/catlass/gemm/tile/test_tile_copy_l1_to_l0b.cpp.o
[ 72%] Built target test_tile_copy_l0c_to_ub_stub_2201
In file included from /xxx/catlass/tests/unittest/stub/kernel_operator.h:35,
                 from  /xxx/catlass/tests/unittest/stub/kernel_operator_data_copy_ext.h:14,
                 from /xxx/catlass/tests/unittest/stub/ascendc_test_fixture.h:19,
                 from /xxx/catlass/tests/unittest/catlass/gemm/tile/atlasa2/test_copy_l1_to_l0b.cpp:13,
                 from /xxx/catlass/tests/unittest/catlass/gemm/tile/test_tile_copy_l1_to_l0b.cpp:12:
/xxx/catlass/tests/unittest/stub/kernel_operator_mm_intf.h: In instantiation of 'void Catlass::Gemm::Tile::CopyL1ToL0B<ArchTag, Catlass::Gemm::GemmType<float, Catlass::layout::zN, AscendC::TPosition::A1> >::operator()(const AscendC::LocalTensor<float>&, const AscendC::LocalTensor<float>&, const LayoutDst&, const LayoutSrc&) [with ArchTag = Catlass::Arch::AtlasA2; LayoutDst = Catlass::layout::nZ; LayoutSrc = Catlass::layout::zN]':
/xxx/catlass/tests/unittest/catlass/gemm/tile/atlasa2/test_copy_l1_to_l0b.cpp:381:16:   required from here
/xxx/catlass/tests/unittest/stub/kernel_operator_mm_intf.h:64:13: internal compiler error: Segmentation fault
   64 | inline void LoadData(const LocalTensor<T>& dst, const LocalTensor<T>& src, const LoadData3DParamsV2<T>& loadDataParams)
      |             ^~~~~~~~
0xffffa13a73ff __libc_start_call_main
        ../sysdeps/nptl/libc_start_call_main.h:58
0xffffa13a74d7 __libc_start_main_impl
        ../csu/libc-start.c:392
Please submit a full bug report, with preprocessed source (by using -freport-bug).
Please include the complete backtrace with any bug report.
See <file:///usr/share/doc/gcc-12/README.Bugs> for instructions.
gmake[3]: *** [tests/unittest/CMakeFiles/test_tile_copy_l1_to_l0b_stub_2201.dir/build.make:76: tests/unittest/CMakeFiles/test_tile_copy_l1_to_l0b_stub_2201.dir/catlass/gemm/tile/test_tile_copy_l1_to_l0b.cpp.o] Error 1
gmake[2]: *** [CMakeFiles/Makefile2:7823: tests/unittest/CMakeFiles/test_tile_copy_l1_to_l0b_stub_2201.dir/all] Error 2
gmake[2]: *** Waiting for unfinished jobs....

Environment / 环境信息 (Mandatory / 必填)

编译器版本为12.3:

$ gcc -v
Using built-in specs.
COLLECT_GCC=gcc
COLLECT_LTO_WRAPPER=/usr/lib/gcc/aarch64-linux-gnu/12/lto-wrapper
...
gcc version 12.3.0 (Ubuntu 12.3.0-1ubuntu1~22.04.3) 
$ g++ -v
Using built-in specs.
COLLECT_GCC=g++
COLLECT_LTO_WRAPPER=/usr/lib/gcc/aarch64-linux-gnu/12/lto-wrapper
...
gcc version 12.3.0 (Ubuntu 12.3.0-1ubuntu1~22.04.3) 

配套的gcovlcov版本为12.3.0和2.5.0(beta):

$ gcov -v
gcov (Ubuntu 12.3.0-1ubuntu1~22.04.3) 12.3.0
Copyright (C) 2022 Free Software Foundation, Inc.
This is free software; see the source for copying conditions.  There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.

$ lcov --version
lcov: LCOV version 2.5.0-beta

无已知的不兼容问题。

CANN包环境为8.5.0社区包

Steps to reproduce the issue / 重现步骤 (Mandatory / 必填)

如上所示,执行bash scripts/build.sh --tests catlass_unittest -DENABLE_COVERAGE=ON即可复现该问题。

Describe the expected behavior / 预期结果 (Mandatory / 必填)

无编译报错,或如果版本不支持需在文档中显性说明。

如上所示。

Special notes for this issue/备注 (Optional / 选填)

likedislike
Iinit__zhb__成员
7月2日 添加了label:bug-report
Iinit__zhb__成员
7月2日 修改标题为 “[Bug-Report|缺陷反馈]: GCC 12.3.0下编译UT测试组件”,原标题为“[Bug-Report|缺陷反馈]: ”
Iinit__zhb__成员
7月2日 将 init__zhb__ 设为负责人
Iinit__zhb__成员
7月2日 修改标题为 “[Bug-Report|缺陷反馈]: GCC 12.3.0下编译UT测试组件有Segmentation fault报错”,原标题为“[Bug-Report|缺陷反馈]: GCC 12.3.0下编译UT测试组件”
Iinit__zhb__成员
7月2日 修改了issue 的描述
Iinit__zhb__成员
7月2日 修改标题为 “[Bug-Report|缺陷反馈]: GCC 12.3.0下编译UT测试组件有编译器内部错误”,原标题为“[Bug-Report|缺陷反馈]: GCC 12.3.0下编译UT测试组件有Segmentation fault报错”
init__zhb__成员
7月3日 评论:

这是一个编译器内部问题 (Internal Compiler Error,ICE),在测试版本GCC 12.4以及GCC 12.3上, ARM64 在引用 NTTP + 深度模板展开时触发 ICE,涉及的实例化路径为:

CopyL1ToL0B<Arch::AtlasA2, GemmType<float, layout::zN, TPosition::A1>>::operator()
  └─ LoadData<Element, config>      // .ii:101504, config = {false, false}
       └─ template <typename T, const IsResetLoad3dConfig &defaultConfig = ...>  // .ii:93794
            └─ SEGFAULT at LoadData body declaration          // kernel_operator_mm_intf.h:64

我们在文档上已做相关依赖说明(详见[PR#]),约束GCC版本<=12.0, 并在GCC 12.0.1版本上进行测试无问题。

likedislike
Iinit__zhb__成员
7月3日 关联了pull request:更新Gemm/Tile UT依赖说明
Iinit__zhb__成员
7月3日 关闭了 issue
Iinit__zhb__成员
7月3日 issue状态由 进行中 改变为 已完成
CANN-robotCANN-robot成员
7月3日 添加了label:resolved
Iinit__zhb__成员
7月14日 关联了pull request:更新 README 中gcc版本约束