MPSAccelerator

class lightning.fabric.accelerators.MPSAccelerator

Bases: Accelerator

Accelerator for Metal Apple Silicon GPU devices.

Warning

Use of this accelerator beyond import and instantiation is experimental.

static auto_device_count()

Get the devices when set to auto.

Return type:

int

static get_parallel_devices(devices)

Gets parallel devices for the Accelerator.

Return type:

list[device]

static is_available()

MPS is only available on a machine with the ARM-based Apple Silicon processors.

Return type:

bool

static name()

The name of the accelerator.

Return type:

str

static parse_devices(devices)

Accelerator device parsing logic.

Return type:

Optional[list[int]]

classmethod register_accelerators(accelerator_registry)

Register the accelerator with the registry.

Return type:

None

setup_device(device)
Raises:

ValueError – If the selected device is not MPS.

Return type:

None

teardown()

Clean up any state created by the accelerator.

Return type:

None

Was this page helpful?

What went wrong?

↑↓ Navigate↵ Open⌘↵ New tabesc Close