torch_npu测试报错
收藏回复举报
torch_npu测试报错
t('forum.solved') 已解决
新人帖
发表于2025-06-16 13:09:51
0 查看

python=3.10.12

torch==2.3.1 torchvision==0.18.1 torchaudio==2.3.1

torch_npu版本6.0.rc2

(torch_npu_env) [root@master2 ~]# source /usr/local/Ascend/ascend-toolkit/set_env.sh
(torch_npu_env) [root@master2 ~]# python3 -c "import torch; import torch_npu; a = torch.randn(3, 4).npu(); print(a + a)"
[W compiler_depend.ts:615] Warning: expandable_segments currently defaults to false. You can enable this feature by export PYTORCH_NPU_ALLOC_CONF = expandable_segments:True. (function operator())
Traceback (most recent call last):
  File "<string>", line 1, in <module>
  File "/root/anaconda3/envs/torch_npu_env/lib/python3.10/site-packages/torch/utils/backend_registration.py", line 150, in wrap_tensor_to
    device_idx = _normalization_device(custom_backend_name, device)
  File "/root/anaconda3/envs/torch_npu_env/lib/python3.10/site-packages/torch/utils/backend_registration.py", line 106, in _normalization_device
    return _get_current_device_index()
  File "/root/anaconda3/envs/torch_npu_env/lib/python3.10/site-packages/torch/utils/backend_registration.py", line 100, in _get_current_device_index
    return getattr(getattr(torch, custom_backend_name), _get_device_index)()
  File "/root/anaconda3/envs/torch_npu_env/lib/python3.10/site-packages/torch_npu/npu/utils.py", line 59, in current_device
    torch_npu.npu._lazy_init()
  File "/root/anaconda3/envs/torch_npu_env/lib/python3.10/site-packages/torch_npu/npu/__init__.py", line 214, in _lazy_init
    torch_npu._C._npu_init()
RuntimeError: Initialize:build/CMakeFiles/torch_npu.dir/compiler_depend.ts:217 NPU function error: at_npu::native::AclSetCompileopt(aclCompileOpt::ACL_PRECISION_MODE, precision_mode), error code is 500001
[ERROR] 2025-06-16-11:24:12 (PID:2608125, Device:0, RankID:-1) ERR00100 PTA call acl api failed
[Error]: The internal ACL of the system is incorrect.
        Rectify the fault based on the error information in the ascend log.
EC0010: 2025-06-16-11:24:12.127.633 Failed to import Python module [ModuleNotFoundError: No module named 'tbe.common.repository_manager.utils.repository_manager_log'.].
        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):
        AOE Failed to call InitCannKB
        [GraphOpt][InitializeInner][InitTbeFunc] Failed to init tbe.[FUNC:InitializeInner][FILE:tbe_op_store_adapter.cc][LINE:1719]
        [SubGraphOpt][PreCompileOp][InitAdapter] InitializeAdapter adapter [tbe_op_adapter] failed! Ret [4294967295][FUNC:InitializeAdapter][FILE:op_store_adapter_manager.cc][LINE:79]
        [SubGraphOpt][PreCompileOp][Init] Initialize op store adapter failed, OpsStoreName[tbe-custom].[FUNC:Initialize][FILE:op_store_adapter_manager.cc][LINE:120]
        [FusionMngr][Init] Op store adapter manager init failed.[FUNC:Initialize][FILE:fusion_manager.cc][LINE:117]
        PluginManager InvokeAll failed.[FUNC:Initialize][FILE:ops_kernel_manager.cc][LINE:82]
        OpsManager initialize failed.[FUNC:InnerInitialize][FILE:gelib.cc][LINE:234]
        GELib::InnerInitialize failed.[FUNC:Initialize][FILE:gelib.cc][LINE:162]
        GEInitialize failed.[FUNC:GEInitialize][FILE:ge_api.cc][LINE:334]
        [Initialize][Ge]GEInitialize failed. ge result = 4294967295[FUNC:ReportCallError][FILE:log_inner.cpp][LINE:161]
        [Init][Compiler]Init compiler failed[FUNC:ReportInnerError][FILE:log_inner.cpp][LINE:145]
        [Set][Options]OpCompileProcessor init failed![FUNC:ReportInnerError][FILE:log_inner.cpp][LINE:145]

我要发帖子