Shortcuts

CUDAAccelerator

class lightning.pytorch.accelerators.CUDAAccelerator[소스]

기반 클래스: lightning.pytorch.accelerators.accelerator.Accelerator

Accelerator for NVIDIA CUDA devices.

static auto_device_count()[소스]

Get the devices when set to auto.

반환 형식

int

get_device_stats(device)[소스]

Gets stats for the given GPU device.

매개변수

device (Union[device, str, int]) – GPU device for which to get stats

반환 형식

Dict[str, Any]

반환

A dictionary mapping the metrics to their values.

예외 발생

FileNotFoundError – If nvidia-smi installation not found

static get_parallel_devices(devices)[소스]

Gets parallel devices for the Accelerator.

반환 형식

List[device]

static is_available()[소스]

Detect if the hardware is available.

반환 형식

bool

static parse_devices(devices)[소스]

Accelerator device parsing logic.

반환 형식

Optional[List[int]]

setup(trainer)[소스]

Setup plugins for the trainer fit and creates optimizers.

매개변수

trainer (Trainer) – the trainer instance

반환 형식

None

setup_device(device)[소스]
예외 발생

MisconfigurationException – If the selected device is not GPU.

반환 형식

None

teardown()[소스]

Clean up any state created by the accelerator.

반환 형식

None