已关闭
[Bug-Report|缺陷反馈]: 简单代码运行异常的慢(秒级的运行速率) #1428
_pinnacle_创建于 2025年11月21日关闭于 7月4日
huangyunlong
2025年11月21日 评论:
2025年11月21日 评论:
首次运行可能较慢,可以正确配套安装kernels包,配置torch.npu.set_compile_mode(jit_compile=False)走二进制减少编译耗时
https://www.hiascend.com/document/detail/zh/canncommercial/83RC1/softwareinst/instg/instg_0008.html?Mode=PmIns&InstallType=local&OS=openEuler&Software=cannToolKit


_pinnacle_
2025年11月24日 评论:
2025年11月24日 评论:
配置torch.npu.set_compile_mode(jit_compile=False),第一次运行仍然要45秒


huangyunlong
2025年11月25日 评论:
2025年11月25日 评论:
首次运行较慢,请观察后续step耗时


。七十二。
2025年11月25日 评论:
2025年11月25日 评论:
配置torch.npu.set_compile_mode(jit_compile=False),第一次运行仍然要45秒
你好,我这边也再测试torch npu,用的是测试开发板,你的这个速度最后可以提高吗?


_pinnacle_
2025年11月25日 评论:
2025年11月25日 评论:
@laner__gg 不能哦,而且稍微大的模型,不编译就报错,编译半天都跑不动(是真的半天),根本无法运行


。七十二。
2025年11月26日 评论:
2025年11月26日 评论:
那你最后想要加速运算用什么方法,我想对nms整个过程移动到npu上进行加速处理,你有什么好的方案吗?


_pinnacle_
2025年11月26日 评论:
2025年11月26日 评论:
用c++写了


jiachaofrm
1月19日 评论:
1月19日 评论:
俺也一样,运行太慢了,根本用不了


chenrayray
7月4日 评论:
7月4日 评论:
您好,本Issue因长期无有效互动,现暂时关闭。如问题依然存在,请重新打开并提供最新复现信息,我们会继续跟进。感谢理解!


