fastvideo.v1.platforms.cuda#

Code inside this file can safely assume cuda platform, e.g. importing pynvml. However, it should not initialize cuda context.

Module Contents#

Classes#

Functions#

Data#

API#

fastvideo.v1.platforms.cuda.CudaPlatform[source]#

None

class fastvideo.v1.platforms.cuda.CudaPlatformBase[source]#

Bases: fastvideo.v1.platforms.interface.Platform

device_control_env_var: str[source]#

‘CUDA_VISIBLE_DEVICES’

device_name: str[source]#

‘cuda’

device_type: str[source]#

‘cuda’

dispatch_key: str[source]#

‘CUDA’

classmethod get_attn_backend_cls(selected_backend: Optional[fastvideo.v1.platforms.interface.AttentionBackendEnum], head_size: int, dtype: torch.dtype) str[source]#
classmethod get_current_memory_usage(device: Optional[torch.types.Device] = None) float[source]#
abstract classmethod get_device_capability(device_id: int = 0) Optional[fastvideo.v1.platforms.interface.DeviceCapability][source]#
classmethod get_device_communicator_cls() str[source]#
abstract classmethod get_device_name(device_id: int = 0) str[source]#
abstract classmethod get_device_total_memory(device_id: int = 0) int[source]#
classmethod is_async_output_supported(enforce_eager: Optional[bool]) bool[source]#
classmethod log_warnings() None[source]#
class fastvideo.v1.platforms.cuda.NonNvmlCudaPlatform[source]#

Bases: fastvideo.v1.platforms.cuda.CudaPlatformBase

classmethod get_device_capability(device_id: int = 0) fastvideo.v1.platforms.interface.DeviceCapability[source]#
classmethod get_device_name(device_id: int = 0) str[source]#
classmethod get_device_total_memory(device_id: int = 0) int[source]#
class fastvideo.v1.platforms.cuda.NvmlCudaPlatform[source]#

Bases: fastvideo.v1.platforms.cuda.CudaPlatformBase

classmethod get_device_capability(device_id: int = 0) Optional[fastvideo.v1.platforms.interface.DeviceCapability][source]#
classmethod get_device_name(device_id: int = 0) str[source]#
classmethod get_device_total_memory(device_id: int = 0) int[source]#
classmethod get_device_uuid(device_id: int = 0) str[source]#
classmethod has_device_capability(capability: Union[Tuple[int, int], int], device_id: int = 0) bool[source]#

query if the set of gpus are fully connected by nvlink (1 hop)

classmethod log_warnings() None[source]#
fastvideo.v1.platforms.cuda.device_id_to_physical_device_id(device_id: int) int[source]#
fastvideo.v1.platforms.cuda.logger[source]#

‘init_logger(…)’

fastvideo.v1.platforms.cuda.nvml_available[source]#

False

fastvideo.v1.platforms.cuda.pynvml[source]#

‘import_pynvml(…)’

fastvideo.v1.platforms.cuda.with_nvml_context(fn: Callable[fastvideo.v1.platforms.cuda._P, fastvideo.v1.platforms.cuda._R]) Callable[fastvideo.v1.platforms.cuda._P, fastvideo.v1.platforms.cuda._R][source]#