1、import torch_npu报错,请查看core堆栈,
这里看到你torch_npu的demo可以运行,说明import torch_npu可以运行,如果发生了core,请采集core堆栈,检查core的原因
2、首次运行存在算子编译等耗时,请观察后续step耗时
或者安装对应kernels包,配置torch.npu.set_compile_mode(jit_compile=False)走二进制,减少编译耗时
更进一步的性能优化,可以采集profiling数据,进行针对性优化
https://www.hiascend.com/document/detail/zh/Pytorch/720/ptmoddevg/trainingmigrguide/performance_tuning_0014.html
3、无法复现,这里是不是底层卡住了,建议在卡住时通过gdb采集堆栈进行定位


我根本无法运行import torch_npu,无论我如何重装torch-npu都是这个问题



首先安装配套的驱动,固件,cann,torch,torch_npu,然后如果core了,就查看core堆栈进行定位


- 已经重装CANN

- 已经重新创建conda环境

- 已经创新按照如下创建环境

- 已经重装Kernel

问题1确实解决,但是问题2,问题3依旧没有达到预期




2,3如果是卡住,需要gdb看下卡住的堆栈,如果是性能差,可以采集profiling看下主要耗时
另外npu首次运行存在初始化等过程,可能耗时长点,可以关注后续step耗时


如果感觉卡住了,可以gdb采集堆栈看下卡在哪里


我是用gdb采集堆栈,运行samples/inference/ACLHelloWorld官方代码,同样是卡在npu初始阶段

同时我尝试检查我的驱动,使用lspci | grep -i ascend、sudo find /usr/local/Ascend -name "ascend310p.ko"都无法显示,我是用./Ascend-hdk-310p-npu-driver_25.2.0_linux-aarch64.run --full --force强制覆盖,依旧出现这类型问题。这是否说明是硬件的问题?


目前看到问题出现在底层软件,堆栈显示卡在cann中的setdevice,驱动无法显示,这些都需要咨询下底层cann,驱动,进一步确认问题


Thanks for sending an issue! Please fill in the following template to help quickly solve your problem.
Describe the current behavior / 问题描述 (Mandatory / 必填)
torch_npu.npu.get_device_properties()函数时,运行到`torch_npu.npu._lazy_init()'时会进入死循环Environment / 环境信息 (Mandatory / 必填)
Steps to reproduce the issue / 重现步骤 (Mandatory / 必填)
torch_npu.npu.get_device_properties()函数时,运行到torch_npu.npu._lazy_init()时会进入死循环”的代码Describe the expected behavior / 预期结果 (Mandatory / 必填)
输出
2.6.0.post3输出z的值,并且运行速度要快
torch_npu.npu.get_device_properties()函数时,运行到torch_npu.npu._lazy_init()时会进入死循环”的期望输出{properties.name}, {properties.total_memory / (1 << 20):.0f}MiB具体信息,同时
torch_npu.npu._lazy_init()能顺利通过Related log / screenshot / 日志 / 截图 (Mandatory / 必填)
关于“运行“import torch_npu”会造成MindStudio报错 interrupted by signal 11:SIGSEGV。”

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