已关闭
[Bug-Report|缺陷反馈]: 通过 build.sh 命令编译和执行 ophost 单侧时报 add_library cannot create ALIAS target "tikicpulib::bs9sx2aa" 错误 #4487
Hirozy创建于  8月21日关闭于  8月25日
Hirozy
8月21日 创建

Thanks for sending an issue! Please fill in the following template to help quickly solve your problem.

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

编译 grouped_matmul_swiglu_quant_v2 算子的 ophost 单侧测试用例时失败,CMake 提示add_library cannot create ALIAS target "tikicpulib::bs9sx2aa" because another target with the same name already exists.

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

CANN 环境容器: swr.cn-south-1.myhuaweicloud.com/ascendhub/cann:8.5.2-910b-ubuntu22.04-py3.11
CANN版本:8.5.2
NPU 驱动:25.5.0
NPU 硬件:910B3
cmake: 3.22.1

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

复现步骤:

git clone https://gitcode.com/cann/ops-transformer.git
cd ops-transformer

git checkout f764787ebf92ff3aa9b2656f486e7eac70cfae80 # 20260821 clone master 分支最新 commit

bash build.sh --soc=ascend910b --ops=grouped_matmul_swiglu_quant_v2 --pkg

# 出现报错的命令
bash build.sh --soc=ascend910b --ops=grouped_matmul_swiglu_quant_v2 --ophost_test

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

bash build.sh --soc=ascend910b --ops=grouped_matmul_swiglu_quant_v2 --ophost_test 命令可以成功编译 UT 脚本并执行 UT 测试

root@worker-41-52 /m/s/w/ops-transformer-master (master)# bash build.sh --soc=ascend910b --ops=grouped_matmul_swiglu_quant_v2 --ophost_test
[2026-08-20 22:55:57] Warning: The current environment is configured for ascend910b, Please use Atlas A2 series hardware for optimal performance.
[2026-08-20 22:55:57] ----------------------------------------------------------------
[2026-08-20 22:55:57] Start to build ut
[2026-08-20 22:56:02] -- The C compiler identification is GNU 11.4.0
[2026-08-20 22:56:02] -- The CXX compiler identification is GNU 11.4.0
[2026-08-20 22:56:02] -- Detecting C compiler ABI info
[2026-08-20 22:56:02] -- Detecting C compiler ABI info - done
[2026-08-20 22:56:02] -- Check for working C compiler: /usr/bin/cc - skipped
[2026-08-20 22:56:02] -- Detecting C compile features
[2026-08-20 22:56:02] -- Detecting C compile features - done
[2026-08-20 22:56:02] -- Detecting CXX compiler ABI info
[2026-08-20 22:56:03] -- Detecting CXX compiler ABI info - done
[2026-08-20 22:56:03] -- Check for working CXX compiler: /usr/bin/c++ - skipped
[2026-08-20 22:56:03] -- Detecting CXX compile features
[2026-08-20 22:56:03] -- Detecting CXX compile features - done
[2026-08-20 22:56:03] -- Initialization summary: Ccache not found, TARGET_ARCH: aarch64
[2026-08-20 22:56:03] -- ASCEND_CANN_PACKAGE_PATH=/usr/local/Ascend/cann-8.5.2
[2026-08-20 22:56:03] -- compile project with library
[2026-08-20 22:56:13] -- Found Python3: /usr/local/python3.11.15/bin/python3 (found version "3.11.15") found components: Interpreter
[2026-08-20 22:56:13] -- ENABLE_CCACHE=ON, CUSTOM_CCACHE=
CMake Error at /usr/local/Ascend/cann-8.5.2/tools/tikicpulib/lib/cmake/tikicpulib-config.cmake:34 (add_library):
  add_library cannot create ALIAS target "tikicpulib::bs9sx2aa" because
  another target with the same name already exists.
Call Stack (most recent call first):
  cmake/config_utest.cmake:28 (find_package)
  cmake/config.cmake:279 (include)
  CMakeLists.txt:159 (include)


CMake Error at /usr/local/Ascend/cann-8.5.2/tools/tikicpulib/lib/cmake/tikicpulib-config.cmake:34 (add_library):
  add_library cannot create ALIAS target "tikicpulib::mc61am21aa" because
  another target with the same name already exists.
Call Stack (most recent call first):
  cmake/config_utest.cmake:28 (find_package)
  cmake/config.cmake:279 (include)
  CMakeLists.txt:159 (include)

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

