ml.utils.device.metal

MPS device support for Metal GPUs (i.e., Apple Silicon).

ml.utils.device.metal.get_env_bool(key: str) bool[source]
class ml.utils.device.metal.metal_device[source]

Bases: base_device

Mixin to support Metal training.

classmethod has_device() bool[source]

Detects whether or not the device is available.

Returns:

If the device is available

get_torch_compile_backend() str | Callable[source]

Returns the backend to use for Torch compile.

Returns:

The backend