序号 |
API名称 |
npu对应API名称 |
是否支持 |
---|---|---|---|
1 |
torch.cuda.current_blas_handle |
torch.npu.current_blas_handle |
否 |
2 |
torch.cuda.current_device |
torch.npu.current_device |
是 |
3 |
torch.cuda.current_stream |
torch_npu.npu.current_stream |
是 |
4 |
torch.cuda.default_stream |
torch.npu.default_stream |
是 |
5 |
torch.cuda.device |
torch_npu.npu.device |
是 |
6 |
torch.cuda.device_count |
torch.npu.device_count |
是 |
7 |
torch.cuda.device_of |
torch_npu.npu.device_of |
是 |
8 |
torch.cuda.get_device_capability |
torch.npu.get_device_capability |
否 |
9 |
torch.cuda.get_device_name |
torch.npu.get_device_name |
否 |
10 |
torch.cuda.init |
torch.npu.init |
是 |
11 |
torch.cuda.ipc_collect |
torch.npu.ipc_collect |
否 |
12 |
torch.cuda.is_available |
torch.npu.is_available |
是 |
13 |
torch.cuda.is_initialized |
torch.npu.is_initialized |
是 |
14 |
torch.cuda.set_device |
torch.npu.set_device |
部分支持 |
15 |
torch.cuda.stream |
torch.npu.stream |
是 |
16 |
torch.cuda.synchronize |
torch.npu.synchronize |
是 |
torch.npu.set_device()接口只支持在程序开始的位置通过set_device进行指定,不支持多次指定和with torch.npu.device(id)方式的device切换
序号 |
API名称 |
npu对应API名称 |
是否支持 |
---|---|---|---|
1 |
torch.cuda.get_rng_state |
torch.npu.get_rng_state |
否 |
2 |
torch.cuda.get_rng_state_all |
torch.npu.get_rng_state_all |
否 |
3 |
torch.cuda.initial_seed |
torch_npu.npu.initial_seed |
否 |
4 |
torch.cuda.manual_seed |
torch.npu.manual_seed |
否 |
5 |
torch.cuda.manual_seed_all |
torch_npu.npu.manual_seed_all |
否 |
6 |
torch.cuda.seed |
torch.npu.seed |
否 |
7 |
torch.cuda.seed_all |
torch_npu.npu.seed_all |
否 |
8 |
torch.cuda.set_rng_state |
torch.npu.set_rng_state |
否 |
9 |
torch.cuda.set_rng_state_all |
torch_npu.npu.set_rng_state_all |
否 |
序号 |
API名称 |
npu对应API名称 |
是否支持 |
---|---|---|---|
1 |
torch.cuda.comm.broadcast |
torch.npu.comm.broadcast |
否 |
2 |
torch.cuda.comm.broadcast_coalesced |
torch_npu.npu.comm.broadcast_coalesced |
否 |
3 |
torch.cuda.comm.gather |
torch.npu.comm.gather |
否 |
4 |
torch.cuda.comm.reduce_add |
torch_npu.npu.comm.reduce_add |
否 |
5 |
torch.cuda.comm.scatter |
torch.npu.comm.scatter |
否 |
序号 |
API名称 |
npu对应API名称 |
是否支持 |
---|---|---|---|
1 |
torch.cuda.Event |
torch_npu.npu.Event |
是,不支持from_ipc_handle和ipc_handle |
2 |
torch.cuda.Stream |
torch.npu.Stream |
是 |
序号 |
API名称 |
npu对应API名称 |
是否支持 |
---|---|---|---|
1 |
torch.cuda.empty_cache |
torch_npu.npu.empty_cache |
是 |
2 |
torch.cuda.max_memory_allocated |
torch.npu.max_memory_allocated |
是 |
3 |
torch.cuda.max_memory_cached |
torch_npu.npu.max_memory_cached |
是 |
4 |
torch.cuda.max_memory_reserved |
torch.npu.max_memory_reserved |
是 |
5 |
torch.cuda.memory_allocated |
torch_npu.npu.memory_allocated |
是 |
6 |
torch.cuda.memory_cached |
torch.npu.memory_cached |
是 |
7 |
torch.cuda.memory_reserved |
torch.npu.memory_reserved |
是 |
8 |
torch.cuda.memory_snapshot |
torch_npu.npu.memory_snapshot |
是 |
9 |
torch.cuda.memory_stats |
torch.npu.memory_stats |
是 |
10 |
torch.cuda.memory_summary |
torch.npu.memory_summary |
是 |
11 |
torch.cuda.reset_max_memory_allocated |
torch_npu.npu.reset_max_memory_allocated |
是 |
12 |
torch.cuda.reset_max_memory_cached |
torch.npu.reset_max_memory_cached |
是 |
序号 |
API名称 |
npu对应API名称 |
是否支持 |
---|---|---|---|
1 |
torch.cuda.nvtx.mark |
torch.npu.nvtx.mark |
否 |
2 |
torch.cuda.nvtx.range_pop |
torch_npu.npu.nvtx.range_pop |
否 |
3 |
torch.cuda.nvtx.range_push |
torch.npu.nvtx.range_push |
否 |