已开启
编译失败aclnn_cpp #2
L1919_snow创建于 7月27日
L1919_snow
7月28日 评论:
7月28日 评论:
可行的修改方案:
has_dvm = bool(backend_declarations.get('lazy_fusion'))
dvm_includes = (
'#include "op_plugin/DvmOpsInterface.h"\n'
'#include "op_plugin/ops/dvm/lazy_fusion_kernel.h"\n' if has_dvm else ''
)




8月1日 修改了issue 的描述
(lxy_py310) [root@localhost framwork_cpp_extension]# python setup.py bdist_wheel
/home/miniconda3/envs/lxy_py310/lib/python3.10/site-packages/torch_npu/dynamo/init.py:145: UserWarning: Register eager implementation for the 'npu' backend of dynamo, as torch_npu was not compiled with torchair.
warnings.warn(
running bdist_wheel
running build
running build_py
copying custom_ops/init.py -> build/lib.linux-aarch64-cpython-310/custom_ops
copying custom_ops/add_custom.py -> build/lib.linux-aarch64-cpython-310/custom_ops
running build_ext
building 'custom_ops_lib' extension
g++ -Wno-unused-result -Wsign-compare -DNDEBUG -fwrapv -O3 -Wall -fPIC -O3 -isystem /home/miniconda3/envs/lxy_py310/include -fPIC -O3 -isystem /home/miniconda3/envs/lxy_py310/include -fPIC -I/home/miniconda3/envs/lxy_py310/lib/python3.10/site-packages/torch_npu/include -I/home/miniconda3/envs/lxy_py310/lib/python3.10/site-packages/torch_npu/include/third_party/acl/inc -I/home/miniconda3/envs/lxy_py310/lib/python3.10/site-packages/torch_npu/include/third_party/hccl/inc -I/home/miniconda3/envs/lxy_py310/lib/python3.10/site-packages/torch/include -I/home/miniconda3/envs/lxy_py310/lib/python3.10/site-packages/torch/include/torch/csrc/api/include -I/home/miniconda3/envs/lxy_py310/include/python3.10 -c /home/l00881990/op-plugin/examples/framwork_cpp_extension/csrc/add_custom.cpp -o build/temp.linux-aarch64-cpython-310/home/l00881990/op-plugin/examples/framwork_cpp_extension/csrc/add_custom.o -I/home/miniconda3/envs/lxy_py310/lib/python3.10/site-packages/torch_npu/include/third_party/acl/inc -I/home/miniconda3/envs/lxy_py310/lib/python3.10/site-packages/torch_npu/include/third_party/op-plugin -I/home/miniconda3/envs/lxy_py310/lib/python3.10/site-packages/torch_npu/include/third_party/op-plugin/op_plugin/include -DTORCH_API_INCLUDE_EXTENSION_H -DPYBIND11_COMPILER_TYPE="_gcc" -DPYBIND11_STDLIB="_libstdcpp" -DPYBIND11_BUILD_ABI="_cxxabi1016" -DTORCH_EXTENSION_NAME=custom_ops_lib -D_GLIBCXX_USE_CXX11_ABI=1 -std=c++17
In file included from /home/miniconda3/envs/lxy_py310/lib/python3.10/site-packages/torch_npu/include/third_party/op-plugin/op_plugin/include/npu_cpp_extension.h:19,
from /home/l00881990/op-plugin/examples/framwork_cpp_extension/csrc/add_custom.cpp:13:
/home/l00881990/op-plugin/examples/framwork_cpp_extension/csrc/add_custom.cpp: 在 lambda 函数中:
/home/miniconda3/envs/lxy_py310/lib/python3.10/site-packages/torch_npu/include/third_party/op-plugin/op_plugin/utils/op_api_common_base.h:559:56: 错误:‘snapshot’在此作用域中尚未声明
559 | at_npu::native::ApplyDeterministicSnapshot(snapshot, true);
| ^~~~~~~~
/home/miniconda3/envs/lxy_py310/lib/python3.10/site-packages/torch_npu/include/third_party/op-plugin/op_plugin/utils/op_api_common_base.h:559:56: 附注:in definition of macro ‘EXEC_NPU_CMD_V2_EXT’
559 | at_npu::native::ApplyDeterministicSnapshot(snapshot, true);
| ^~~~~~~~
/home/l00881990/op-plugin/examples/framwork_cpp_extension/csrc/add_custom.cpp:31:3: 附注:in expansion of macro ‘EXEC_NPU_CMD_EXT’
31 | EXEC_NPU_CMD_EXT(aclnnAdd, self, other, alpha, result);
| ^~~~~~~~~~~~~~~~
/home/miniconda3/envs/lxy_py310/lib/python3.10/site-packages/torch_npu/include/third_party/op-plugin/op_plugin/utils/op_api_common_base.h:569:18: 警告:unused variable ‘workspace_status’ [-Wunused-variable]
569 | auto workspace_status = call(getWorkspaceSizeFunc, converted_params);
| ^~~~~~~~~~~~~~~~
/home/miniconda3/envs/lxy_py310/lib/python3.10/site-packages/torch_npu/include/third_party/op-plugin/op_plugin/utils/op_api_common_base.h:569:18: 附注:in definition of macro ‘EXEC_NPU_CMD_V2_EXT’
569 | auto workspace_status = call(getWorkspaceSizeFunc, converted_params);
| ^~~~~~~~~~~~~~~~
/home/l00881990/op-plugin/examples/framwork_cpp_extension/csrc/add_custom.cpp:31:3: 附注:in expansion of macro ‘EXEC_NPU_CMD_EXT’
31 | EXEC_NPU_CMD_EXT(aclnnAdd, self, other, alpha, result);
| ^~~~~~~~~~~~~~~~
/home/l00881990/op-plugin/examples/framwork_cpp_extension/csrc/add_custom.cpp: 在函数‘at::Tensor add_custom_impl_npu(const at::Tensor&, const at::Tensor&)’中:
/home/miniconda3/envs/lxy_py310/lib/python3.10/site-packages/torch_npu/include/third_party/op-plugin/op_plugin/utils/op_api_common_base.h:508:52: 错误:‘snapshot’在此作用域中尚未声明
508 | at_npu::native::ApplyDeterministicSnapshot(snapshot, true);
| ^~~~~~~~
/home/miniconda3/envs/lxy_py310/lib/python3.10/site-packages/torch_npu/include/third_party/op-plugin/op_plugin/utils/op_api_common_base.h:508:52: 附注:in definition of macro ‘EXEC_NPU_CMD_V1_EXT’
508 | at_npu::native::ApplyDeterministicSnapshot(snapshot, true);
| ^~~~~~~~
/home/l00881990/op-plugin/examples/framwork_cpp_extension/csrc/add_custom.cpp:31:3: 附注:in expansion of macro ‘EXEC_NPU_CMD_EXT’
31 | EXEC_NPU_CMD_EXT(aclnnAdd, self, other, alpha, result);
| ^~~~~~~~~~~~~~~~
/home/miniconda3/envs/lxy_py310/lib/python3.10/site-packages/torch_npu/include/third_party/op-plugin/op_plugin/utils/op_api_common_base.h:518:98: 警告:capture of variable ‘opApiFuncAddr’ with non-automatic storage duration
518 | auto acl_call = converted_params, workspace_addr, workspace_size, acl_stream, executor, opApiFuncAddr->int {
| ^~~~~~~~~~~~~
/home/miniconda3/envs/lxy_py310/lib/python3.10/site-packages/torch_npu/include/third_party/op-plugin/op_plugin/utils/op_api_common_base.h:518:98: 附注:in definition of macro ‘EXEC_NPU_CMD_V1_EXT’
518 | auto acl_call = converted_params, workspace_addr, workspace_size, acl_stream, executor, opApiFuncAddr->int {
| ^~~~~~~~~~~~~
/home/l00881990/op-plugin/examples/framwork_cpp_extension/csrc/add_custom.cpp:31:3: 附注:in expansion of macro ‘EXEC_NPU_CMD_EXT’
31 | EXEC_NPU_CMD_EXT(aclnnAdd, self, other, alpha, result);
| ^~~~~~~~~~~~~~~~
/home/miniconda3/envs/lxy_py310/lib/python3.10/site-packages/torch_npu/include/third_party/op-plugin/op_plugin/utils/op_api_common_base.h:491:22: 附注:‘void* opApiFuncAddr’ declared here
491 | static void* opApiFuncAddr = nullptr;
| ^~~~~~~~~~~~~
/home/miniconda3/envs/lxy_py310/lib/python3.10/site-packages/torch_npu/include/third_party/op-plugin/op_plugin/utils/op_api_common_base.h:491:22: 附注:in definition of macro ‘EXEC_NPU_CMD_V1_EXT’
491 | static void* opApiFuncAddr = nullptr;
| ^~~~~~~~~~~~~
/home/l00881990/op-plugin/examples/framwork_cpp_extension/csrc/add_custom.cpp:31:3: 附注:in expansion of macro ‘EXEC_NPU_CMD_EXT’
31 | EXEC_NPU_CMD_EXT(aclnnAdd, self, other, alpha, result);
| ^~~~~~~~~~~~~~~~
/home/miniconda3/envs/lxy_py310/lib/python3.10/site-packages/torch_npu/include/third_party/op-plugin/op_plugin/utils/op_api_common_base.h:515:14: 警告:unused variable ‘workspace_status’ [-Wunused-variable]
515 | auto workspace_status = call(getWorkspaceSizeFunc, converted_params);
| ^~~~~~~~~~~~~~~~
/home/miniconda3/envs/lxy_py310/lib/python3.10/site-packages/torch_npu/include/third_party/op-plugin/op_plugin/utils/op_api_common_base.h:515:14: 附注:in definition of macro ‘EXEC_NPU_CMD_V1_EXT’
515 | auto workspace_status = call(getWorkspaceSizeFunc, converted_params);
| ^~~~~~~~~~~~~~~~
/home/l00881990/op-plugin/examples/framwork_cpp_extension/csrc/add_custom.cpp:31:3: 附注:in expansion of macro ‘EXEC_NPU_CMD_EXT’
31 | EXEC_NPU_CMD_EXT(aclnnAdd, self, other, alpha, result);
| ^~~~~~~~~~~~~~~~
In file included from /home/miniconda3/envs/lxy_py310/lib/python3.10/site-packages/torch_npu/include/torch_npu/csrc/core/npu/npu_log.h:7,