Platform
a2a3 (Ascend 910B/C hardware)
Runtime Variant
tensormap_and_ringbuffer
Description
pip install -v . fails when building with CANN 8.5.1's device compiler (ccec). CANN 8.5.1 introduces a preprocessor macro #define BLK BLK_Type() in __clang_cce_vector_intrinsics.h:555, which collides with the local variable constexpr uint64_t BLK = 64 in tensor.h:300.
The macro expands the variable declaration into invalid code, causing:
src/a5/runtime/tensormap_and_ringbuffer/runtime/tensor.h:300:28: error: illegal initializer (only variables can be initialized)
CI passes because it uses CANN 8.5.0, which does not define the BLK macro.
Steps to Reproduce
- Install CANN 8.5.1 and ensure
ccec resolves to the 8.5.1 binary
- Clone simpler on
stable branch (commit d62341b)
- Run
CC=/usr/bin/gcc CXX=/usr/bin/g++ pip install -v .
- Build fails on all a5 aicore compilation units that include
tensor.h
Expected Behavior
Build completes successfully regardless of CANN 8.5.0 or 8.5.1.
Actual Behavior
All aicore compilation units fail with the same error:
FAILED: [code=1] common_aic.o
tensor.h:300:28: error: illegal initializer (only variables can be initialized)
constexpr uint64_t BLK = 64;
^
__clang_cce_vector_intrinsics.h:555:13: note: expanded from macro 'BLK'
#define BLK BLK_Type()
^
Affected targets: common_aic.o, common_aiv.o, aicore_executor_aic.o, aicore_executor_aiv.o
Git Commit ID
d62341b
CANN Version
8.5.1 (build 20251230_093648626)
Host Platform
Linux (aarch64)
Additional Context
The collision is between:
- CANN 8.5.1 header:
/path/to/cann-8.5.1/tools/bisheng_compiler/lib/clang/15.0.5/include/npu_arch_3101/__clang_cce_vector_intrinsics.h:555 defines #define BLK BLK_Type()
- simpler source:
src/a5/runtime/tensormap_and_ringbuffer/runtime/tensor.h:300 declares constexpr uint64_t BLK = 64
CANN 8.5.0 does not define this macro, which is why CI is unaffected.
Platform
a2a3 (Ascend 910B/C hardware)
Runtime Variant
tensormap_and_ringbuffer
Description
pip install -v .fails when building with CANN 8.5.1's device compiler (ccec). CANN 8.5.1 introduces a preprocessor macro#define BLK BLK_Type()in__clang_cce_vector_intrinsics.h:555, which collides with the local variableconstexpr uint64_t BLK = 64intensor.h:300.The macro expands the variable declaration into invalid code, causing:
CI passes because it uses CANN 8.5.0, which does not define the
BLKmacro.Steps to Reproduce
ccecresolves to the 8.5.1 binarystablebranch (commit d62341b)CC=/usr/bin/gcc CXX=/usr/bin/g++ pip install -v .tensor.hExpected Behavior
Build completes successfully regardless of CANN 8.5.0 or 8.5.1.
Actual Behavior
All aicore compilation units fail with the same error:
Affected targets:
common_aic.o,common_aiv.o,aicore_executor_aic.o,aicore_executor_aiv.oGit Commit ID
d62341b
CANN Version
8.5.1 (build 20251230_093648626)
Host Platform
Linux (aarch64)
Additional Context
The collision is between:
/path/to/cann-8.5.1/tools/bisheng_compiler/lib/clang/15.0.5/include/npu_arch_3101/__clang_cce_vector_intrinsics.h:555defines#define BLK BLK_Type()src/a5/runtime/tensormap_and_ringbuffer/runtime/tensor.h:300declaresconstexpr uint64_t BLK = 64CANN 8.5.0 does not define this macro, which is why CI is unaffected.