一、问题现象(附报错日志上下文):
import torch
import torch_npu
正常
x = torch.randn(2, 2).npu()
报错。
日志:
Traceback (most recent call last):
File "test.py", line 24, in
x = torch.randn(2, 2).npu()
File "/root/miniconda3/envs/yzh/lib/python3.8/site-packages/torch_npu/utils/device_guard.py", line 45, in wrapper
return func(*args, **kwargs)
File "/root/miniconda3/envs/yzh/lib/python3.8/site-packages/torch_npu/utils/tensor_methods.py", line 74, in _npu
return torch_npu._C.npu(self, *args, **kwargs)
RuntimeError: Initialize:/devcloud/slavespace/slave1-new/workspace/j_Z72vQzbI/pytorch/torch_npu/csrc/core/npu/sys_ctrl/npu_sys_ctrl.cpp:208 NPU error, error code is 4294967295.
EC0010: Failed to import Python module [ModuleNotFoundError: No module named 'decorator'.].
Solution: Check that all required components are properly installed and the specified Python path matches the Python installation directory. (If the path does not match the directory, run set_env.sh in the installation package.)
TraceBack (most recent call last):
[GraphOpt][InitializeInner][InitTbeFunc] Failed to init tbe.[FUNC:InitializeInner][FILE:tbe_op_store_adapter.cc][LINE:1641]
[SubGraphOpt][PreCompileOp][InitAdapter] InitializeAdapter adapter [tbe_op_adapter] failed! Ret [4294967295][FUNC:InitializeAdapter][FILE:op_store_adapter_manager.cc][LINE:86]
[SubGraphOpt][PreCompileOp][Init] Initialize op store adapter failed, OpsStoreName[tbe-custom].[FUNC:Initialize][FILE:op_store_adapter_manager.cc][LINE:133]
[FusionMngr][Init] Op store adapter manager init failed.[FUNC:Initialize][FILE:fusion_manager.cc][LINE:109]
PluginManager InvokeAll failed.[FUNC:Initialize][FILE:ops_kernel_manager.cc][LINE:104]
OpsManager initialize failed.[FUNC:InnerInitialize][FILE:gelib.cc][LINE:236]
GELib::InnerInitialize failed.[FUNC:Initialize][FILE:gelib.cc][LINE:164]
二、软件版本:
-- CANN 版本 (e.g., CANN 3.0.x,5.x.x): CANN 6.3.RC2
--Tensorflow/Pytorch/MindSpore 版本: torch 1.11.0
--Python 版本 (e.g., Python 3.7.5): Python 3.8.18
--操作系统版本 (e.g., Ubuntu 18.04): Ubuntu 18.04
--torch-npu 版本 : 1.11.0.post2
三、测试步骤:
import torch
import torch_npu
x = torch.randn(2, 2).npu()
报错
四、日志信息:
Traceback (most recent call last):
File "test.py", line 24, in
x = torch.randn(2, 2).npu()
File "/root/miniconda3/envs/yzh/lib/python3.8/site-packages/torch_npu/utils/device_guard.py", line 45, in wrapper
return func(*args, **kwargs)
File "/root/miniconda3/envs/yzh/lib/python3.8/site-packages/torch_npu/utils/tensor_methods.py", line 74, in _npu
return torch_npu._C.npu(self, *args, **kwargs)
RuntimeError: Initialize:/devcloud/slavespace/slave1-new/workspace/j_Z72vQzbI/pytorch/torch_npu/csrc/core/npu/sys_ctrl/npu_sys_ctrl.cpp:208 NPU error, error code is 4294967295.
EC0010: Failed to import Python module [ModuleNotFoundError: No module named 'decorator'.].
Solution: Check that all required components are properly installed and the specified Python path matches the Python installation directory. (If the path does not match the directory, run set_env.sh in the installation package.)
TraceBack (most recent call last):
[GraphOpt][InitializeInner][InitTbeFunc] Failed to init tbe.[FUNC:InitializeInner][FILE:tbe_op_store_adapter.cc][LINE:1641]
[SubGraphOpt][PreCompileOp][InitAdapter] InitializeAdapter adapter [tbe_op_adapter] failed! Ret [4294967295][FUNC:InitializeAdapter][FILE:op_store_adapter_manager.cc][LINE:86]
[SubGraphOpt][PreCompileOp][Init] Initialize op store adapter failed, OpsStoreName[tbe-custom].[FUNC:Initialize][FILE:op_store_adapter_manager.cc][LINE:133]
[FusionMngr][Init] Op store adapter manager init failed.[FUNC:Initialize][FILE:fusion_manager.cc][LINE:109]
PluginManager InvokeAll failed.[FUNC:Initialize][FILE:ops_kernel_manager.cc][LINE:104]
OpsManager initialize failed.[FUNC:InnerInitialize][FILE:gelib.cc][LINE:236]
GELib::InnerInitialize failed.[FUNC:Initialize][FILE:gelib.cc][LINE:164]