mirror of
https://github.com/huggingface/lerobot.git
synced 2026-05-20 11:09:59 +00:00
Add a documentation page with a brief intro to hw backends (#2385)
This commit is contained in:
committed by
GitHub
parent
56b43cc888
commit
d79dd6d31f
@@ -92,6 +92,10 @@
|
|||||||
- local: phone_teleop
|
- local: phone_teleop
|
||||||
title: Phone
|
title: Phone
|
||||||
title: "Teleoperators"
|
title: "Teleoperators"
|
||||||
|
- sections:
|
||||||
|
- local: torch_accelerators
|
||||||
|
title: PyTorch accelerators
|
||||||
|
title: "Supported Hardware"
|
||||||
- sections:
|
- sections:
|
||||||
- local: notebooks
|
- local: notebooks
|
||||||
title: Notebooks
|
title: Notebooks
|
||||||
|
|||||||
@@ -0,0 +1,42 @@
|
|||||||
|
# PyTorch accelerators
|
||||||
|
|
||||||
|
LeRobot supports multiple hardware acceleration options for both training and inference.
|
||||||
|
|
||||||
|
These options include:
|
||||||
|
|
||||||
|
- **CPU**: CPU executes all computations, no dedicated accelerator is used
|
||||||
|
- **CUDA**: acceleration with NVIDIA & AMD GPUs
|
||||||
|
- **MPS**: acceleration with Apple Silicon GPUs
|
||||||
|
- **XPU**: acceleration with Intel integrated and discrete GPUs
|
||||||
|
|
||||||
|
## Getting Started
|
||||||
|
|
||||||
|
To use particular accelerator, a suitable version of PyTorch should be installed.
|
||||||
|
|
||||||
|
For CPU, CUDA, and MPS backends follow instructions provided on [PyTorch installation page](https://pytorch.org/get-started/locally).
|
||||||
|
For XPU backend, follow instructions from [PyTorch documentation](https://docs.pytorch.org/docs/stable/notes/get_start_xpu.html).
|
||||||
|
|
||||||
|
### Verifying the installation
|
||||||
|
|
||||||
|
After installation, accelerator availability can be verified by running
|
||||||
|
|
||||||
|
```python
|
||||||
|
import torch
|
||||||
|
print(torch.<backend_name>.is_available()) # <backend_name> is cuda, mps, or xpu
|
||||||
|
```
|
||||||
|
|
||||||
|
## How to run training or evaluation
|
||||||
|
|
||||||
|
To select the desired accelerator, use the `--policy.device` flag when running `lerobot-train` or `lerobot-eval`. For example, to use MPS on Apple Silicon, run:
|
||||||
|
|
||||||
|
```bash
|
||||||
|
lerobot-train
|
||||||
|
--policy.device=mps ...
|
||||||
|
```
|
||||||
|
|
||||||
|
```bash
|
||||||
|
lerobot-eval \
|
||||||
|
--policy.device=mps ...
|
||||||
|
```
|
||||||
|
|
||||||
|
However, in most cases, presence of an accelerator is detected automatically and `policy.device` parameter can be omitted from CLI commands.
|
||||||
Reference in New Issue
Block a user