torch.cuda

  1. 若API未标明支持情况,则代表该API的支持情况待验证。
  2. 在使用支持的cuda接口时,需要将API名称中的cuda变换为NPU形式才能使用:torch.cuda.***变换为torch_npu.npu.***。举例如下。
    trch.cuda.current_device --> torch_npu.npu.current_device

API名称

NPU形式名称

是否支持

限制与说明

torch.cuda.StreamContext

  

  

torch.cuda.can_device_access_peer

  

  

torch.cuda.current_blas_handle

  

  

torch.cuda.current_device

torch_npu.npu.current_device

  

torch.cuda.DoubleTensor

torch_npu.npu.DoubleTensor

     

torch.cuda.ShortTensor

torch_npu.npu.ShortTensor

     

torch.cuda.CharTenso

torch_npu.npu.CharTensor

     

torch.cuda.ByteTensor

torch_npu.npu.ByteTensor

     

torch.cuda.current_stream

  

  

torch.cuda.default_stream

  

  

torch.cuda.device

torch_npu.npu.device

  

torch.cuda.device_count

torch_npu.npu.device_count

  

torch.cuda.device_of

torch_npu.npu.device_of

  

torch.cuda.get_arch_list

  

  

torch.cuda.get_device_capability

  

  

torch.cuda.get_device_name

torch_npu.npu.get_device_name

  

torch.cuda.get_device_properties

  

  

torch.cuda.get_gencode_flags

  

  

torch.cuda.get_sync_debug_mode

  

  

torch.cuda.init

torch_npu.npu.init

  

torch.cuda.ipc_collect

  

  

torch.cuda.is_available

torch_npu.npu.is_available

  

torch.cuda.is_initialized

torch_npu.npu.is_initialized

  

torch.cuda.memory_usage

  

  

torch.cuda.set_device

torch_npu.npu.set_device

  

torch.cuda.set_stream

torch_npu.npu.set_stream

  

torch.cuda.set_sync_debug_mode

  

  

torch.cuda.stream

  

  

torch.cuda.synchronize

torch_npu.npu.synchronize

  

torch.cuda.utilization

torch_npu.npu.utilization

  

torch.cuda.get_rng_state

torch_npu.npu.get_rng_state

  

torch.cuda.get_rng_state_all

torch_npu.npu.get_rng_state_all

  

torch.cuda.set_rng_state

        

torch.cuda.set_rng_state_all

        

torch.cuda.manual_seed

torch_npu.npu.manual_seed

  

torch.cuda.manual_seed_all

torch_npu.npu.manual_seed_all

  

torch.cuda.seed

torch_npu.npu.seed

  

torch.cuda.seed_all

torch_npu.npu.seed_all

  

torch.cuda.initial_seed

torch_npu.npu.initial_seed

  

torch.cuda.comm.broadcast

  

  

torch.cuda.comm.broadcast_coalesced

  

  

torch.cuda.comm.reduce_add

  

  

torch.cuda.comm.scatter

  

  

torch.cuda.comm.gather

  

  

torch.cuda.Stream

torch_npu.npu.Stream

  

torch.cuda.Stream.query

  

  

torch.cuda.Stream.record_event

torch_npu.npu.Stream.record_event

  

torch.cuda.Stream.synchronize

torch_npu.npu.Stream.synchronize

  

torch.cuda.Stream.wait_event

  

  

torch.cuda.Stream.wait_stream

torch_npu.npu.Stream.wait_stream

  

torch.cuda.ExternalStream

  

  

torch.cuda.ExternalStream.query

  

  

torch.cuda.ExternalStream.record_event

  

  

torch.cuda.ExternalStream.synchronize

  

  

torch.cuda.ExternalStream.wait_event

  

  

torch.cuda.ExternalStream.wait_stream

  

  

torch.cuda.Event

torch_npu.npu.Event

  

torch.cuda.Event.elapsed_time

torch_npu.npu.Event.elapsed_time

  

torch.cuda.Event.from_ipc_handle

  

  

torch.cuda.Event.ipc_handle

  

  

torch.cuda.Event.query

torch_npu.npu.Event.query

  

torch.cuda.Event.record

torch_npu.npu.Event.record

  

torch.cuda.Event.synchronize

  

  

torch.cuda.Event.wait

torch_npu.npu.Event.wait

  

torch.cuda.is_current_stream_capturing

  

  

torch.cuda.graph_pool_handle

  

  

torch.cuda.CUDAGraph

  

  

torch.cuda.CUDAGraph.capture_begin

  

  

torch.cuda.CUDAGraph.capture_end

  

  

torch.cuda.CUDAGraph.debug_dump

  

  

torch.cuda.CUDAGraph.enable_debug_mode

  

  

torch.cuda.CUDAGraph.pool

  

  

torch.cuda.CUDAGraph.replay

  

  

torch.cuda.CUDAGraph.reset

  

  

torch.cuda.graph

  

  

torch.cuda.make_graphed_callables

  

  

torch.cuda.empty_cache

torch_npu.npu.empty_cache

  

torch.cuda.list_gpu_processes

  

  

torch.cuda.mem_get_info

  

  

torch.cuda.memory_stats

torch_npu.npu.memory_stats

  

torch.cuda.memory_stats_as_nested_dict

torch_npu.npu.memory_stats_as_nested_dict

     

torch.cuda..reset_accumulated_memory_stats

torch_npu.npu.reset_accumulated_memory_stats

     

torch.cuda.memory_summary

torch_npu.npu.memory_summary

  

torch.cuda.memory_snapshot

torch_npu.npu.memory_snapshot

  

torch.cuda.memory_allocated

torch_npu.npu.memory_allocated

  

torch.cuda.max_memory_allocated

torch_npu.npu.max_memory_allocated

  

torch.cuda.reset_max_memory_allocated

torch_npu.npu.reset_max_memory_allocated

  

torch.cuda.memory_reserved

torch_npu.npu.memory_reserved

  

torch.cuda.max_memory_reserved

torch_npu.npu.max_memory_reserved

  

torch.cuda.set_per_process_memory_fraction

torch_npu.npu.set_per_process_memory_fraction

  

torch.cuda.memory_cached

torch_npu.npu.memory_cached

  

torch.cuda.max_memory_cached

torch_npu.npu.max_memory_cached

  

torch.cuda.reset_max_memory_cached

torch_npu.npu.reset_max_memory_cached

  

torch.cuda.reset_peak_memory_stats

torch_npu.npu.reset_peak_memory_stats

  

torch.cuda.caching_allocator_alloc

torch_npu.npu.caching_allocator_alloc

  

torch.cuda.caching_allocator_delete

torch_npu.npu.caching_allocator_delete

  

torch.cuda.get_allocator_backend

  

  

torch.cuda.CUDAPluggableAllocator

  

  

torch.cuda.change_current_allocator

  

  

torch.cuda.nvtx.mark

  

  

torch.cuda.nvtx.range_push

  

  

torch.cuda.nvtx.range_pop

  

  

torch.cuda.jiterator._create_jit_fn

  

  

torch.cuda.jiterator._create_multi_output_jit_fn

  

  

torch.cuda._sanitizer.enable_cuda_sanitizer