> 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/blog/dgx-station.md).

# Fine-tuning des LLM sur NVIDIA DGX Station avec Unsloth

Tutoriel NVIDIA DGX Station sur la manière de fine-tuner à l'aide des notebooks d'Unsloth.

Vous pouvez maintenant entraîner localement des LLM sur votre NVIDIA DGX Station avec [Unsloth](https://github.com/unslothai/unsloth). La DGX Station dispose de plus de **\~200 Go de VRAM** et plus de **700 Go de mémoire unifiée GPU / CPU** et combine un CPU Grace et un GPU Blackwell dans un système étroitement connecté, conçu pour les charges de travail IA à grande échelle. Reliés par NVLink-C2C, le CPU et le GPU restent distincts mais travaillent ensemble beaucoup plus efficacement que dans une configuration CPU-GPU traditionnelle.

Dans ce guide, nous utiliserons les notebooks Unsloth pour entraîner [Qwen3.5](#qwen3.5-35b-a3b-fine-tuning) et [gpt-oss-120b](#gpt-oss-120b-fine-tuning) sur la DGX Station. Merci à NVIDIA d'avoir fourni du matériel DGX Station en accès anticipé pour tester Unsloth !

### Démarrage rapide

Vous aurez besoin de `python3` installé, et en particulier les en-têtes de développement sont nécessaires. Sur notre système, nous avons `python 3.12` nous allons donc installer les en-têtes de développement pour 3.12.

```bash
sudo apt update
sudo apt install python3.12-dev
```

Créez ensuite un nouvel environnement virtuel pour installer [Unsloth](https://github.com/unslothai/unsloth). De cette façon, nous minimisons les conflits de dépendances et préservons l'état de l'environnement de travail actuel.&#x20;

{% code overflow="wrap" %}

```bash
python3 -m venv .unsloth
source .unsloth/bin/activate
pip install torch torchvision torchaudio --index-url https://download.pytorch.org/whl/cu130
```

{% endcode %}

{% hint style="warning" %}
Installez d'abord `torch` du `CUDA 13` index, sinon nous pourrions obtenir la version CPU ou une incompatibilité d'architecture et de capacités !
{% endhint %}

<div><figure><img src="https://550366147-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FxhOjnexMCB3dmuQFQ2Zq%2Fuploads%2Fw04Su0JZriUaQxD31wf0%2Funknown.png?alt=media&amp;token=83e61cdb-74c3-42c4-a1ff-18cec3752c9e" alt=""><figcaption></figcaption></figure> <figure><img src="https://550366147-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FxhOjnexMCB3dmuQFQ2Zq%2Fuploads%2F9bs6h6YxI2hqnqOz1bU0%2Funknown.png?alt=media&amp;token=e3e261b5-be18-4d49-9f38-526012add332" alt=""><figcaption></figcaption></figure></div>

Nous pouvons maintenant installer Unsloth :

```bash
pip install unsloth
```

<div><figure><img src="https://550366147-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FxhOjnexMCB3dmuQFQ2Zq%2Fuploads%2FhQZznPQ8O9Wh3At6FclO%2Funknown.png?alt=media&amp;token=34c8de6e-bef8-414c-8e1b-2913589c4b10" alt=""><figcaption></figcaption></figure> <figure><img src="https://550366147-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FxhOjnexMCB3dmuQFQ2Zq%2Fuploads%2FdLZCFmln5LaUWtO6eC4A%2Funknown.png?alt=media&amp;token=ce04e025-32c7-4847-ac35-bee1baf6259f" alt=""><figcaption></figcaption></figure></div>

Installons maintenant `xformers` et éventuellement compiler `flash-attention` à partir des sources. Les deux paquets prennent du temps, alors soyez patient pendant leur compilation.

{% code overflow="wrap" expandable="true" %}

```bash
pip install --no-deps --no-build-isolation xformers==0.0.33.post1
# Facultativement flash-attn
# Cloner et compiler (cible sm_100 pour B300) 
git clone https://github.com/Dao-AILab/flash-attention
cd flash-attention 
# B300 = sm_100, définir explicitement l'architecture 
TORCH_CUDA_ARCH_LIST="10.0" MAX_JOBS=8 pip install . --no-build-isolation
cd ..
```

{% endcode %}

<div><figure><img src="https://550366147-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FxhOjnexMCB3dmuQFQ2Zq%2Fuploads%2FnyczIn3YvXAPx5oIfZQQ%2Funknown.png?alt=media&amp;token=1a2c5f7b-13c5-4f5e-b4c4-61df8d5fc653" alt=""><figcaption></figcaption></figure> <figure><img src="https://550366147-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FxhOjnexMCB3dmuQFQ2Zq%2Fuploads%2FoupUFzx2pOG6l5B91Pw4%2Funknown.png?alt=media&amp;token=009d2c73-5992-4593-8fd0-e7d813eda3ff" alt=""><figcaption></figcaption></figure></div>

{% columns %}
{% column %}
Pour Qwen 3.5 MoE, nous allons vouloir télécharger deux paquets de noyaux `flash-linear-attention` et `causal-conv1d` pour le rendre rapide.

{% code overflow="wrap" expandable="true" %}

```bash
pip install --no-build-isolation flash-linear-attention causal_conv1d==1.6.0
```

{% endcode %}
{% endcolumn %}

{% column %}

<figure><img src="https://550366147-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FxhOjnexMCB3dmuQFQ2Zq%2Fuploads%2F4xEY8k3jzxfOgMWAgJD7%2Funknown.png?alt=media&amp;token=2b8bd62e-23cd-4bcf-a0af-6d161d1ec1a1" alt="" width="375"><figcaption></figcaption></figure>
{% endcolumn %}
{% endcolumns %}

Si vous n'avez pas déjà un client notebook, installez-en un. Pour ce guide, nous utiliserons Jupyter Notebook :

{% code overflow="wrap" expandable="true" %}

```bash
cd ..
pip install notebook
pip install ipywidgets
```

{% endcode %}

Enfin, nous téléchargeons les vrais notebooks Unsloth à exécuter. Il existe plus de 250 notebooks pour l'entraînement de LLM ainsi que des scripts Python.

{% code overflow="wrap" expandable="true" %}

```bash
git clone https://github.com/unslothai/notebooks.git
cd notebooks
```

{% endcode %}

### Tutoriels d'entraînement

{% columns %}
{% column %}
Nous pouvons maintenant lancer Jupyter Notebook et accéder à l'interface dans un navigateur.

{% code overflow="wrap" expandable="true" %}

```bash
jupyter notebook
```

{% endcode %}
{% endcolumn %}

{% column %}

<figure><img src="https://550366147-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FxhOjnexMCB3dmuQFQ2Zq%2Fuploads%2FP2seywdWvLHHQkdP8DGy%2Funknown.png?alt=media&amp;token=ca1b5390-5eb8-416b-a3e9-d9df9b27fb0b" alt="" width="375"><figcaption></figcaption></figure>
{% endcolumn %}
{% endcolumns %}

{% columns %}
{% column %}
Copiez et collez le `localhost` site avec le paramètre token et collez-le dans votre navigateur. Vous devriez voir quelque chose comme :

Le `nb` Le dossier contient tous les notebooks à exécuter.
{% endcolumn %}

{% column %}

<figure><img src="https://550366147-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FxhOjnexMCB3dmuQFQ2Zq%2Fuploads%2FSxN976oDM4WaG5EtpSc9%2Funknown.png?alt=media&amp;token=7113ba12-5bcc-4bc6-9777-b9d4c440d0bf" alt="" width="375"><figcaption></figcaption></figure>
{% endcolumn %}
{% endcolumns %}

#### Entraînement de Qwen3.5-35B-A3B

{% columns %}
{% column %}
Ouvrez le fichier `nb/Qwen3_5_MoE.ipynb`. Passez la section d'installation puisque nous avons déjà installé tout ce dont nous avons besoin auparavant. Accédez à la section Unsloth et commencez à exécuter les cellules à partir de là.

{% endcolumn %}

{% column %}

<figure><img src="https://550366147-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FxhOjnexMCB3dmuQFQ2Zq%2Fuploads%2Fif8mAvc1au9Hl83IZzNm%2FDGX%20Station.png?alt=media&amp;token=1011c8a9-c6ba-48df-a726-d3bc3bc8e947" alt=""><figcaption></figcaption></figure>
{% endcolumn %}
{% endcolumns %}

{% columns %}
{% column %}
Le notebook couvre la configuration du modèle, la préparation du jeu de données et la configuration de l'entraîneur. Chaque étape peut prendre un certain temps, car nous téléchargeons un très grand modèle, initialisons des milliards de poids, puis optimisons davantage pour le faire fonctionner rapidement.&#x20;
{% endcolumn %}

{% column %}

<figure><img src="https://550366147-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FxhOjnexMCB3dmuQFQ2Zq%2Fuploads%2F4v0NmHdhiYCHFll8U8OD%2Funknown.png?alt=media&amp;token=69e3d279-4d59-4439-802f-11bd02fe39d3" alt="" width="375"><figcaption></figcaption></figure>
{% endcolumn %}
{% endcolumns %}

L'entraînement est très rapide avec les paramètres par défaut. Sur la DGX Station, il y a largement assez de mémoire, vous pouvez donc jouer avec les hyperparamètres d'entraînement par défaut pour vraiment mettre à l'épreuve la mémoire et le calcul. Une fois l'entraînement terminé, vous pouvez enregistrer le modèle pour une utilisation ultérieure, pousser le modèle vers Hugging Face Hub pour le partager avec d'autres, ou l'exporter vers un format quantifié.

#### Entraînement de gpt-oss-120b

{% columns %}
{% column %}
Ouvrez le fichier `nb/gpt-oss-(120B)_A100-Fine-tuning.ipynb`. Passez la section d'installation puisque nous avons déjà installé les prérequis et accédez à la section Unsloth. Nous pouvons commencer à exécuter le notebook à partir de là. Le notebook utilisera environ 72 Go de mémoire GPU et prendra environ 10 minutes.
{% endcolumn %}

{% column %}

<figure><img src="https://550366147-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FxhOjnexMCB3dmuQFQ2Zq%2Fuploads%2F8jYYievlemxDJBatevNV%2FDGX%20Station%202.png?alt=media&amp;token=efef1a26-a170-4690-972f-1a7cde67e9ea" alt=""><figcaption></figcaption></figure>
{% endcolumn %}
{% endcolumns %}

{% columns %}
{% column %}
Chaque cellule peut prendre un certain temps à s'exécuter, car nous devons télécharger le modèle, initialiser les poids et optimiser davantage pour offrir une expérience rapide. Le notebook passe par le prétraitement du jeu de données et la configuration de l'entraîneur. Une fois que nous arrivons à la `trainer.train()` cellule, l'entraînement commence.
{% endcolumn %}

{% column %}

<figure><img src="https://550366147-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FxhOjnexMCB3dmuQFQ2Zq%2Fuploads%2FOxuma3ZZeEbxZrAWIgnq%2FDGX%20Station%203.png?alt=media&amp;token=17beb84e-eb56-4357-aee2-078c4db3eb84" alt=""><figcaption></figcaption></figure>
{% endcolumn %}
{% endcolumns %}

Maintenant que c'est terminé, nous pouvons enregistrer le modèle pour une utilisation ultérieure, le pousser vers Hugging Face Hub pour le partager avec le monde, ou l'exporter au format GGUF.

<figure><img src="https://550366147-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FxhOjnexMCB3dmuQFQ2Zq%2Fuploads%2Fy1UxtQ01avFK5BIkofwt%2Fimage.png?alt=media&amp;token=8d137818-a3a6-4d00-a9fd-1e41ed0483a5" alt=""><figcaption></figcaption></figure>

En savoir plus sur la DGX Station de NVIDIA à <https://www.nvidia.com/en-us/products/workstations/dgx-station/>


---

# 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/blog/dgx-station.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.