likedislike
HHirozy
8月21日 修改了issue 的描述
weihao18成员
8月21日 评论:

你好,请问你用的cmake是什么版本

likedislike
HHirozy
8月21日 修改了issue 的描述
Hirozy
8月21日 评论:

你好,请问你用的cmake是什么版本

@weihao18

cmake version 3.22.1

likedislike
weihao18成员
8月21日 评论:

/assign @weihao18

likedislike
CANN-robotCANN-robot成员
8月21日 将 weihao18 设为负责人
Wweihao18成员
8月24日 关联了pull request:fix: 修复cmake升级后tikicpulib ALIAS target重复创建导致ophost_test编译失败
weihao18成员
8月24日 评论:

@Hirozy 修复已合入master分支,请拉最新代码尝试是否问题已解决

likedislike
Hirozy
8月24日 评论:

确认 master 分支已解决该问题,多谢!

[2026-08-24 02:27:51] [       OK ] GMMSQ_V2_INFERSHAPE_CSV/TestGroupedMatmulSwigluQuantV2Infershape.csvDrivenCase/dtype_invalid_mx_wscale (0 ms)
[2026-08-24 02:27:51] [ RUN      ] GMMSQ_V2_INFERSHAPE_CSV/TestGroupedMatmulSwigluQuantV2Infershape.csvDrivenCase/mxA8W4_multi_weight
[2026-08-24 02:27:51] [       OK ] GMMSQ_V2_INFERSHAPE_CSV/TestGroupedMatmulSwigluQuantV2Infershape.csvDrivenCase/mxA8W4_multi_weight (0 ms)
[2026-08-24 02:27:51] [ RUN      ] GMMSQ_V2_INFERSHAPE_CSV/TestGroupedMatmulSwigluQuantV2Infershape.csvDrivenCase/mxA8W4_multi_weight_n_neq_k
[2026-08-24 02:27:51] [       OK ] GMMSQ_V2_INFERSHAPE_CSV/TestGroupedMatmulSwigluQuantV2Infershape.csvDrivenCase/mxA8W4_multi_weight_n_neq_k (0 ms)
[2026-08-24 02:27:51] [ RUN      ] GMMSQ_V2_INFERSHAPE_CSV/TestGroupedMatmulSwigluQuantV2Infershape.csvDrivenCase/mxA8W4_multi_weight_n_neq_k_no_transpose
[2026-08-24 02:27:51] [       OK ] GMMSQ_V2_INFERSHAPE_CSV/TestGroupedMatmulSwigluQuantV2Infershape.csvDrivenCase/mxA8W4_multi_weight_n_neq_k_no_transpose (0 ms)
[2026-08-24 02:27:51] [ RUN      ] GMMSQ_V2_INFERSHAPE_CSV/TestGroupedMatmulSwigluQuantV2Infershape.csvDrivenCase/w8a8_normal_1
[2026-08-24 02:27:51] [       OK ] GMMSQ_V2_INFERSHAPE_CSV/TestGroupedMatmulSwigluQuantV2Infershape.csvDrivenCase/w8a8_normal_1 (0 ms)
[2026-08-24 02:27:51] [ RUN      ] GMMSQ_V2_INFERSHAPE_CSV/TestGroupedMatmulSwigluQuantV2Infershape.csvDrivenCase/a8w4_weightnz_pergroup
[2026-08-24 02:27:51] [       OK ] GMMSQ_V2_INFERSHAPE_CSV/TestGroupedMatmulSwigluQuantV2Infershape.csvDrivenCase/a8w4_weightnz_pergroup (0 ms)
[2026-08-24 02:27:51] [----------] 23 tests from GMMSQ_V2_INFERSHAPE_CSV/TestGroupedMatmulSwigluQuantV2Infershape (2 ms total)
[2026-08-24 02:27:51]
[2026-08-24 02:27:51] [----------] Global test environment tear-down
[2026-08-24 02:27:51] Global Environment TearDown
[2026-08-24 02:27:51] [==========] 203 tests from 5 test suites ran. (165 ms total)
[2026-08-24 02:27:51] [  PASSED  ] 203 tests.
[2026-08-24 02:27:51] [100%] Built target transformer_op_host_ut
likedislike
HHirozy
8月24日 issue状态由 进行中 改变为 已确认
Wweihao18成员
8月25日 issue状态由 已确认 改变为 已完成
Wweihao18成员
8月25日 关闭了 issue
CANN-robotCANN-robot成员
8月25日 添加了label:resolved