CUDAAccelerator

class lightning.fabric.accelerators.CUDAAccelerator[source]

Bases: Accelerator

Accelerator for NVIDIA CUDA devices.

static auto_device_count()[source]

Get the devices when set to auto.

Return type:

int

static get_parallel_devices(devices)[source]

Gets parallel devices for the Accelerator.

Return type:

list[device]

static is_available()[source]

Detect if the hardware is available.

Return type:

bool

static parse_devices(devices)[source]

Accelerator device parsing logic.

Return type:

Optional[list[int]]

setup_device(device)[source]
Raises:

ValueError – If the selected device is not of type CUDA.

Return type:

None

teardown()[source]

Clean up any state created by the accelerator.

Return type:

None