7月4日 issue状态由 TODO 改变为 DONE
7月4日 关闭了 issue
7月4日 添加了label:resolved
Thanks for sending an issue! Please fill in the following template to help quickly solve your problem.
Describe the current behavior / 问题描述 (Mandatory / 必填)
.....[W1121 03:31:15.148952105 compiler_depend.ts:164] Warning: Device do not support double dtype now, dtype cast replace with float. (function operator())
....tensor([0.2795, 3.4806, 3.4803, 0.5993, 1.8243, 6.4635, 3.5841, 0.4743, 2.6021,
0.2085], device='npu:0')
take: 137.0029957294464 s
Environment / 环境信息 (Mandatory / 必填)
硬件:OrangePi AIpro
npu-smi info
+--------------------------------------------------------------------------------------------------------+
| npu-smi 25.2.0 Version: 25.2.0 |
+-------------------------------+-----------------+------------------------------------------------------+
| NPU Name | Health | Power(W) Temp(C) Hugepages-Usage(page) |
| Chip Device | Bus-Id | AICore(%) Memory-Usage(MB) |
+===============================+=================+======================================================+
| 0 310B4 | Alarm | 0.0 35 15 / 15 |
| 0 0 | NA | 0 5917 / 15609 |
+===============================+=================+======================================================+
ls ~/Ascend/ascend-toolkit/
8.3 8.3.RC1 latest set_env.sh
python3 -m pip list |grep torch
torch 2.8.0
torch_npu 2.8.0
Steps to reproduce the issue / 重现步骤 (Mandatory / 必填)
使用以下代码
`import torch
import time
start = time.time()
x = torch.randn(10).npu()
y = torch.randn(10).npu()
z = torch.exp(x+y)
print(z)
print("take:",time.time()-start,"s")
`
Describe the expected behavior / 预期结果 (Mandatory / 必填)
应该运行只有ms级及以下
Related log / screenshot / 日志 / 截图 (Mandatory / 必填)
/var/log/npu/hisi_logs/device-0/20251121010745-890957004/bbox/lpm.txt:18:[ERROR] LPM(-1,null):2025-11-21-01:07:45.890000 [power] [PowerDrvStormHandle 32] Get soc power failed
/var/log/npu/hisi_logs/device-0/20251121010244-798194003/log/lpm.txt:4:[ERROR] LPM(-1,null):2025-11-21-01:02:44.798000 [power] [PowerDrvStormHandle 32] Get soc power failed
/var/log/npu/hisi_logs/device-0/20251121010244-798194003/bbox/lpm.txt:21:[ERROR] LPM(-1,null):2025-11-21-01:02:44.798000 [power] [PowerDrvStormHandle 32] Get soc power failed
/var/log/npu/hisi_logs/device-0/20251121005743-694902002/log/lpm.txt:104:[ERROR] LPM(-1,null):1970-01-01-00:00:01.039000 [ina] [InaRead 53] ret: -1
/var/log/npu/hisi_logs/device-0/20251121005743-694902002/log/lpm.txt:105:[ERROR] LPM(-1,null):1970-01-01-00:00:01.039000 [ina] [InaGetValue 150] seq[1] inaXxx busId[0] slave[0x4b] read reg[0xff] failed
/var/log/npu/hisi_logs/device-0/20251121005743-694902002/log/lpm.txt:107:[ERROR] LPM(-1,null):1970-01-01-00:00:01.039000 [ina] [Ina226Init 79] ina226 write config failed
/var/log/npu/hisi_logs/device-0/20251121005743-694902002/log/lpm.txt:108:[ERROR] LPM(-1,null):1970-01-01-00:00:01.039000 [ina] [InaInit 55] cfgreg err -1.
/var/log/npu/hisi_logs/device-0/20251121005743-694902002/log/lpm.txt:109:[ERROR] LPM(-1,null):1970-01-01-00:00:01.040000 [ina] [InaRead 53] ret: -1
/var/log/npu/hisi_logs/device-0/20251121005743-694902002/log/lpm.txt:110:[ERROR] LPM(-1,null):1970-01-01-00:00:01.040000 [ina] [InaGetValue 150] seq[2] inaXxx busId[0] slave[0x4b] read reg[0xfe] failed
/var/log/npu/hisi_logs/device-0/20251121005743-694902002/log/lpm.txt:111:[ERROR] LPM(-1,null):1970-01-01-00:00:01.040000 [ina] [InaRead 53] ret: -1
/var/log/npu/hisi_logs/device-0/20251121005743-694902002/log/lpm.txt:112:[ERROR] LPM(-1,null):1970-01-01-00:00:01.040000 [ina] [InaGetValue 150] seq[3] inaXxx busId[0] slave[0x4b] read reg[0xfe] failed
/var/log/npu/hisi_logs/device-0/20251121005743-694902002/log/lpm.txt:113:[ERROR] LPM(-1,null):1970-01-01-00:00:01.040000 [ina] [InaRead 53] ret: -1
/var/log/npu/hisi_logs/device-0/20251121005743-694902002/log/lpm.txt:201:[ERROR] LPM(-1,null):1970-01-01-00:00:01.153000 [power] [PowerDrvStormHandle 32] Get soc power failed
/var/log/npu/hisi_logs/device-0/20251121005743-694902002/log/lpm.txt:212:[ERROR] LPM(-1,null):2025-11-20-10:17:10.004000 [power] [PowerDrvStormHandle 32] Get soc current failed
/var/log/npu/hisi_logs/device-0/20251121005743-694902002/log/lpm.txt:216:[ERROR] LPM(-1,null):2025-11-21-00:57:43.694000 [power] [PowerDrvStormHandle 32] Get soc current failed
/var/log/npu/hisi_logs/device-0/20251120101710-004595001/log/lpm.txt:6:[ERROR] LPM(-1,null):2025-11-20-10:17:10.004000 [power] [PowerDrvStormHandle 32] Get soc current failed
/var/log/npu/hisi_logs/device-0/20251120101710-004595001/bbox/lpm.txt:21:[ERROR] LPM(-1,null):2025-11-20-10:17:10.004000 [power] [PowerDrvStormHandle 32] Get soc current failed
/var/log/npu/slog/debug/device-app-250594/device-app-250594_20251121032934146.log:1:[ERROR] DRV(250594,python3):2025-11-21-03:29:33.588.390 [hdc_ppc.c:198][hdc] [DrvHdcSocketServerCreate 198] Bind ppc socket error. (strerror="No such file or directory"; errno=2; server_pid=13)
/var/log/npu/slog/debug/device-app-250594/device-app-250594_20251121032934146.log:2:[ERROR] DRV(250594,python3):2025-11-21-03:29:33.588.425 [hdc_server.c:367][hdc] [drvHdcServerCreate 367] Ppc server create failed. (errno=20)
/var/log/npu/slog/debug/device-app-250594/device-app-250594_20251121032934146.log:3:[ERROR] DRV(250594,python3):2025-11-21-03:29:34.088.626 [hdc_ppc.c:198][hdc] [DrvHdcSocketServerCreate 198] Bind ppc socket error. (strerror="No such file or directory"; errno=2; server_pid=13)
/var/log/npu/slog/debug/device-app-250594/device-app-250594_20251121032934146.log:4:[ERROR] DRV(250594,python3):2025-11-21-03:29:34.088.689 [hdc_server.c:367][hdc] [drvHdcServerCreate 367] Ppc server create failed. (errno=20)
/var/log/npu/slog/debug/device-app-250594/device-app-250594_20251121032934146.log:5:[ERROR] DRV(250594,python3):2025-11-21-03:29:34.588.896 [hdc_ppc.c:198][hdc] [DrvHdcSocketServerCreate 198] Bind ppc socket error. (strerror="No such file or directory"; errno=2; server_pid=13)
/var/log/npu/slog/debug/device-app-250594/device-app-250594_20251121032934146.log:6:[ERROR] DRV(250594,python3):2025-11-21-03:29:34.588.958 [hdc_server.c:367][hdc] [drvHdcServerCreate 367] Ppc server create failed. (errno=20)
/var/log/npu/slog/debug/device-app-250594/device-app-250594_20251121032934146.log:7:[ERROR] DRV(250594,python3):2025-11-21-03:29:35.089.163 [hdc_ppc.c:198][hdc] [DrvHdcSocketServerCreate 198] Bind ppc socket error. (strerror="No such file or directory"; errno=2; server_pid=13)
/var/log/npu/slog/debug/device-app-250594/device-app-250594_20251121032934146.log:8:[ERROR] DRV(250594,python3):2025-11-21-03:29:35.089.229 [hdc_server.c:367][hdc] [drvHdcServerCreate 367] Ppc server create failed. (errno=20)
/var/log/npu/slog/debug/device-app-250594/device-app-250594_20251121032934146.log:9:[ERROR] DRV(250594,python3):2025-11-21-03:29:35.589.439 [hdc_ppc.c:198][hdc] [DrvHdcSocketServerCreate 198] Bind ppc socket error. (strerror="No such file or directory"; errno=2; server_pid=13)
/var/log/npu/slog/debug/device-app-250594/device-app-250594_20251121032934146.log:10:[ERROR] DRV(250594,python3):2025-11-21-03:29:35.589.507 [hdc_server.c:367][hdc] [drvHdcServerCreate 367] Ppc server create failed. (errno=20)
Special notes for this issue/备注 (Optional / 选填)