---
title: Accelerator
description: The Accelerator base class.
canonical: >-
  https://lightning.ai/docs/fabric/stable/full-api-reference/api/generated/lightning.fabric.accelerators.Accelerator
---
# Accelerator {#accelerator}

### `class lightning.fabric.accelerators.Accelerator` {#lightning.fabric.accelerators.Accelerator}

Bases: [`ABC`](https://docs.python.org/3/library/abc.html#abc.ABC "(in Python v3.15)")

The Accelerator base class.

An Accelerator is meant to deal with one type of hardware.

Warning

Writing your own accelerator is an [experimental](/docs/pytorch/stable/versioning#experimental-api "(in PyTorch Lightning v2.7.0.dev)") feature.

#### `abstract static auto_device_count()` {#lightning.fabric.accelerators.Accelerator.auto_device_count}

Get the device count when set to auto.

Return type:

[`int`](https://docs.python.org/3/builtins/functions.html#int "(in Python v3.15)")

#### `abstract static get_parallel_devices(devices)` {#lightning.fabric.accelerators.Accelerator.get_parallel_devices}

Gets parallel devices for the Accelerator.

Return type:

[`Any`](https://docs.python.org/3/library/typing.html#typing.Any "(in Python v3.15)")

#### `abstract static is_available()` {#lightning.fabric.accelerators.Accelerator.is_available}

Detect if the hardware is available.

Return type:

[`bool`](https://docs.python.org/3/builtins/functions.html#bool "(in Python v3.15)")

#### `abstract static name()` {#lightning.fabric.accelerators.Accelerator.name}

The name of the accelerator.

Return type:

[`str`](https://docs.python.org/3/builtins/stdtypes.html#str "(in Python v3.15)")

#### `abstract static parse_devices(devices)` {#lightning.fabric.accelerators.Accelerator.parse_devices}

Accelerator device parsing logic.

Return type:

[`Any`](https://docs.python.org/3/library/typing.html#typing.Any "(in Python v3.15)")

#### `classmethod register_accelerators(accelerator_registry)` {#lightning.fabric.accelerators.Accelerator.register_accelerators}

Register the accelerator with the registry.

Return type:

[`None`](https://docs.python.org/3/builtins/constants.html#None "(in Python v3.15)")

#### `abstract setup_device(device)` {#lightning.fabric.accelerators.Accelerator.setup_device}

Create and prepare the device for the current process.

Return type:

[`None`](https://docs.python.org/3/builtins/constants.html#None "(in Python v3.15)")

#### `abstract teardown()` {#lightning.fabric.accelerators.Accelerator.teardown}

Clean up any state created by the accelerator.

Return type:

[`None`](https://docs.python.org/3/builtins/constants.html#None "(in Python v3.15)")

---

**Navigation**

- Parent: [Generated](/docs/fabric/2.6.6/full-api-reference/api/generated.md)
