python环境下,在pytorch上运行funasr识别速度极慢,不如cpu,请问怎么定位解决?而且会打印...Warning: tiling offset out of range, index: 32
python代码增加下面的2句
import torch_npu
from torch_npu.contrib import transfer_to_npu
软硬件环境:
CPU:Kunpeng-920
OS:openEuler 22.03 (LTS-SP2)
Ascend-cann-toolkit_8.1.RC1_linux-aarch64
Ascend-hdk-310p-npu-driver_25.0.rc1.1_linux-aarch64
Ascend-hdk-310p-npu-firmware_7.7.0.1.231
python3.10 pytorch2.3.1+torch-npu2.3.1
运行打印日志:
/root/miniforge3/envs/test/lib/python3.10/site-packages/torch_npu/contrib/transfer_to_npu.py:292: ImportWarning:
*************************************************************************************************************
The torch.Tensor.cuda and torch.nn.Module.cuda are replaced with torch.Tensor.npu and torch.nn.Module.npu now..
The torch.cuda.DoubleTensor is replaced with torch.npu.FloatTensor cause the double type is not supported now..
The backend in torch.distributed.init_process_group set to hccl now..
The torch.cuda.* and torch.cuda.amp.* are replaced with torch.npu.* and torch.npu.amp.* now..
The device parameters have been replaced with npu in the function below:
torch.logspace, torch.randint, torch.hann_window, torch.rand, torch.full_like, torch.ones_like, torch.rand_like, torch.randperm, torch.arange, torch.frombuffer, torch.normal, torch._empty_per_channel_affine_quantized, torch.empty_strided, torch.empty_like, torch.scalar_tensor, torch.tril_indices, torch.bartlett_window, torch.ones, torch.sparse_coo_tensor, torch.randn, torch.kaiser_window, torch.tensor, torch.triu_indices, torch.as_tensor, torch.zeros, torch.randint_like, torch.full, torch.eye, torch._sparse_csr_tensor_unsafe, torch.empty, torch._sparse_coo_tensor_unsafe, torch.blackman_window, torch.zeros_like, torch.range, torch.sparse_csr_tensor, torch.randn_like, torch.from_file, torch._cudnn_init_dropout_state, torch._empty_affine_quantized, torch.linspace, torch.hamming_window, torch.empty_quantized, torch._pin_memory, torch.autocast, torch.load, torch.Generator, torch.set_default_device, torch.Tensor.new_empty, torch.Tensor.new_empty_strided, torch.Tensor.new_full, torch.Tensor.new_ones, torch.Tensor.new_tensor, torch.Tensor.new_zeros, torch.Tensor.to, torch.nn.Module.to, torch.nn.Module.to_empty
*************************************************************************************************************
warnings.warn(msg, ImportWarning)
/root/miniforge3/envs/test/lib/python3.10/site-packages/torch_npu/contrib/transfer_to_npu.py:247: RuntimeWarning: torch.jit.script and torch.jit.script_method will be disabled by transfer_to_npu, which currently does not support them, if you need to enable them, please do not use transfer_to_npu.
warnings.warn(msg, RuntimeWarning)
funasr version: 1.1.15.
torch threads 1
/root/miniforge3/envs/test/lib/python3.10/site-packages/torch_npu/utils/storage.py:38: UserWarning: TypedStorage is deprecated. It will be removed in the future and UntypedStorage will be the only storage class. This should only matter to you if you are using storages directly. To access UntypedStorage directly, use tensor.untyped_storage() instead of tensor.storage()
if self.device.type != 'cpu':
funasr version: 1.1.15.
Check update of funasr, and it would cost few times. You may disable it by set `disable_update=True` in AutoModel
torch threads 1
.........Warning: tiling offset out of range, index: 32
.................Warning: tiling offset out of range, index: 32
.......[W compiler_depend.ts:87] Warning: [Check][offset] Check input storage_offset[%ld] = 0 failed, result is untrustworthy10 (function operator())
.......Warning: tiling offset out of range, index: 32
.Warning: tiling offset out of range, index: 32
.......Warning: tiling offset out of range, index: 32
...Warning: tiling offset out of range, index: 32
..Warning: tiling offset out of range, index: 32
.........Warning: tiling offset out of range, index: 32
......Warning: tiling offset out of range, index: 32
..Warning: tiling offset out of range, index: 32
npu-smi info命令输出:
+--------------------------------------------------------------------------------------------------------+
| npu-smi 25.0.rc1.1 Version: 25.0.rc1.1 |
+-------------------------------+-----------------+------------------------------------------------------+
| NPU Name | Health | Power(W) Temp(C) Hugepages-Usage(page) |
| Chip Device | Bus-Id | AICore(%) Memory-Usage(MB) |
+===============================+=================+======================================================+
| 1 310P3 | OK | NA 51 635 / 635 |
| 0 0 | 0000:01:00.0 | 0 3206 / 44215 |
+===============================+=================+======================================================+
+-------------------------------+-----------------+------------------------------------------------------+
| NPU Chip | Process id | Process name | Process memory(MB) |
+===============================+=================+======================================================+
| 1 0 | 1251477 | pt_main_thread | 1356 |
+===============================+=================+======================================================+
npu-smi info watch命令输出:
NpuID(Idx) ChipId(Idx) Pwr(W) Temp(C) AI Core(%) AI Cpu(%) Ctrl Cpu(%) Memory(%) Memory BW(%)
1 0 NA 51 0 0 1 7 10
1 0 NA 50 0 0 2 7 51
1 0 NA 50 0 0 5 7 51
1 0 NA 50 0 0 2 7 51
1 0 NA 49 0 0 1 7 51
1 0 NA 49 0 0 1 7 51
1 0 NA 49 0 0 2 7 51
1 0 NA 49 0 0 1 7 51
1 0 NA 48 0 0 1 7 0
1 0 NA 48 0 0 2 7 0
1 0 NA 50 0 0 2 7 0
1 0 NA 50 0 0 1 7 0
1 0 NA 50 0 0 5 7 0
1 0 NA 50 0 0 1 7 0
1 0 NA 50 0 0 2 7 0
1 0 NA 50 0 0 2 7 0
1 0 NA 50 0 0 2 7 0
python代码增加下面的2句
import torch_npu
from torch_npu.contrib import transfer_to_npu
软硬件环境:
CPU:Kunpeng-920
OS:openEuler 22.03 (LTS-SP2)
Ascend-cann-toolkit_8.1.RC1_linux-aarch64
Ascend-hdk-310p-npu-driver_25.0.rc1.1_linux-aarch64
Ascend-hdk-310p-npu-firmware_7.7.0.1.231
python3.10 pytorch2.3.1+torch-npu2.3.1
运行打印日志:
/root/miniforge3/envs/test/lib/python3.10/site-packages/torch_npu/contrib/transfer_to_npu.py:292: ImportWarning:
*************************************************************************************************************
The torch.Tensor.cuda and torch.nn.Module.cuda are replaced with torch.Tensor.npu and torch.nn.Module.npu now..
The torch.cuda.DoubleTensor is replaced with torch.npu.FloatTensor cause the double type is not supported now..
The backend in torch.distributed.init_process_group set to hccl now..
The torch.cuda.* and torch.cuda.amp.* are replaced with torch.npu.* and torch.npu.amp.* now..
The device parameters have been replaced with npu in the function below:
torch.logspace, torch.randint, torch.hann_window, torch.rand, torch.full_like, torch.ones_like, torch.rand_like, torch.randperm, torch.arange, torch.frombuffer, torch.normal, torch._empty_per_channel_affine_quantized, torch.empty_strided, torch.empty_like, torch.scalar_tensor, torch.tril_indices, torch.bartlett_window, torch.ones, torch.sparse_coo_tensor, torch.randn, torch.kaiser_window, torch.tensor, torch.triu_indices, torch.as_tensor, torch.zeros, torch.randint_like, torch.full, torch.eye, torch._sparse_csr_tensor_unsafe, torch.empty, torch._sparse_coo_tensor_unsafe, torch.blackman_window, torch.zeros_like, torch.range, torch.sparse_csr_tensor, torch.randn_like, torch.from_file, torch._cudnn_init_dropout_state, torch._empty_affine_quantized, torch.linspace, torch.hamming_window, torch.empty_quantized, torch._pin_memory, torch.autocast, torch.load, torch.Generator, torch.set_default_device, torch.Tensor.new_empty, torch.Tensor.new_empty_strided, torch.Tensor.new_full, torch.Tensor.new_ones, torch.Tensor.new_tensor, torch.Tensor.new_zeros, torch.Tensor.to, torch.nn.Module.to, torch.nn.Module.to_empty
*************************************************************************************************************
warnings.warn(msg, ImportWarning)
/root/miniforge3/envs/test/lib/python3.10/site-packages/torch_npu/contrib/transfer_to_npu.py:247: RuntimeWarning: torch.jit.script and torch.jit.script_method will be disabled by transfer_to_npu, which currently does not support them, if you need to enable them, please do not use transfer_to_npu.
warnings.warn(msg, RuntimeWarning)
funasr version: 1.1.15.
torch threads 1
/root/miniforge3/envs/test/lib/python3.10/site-packages/torch_npu/utils/storage.py:38: UserWarning: TypedStorage is deprecated. It will be removed in the future and UntypedStorage will be the only storage class. This should only matter to you if you are using storages directly. To access UntypedStorage directly, use tensor.untyped_storage() instead of tensor.storage()
if self.device.type != 'cpu':
funasr version: 1.1.15.
Check update of funasr, and it would cost few times. You may disable it by set `disable_update=True` in AutoModel
torch threads 1
.........Warning: tiling offset out of range, index: 32
.................Warning: tiling offset out of range, index: 32
.......[W compiler_depend.ts:87] Warning: [Check][offset] Check input storage_offset[%ld] = 0 failed, result is untrustworthy10 (function operator())
.......Warning: tiling offset out of range, index: 32
.Warning: tiling offset out of range, index: 32
.......Warning: tiling offset out of range, index: 32
...Warning: tiling offset out of range, index: 32
..Warning: tiling offset out of range, index: 32
.........Warning: tiling offset out of range, index: 32
......Warning: tiling offset out of range, index: 32
..Warning: tiling offset out of range, index: 32
npu-smi info命令输出:
+--------------------------------------------------------------------------------------------------------+
| npu-smi 25.0.rc1.1 Version: 25.0.rc1.1 |
+-------------------------------+-----------------+------------------------------------------------------+
| NPU Name | Health | Power(W) Temp(C) Hugepages-Usage(page) |
| Chip Device | Bus-Id | AICore(%) Memory-Usage(MB) |
+===============================+=================+======================================================+
| 1 310P3 | OK | NA 51 635 / 635 |
| 0 0 | 0000:01:00.0 | 0 3206 / 44215 |
+===============================+=================+======================================================+
+-------------------------------+-----------------+------------------------------------------------------+
| NPU Chip | Process id | Process name | Process memory(MB) |
+===============================+=================+======================================================+
| 1 0 | 1251477 | pt_main_thread | 1356 |
+===============================+=================+======================================================+
npu-smi info watch命令输出:
NpuID(Idx) ChipId(Idx) Pwr(W) Temp(C) AI Core(%) AI Cpu(%) Ctrl Cpu(%) Memory(%) Memory BW(%)
1 0 NA 51 0 0 1 7 10
1 0 NA 50 0 0 2 7 51
1 0 NA 50 0 0 5 7 51
1 0 NA 50 0 0 2 7 51
1 0 NA 49 0 0 1 7 51
1 0 NA 49 0 0 1 7 51
1 0 NA 49 0 0 2 7 51
1 0 NA 49 0 0 1 7 51
1 0 NA 48 0 0 1 7 0
1 0 NA 48 0 0 2 7 0
1 0 NA 50 0 0 2 7 0
1 0 NA 50 0 0 1 7 0
1 0 NA 50 0 0 5 7 0
1 0 NA 50 0 0 1 7 0
1 0 NA 50 0 0 2 7 0
1 0 NA 50 0 0 2 7 0
1 0 NA 50 0 0 2 7 0