Shortcuts

MPSAccelerator

class lightning_fabric.accelerators.MPSAccelerator[source]

Bases: lightning_fabric.accelerators.accelerator.Accelerator

Accelerator for Metal Apple Silicon GPU 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]

MPS is only available for certain torch builds starting at torch>=1.12, and is only enabled on a machine with the ARM-based Apple Silicon processors.

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 MPS.

Return type:

None

teardown()[source]

Clean up any state created by the accelerator.

Return type:

None


© Copyright Copyright (c) 2018-2023, Lightning AI et al...

Built with Sphinx using a theme provided by Read the Docs.