Closed
[Bug-Report|缺陷反馈]: 按照文档中编译自定义算子报错 #100
condfuse_3Add on  Nov 6, 2025Closed at  Nov 19, 2025
condfuse_3
condfuse_3
Nov 6, 2025 Create

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

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

bash build.sh --pkg --experimental --soc=ascend910b --ops=transpose_batch_mat_mul
[2025-11-06 12:22:49] -- set package config: ENABLE_SOURCE_PACKAGE;True;ENABLE_BINARY_PACKAGE;True;INSTALL_PATH;/root/Ch/ops-nn/build_out/;VENDOR_NAME;custom_nn;ENABLE_DEFAULT_PACKAGE_NAME_RULE;False
CMake Error at /usr/local/Ascend/latest/compiler/tikcpp/ascendc_kernel_cmake/modules/ascend_modules/func.cmake:740 (message):
must provide LIBRARY for npu_op_package_add
Call Stack (most recent call first):
cmake/package.cmake:41 (npu_op_package_add)
CMakeLists.txt:152 (pack_custom)

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

910B4
环境按照文档安装的
能够成功编译ops-math的自定义算子

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

git clone https://gitcode.com/cann/ops-nn.git
cd ops-nn/
1005 bash build.sh --pkg --experimental --soc=ascend910b --ops=transpose_batch_mat_mul

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

能够成功编译

[2025-11-06 12:22:49] -- set package config: ENABLE_SOURCE_PACKAGE;True;ENABLE_BINARY_PACKAGE;True;INSTALL_PATH;/root/Ch/ops-nn/build_out/;VENDOR_NAME;custom_nn;ENABLE_DEFAULT_PACKAGE_NAME_RULE;False
CMake Error at /usr/local/Ascend/latest/compiler/tikcpp/ascendc_kernel_cmake/modules/ascend_modules/func.cmake:740 (message):
must provide LIBRARY for npu_op_package_add
Call Stack (most recent call first):
cmake/package.cmake:41 (npu_op_package_add)
CMakeLists.txt:152 (pack_custom)

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

likedislike
chenqi317Collaborators
Nov 6, 2025 Comments:

你好 ,抱歉资料提示不全,造成困扰

您可以执行bash build.sh --pkg --soc=ascend910b --ops=transpose_batch_mat_mul 触发transpose_batch_mat_mul编译。

若想使用 experimental 中执行 mamtul相关的算子,需要将matmul 目录拷贝到experimental 中。

资料正在补齐完善中。

likedislike
condfuse_3
condfuse_3
Nov 7, 2025 Comments:

建议在README中补充一下,我初看README认为在experimental 中是存在这个算子,并不需要我将其拷贝

likedislike
liuyufan
liuyufanCollaborators
Nov 7, 2025 Comments:

感谢您的建议,会对相关资料进行完善

likedislike
liuyufanliuyufanCollaborators
Nov 13, 2025 Associated pull request
CANN-robotCANN-robotCollaborators
Nov 19, 2025 Close issue
CANN-robotCANN-robotCollaborators
Mar 20 Added label: resolved