> For the complete documentation index, see [llms.txt](https://unsloth.ai/docs/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://unsloth.ai/docs/fr/notions-de-base/multi-gpu-training-with-unsloth.md).

# Fine-tuning multi-GPU avec Unsloth

Découvrez comment fine-tuner des LLM sur plusieurs GPU et utiliser le parallélisme avec Unsloth.

Unsloth prend actuellement en charge les configurations multi-GPU via des bibliothèques comme Accelerate et DeepSpeed. Cela signifie que vous pouvez déjà exploiter des méthodes de parallélisme telles que **FSDP** et **DDP** avec Unsloth.

#### **Consultez notre nouveau guide Distributed Data Parallel** [**(DDP) multi-GPU ici**](/docs/fr/notions-de-base/multi-gpu-training-with-unsloth/ddp.md)**.**

Nous savons que le processus peut être complexe et nécessite une configuration manuelle. Nous travaillons d’arrache-pied pour rendre la prise en charge multi-GPU beaucoup plus simple et plus conviviale, et nous annoncerons bientôt la prise en charge officielle du multi-GPU pour Unsloth.

Pour le moment, vous pouvez utiliser notre [cahier Kaggle Magistral-2509](/docs/fr/modeles/tutorials/magistral-how-to-run-and-fine-tune.md#fine-tuning-magistral-with-unsloth) comme exemple, qui utilise Unsloth multi-GPU pour faire tenir le modèle de 24B paramètres, ou notre [guide DDP](/docs/fr/notions-de-base/multi-gpu-training-with-unsloth/ddp.md).

**En attendant**, pour activer le multi-GPU pour DDP, procédez comme suit :

1. Créez votre script d’entraînement sous la forme `train.py` (ou similaire). Par exemple, vous pouvez utiliser l’un de nos [scripts d’entraînement](https://github.com/unslothai/notebooks/tree/main/python_scripts) créés à partir de nos différents notebooks !
2. Exécuter `accelerate launch train.py` ou `torchrun --nproc_per_node N_GPUS train.py` où `N_GPUS` est le nombre de GPU dont vous disposez.

#### **Chargement par découpage du pipeline / du modèle**

Si vous n’avez pas assez de VRAM sur 1 GPU pour charger, disons, Llama 70B, pas d’inquiétude — nous découperons le modèle pour vous sur chaque GPU ! Pour activer cela, utilisez le `device_map = "balanced"` option :

```python
from unsloth import FastLanguageModel
model, tokenizer = FastLanguageModel.from_pretrained(
    "unsloth/Llama-3.3-70B-Instruct",
    load_in_4bit = True,
    device_map = "balanced",
)
```

**Restez à l’écoute pour notre annonce officielle !**\
Pour plus de détails, consultez notre [Pull Request](https://github.com/unslothai/unsloth/issues/2435) qui discute de la prise en charge multi-GPU.


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation by asking a question.

Perform an HTTP GET request on the following URL with the `ask` and `goal` query parameters:

```
GET https://unsloth.ai/docs/fr/notions-de-base/multi-gpu-training-with-unsloth.md?ask=<question>&goal=<user_goal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is what the user is ultimately trying to achieve, the reason they need the answer. Sharing it helps GitBook give you a better, more relevant answer. A goal is most helpful when it describes the outcome the user wants rather than restating the question. For example, with `ask=how do I create an API token`, a goal like `automate deployments from our CI pipeline` lets GitBook tailor the answer to that use case.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
