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

# Feinabstimmung von LLMs auf der NVIDIA DGX Station mit Unsloth

NVIDIA-DGX-Station-Tutorial zur Feinabstimmung mit Notebooks von Unsloth.

Sie können jetzt LLMs lokal auf Ihrer NVIDIA DGX Station mit [Unsloth](https://github.com/unslothai/unsloth). DGX Station verfügt über mehr als **\~200 GB VRAM** und über **700 GB einheitlichen GPU-/CPU-Speicher** und kombiniert eine Grace-CPU und eine Blackwell-GPU in einem eng verbundenen System, das für große KI-Workloads ausgelegt ist. Verbunden durch NVLink-C2C bleiben CPU und GPU zwar getrennt, arbeiten aber deutlich effizienter zusammen als in einem herkömmlichen CPU-GPU-Setup.

In diesem Leitfaden verwenden wir Unsloth-Notebooks zum Trainieren [Qwen3.5](#qwen3.5-35b-a3b-fine-tuning) und [gpt-oss-120b](#gpt-oss-120b-fine-tuning) auf der DGX Station. Vielen Dank an NVIDIA, dass sie uns frühe DGX-Station-Hardware zur Verfügung gestellt haben, um Unsloth darauf zu testen!

### Schnellstart

Sie benötigen `python3` installiert, und insbesondere werden die Dev-Header benötigt. Auf unserem System haben wir `python 3.12` also werden wir die Dev-Header für 3.12 installieren.

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

Erstellen Sie dann eine frische virtuelle Umgebung, um [Unsloth](https://github.com/unslothai/unsloth). Auf diese Weise minimieren wir Abhängigkeitskonflikte und bewahren den Zustand der aktuellen Arbeitsumgebung.&#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" %}
Zuerst installieren `torch` aus dem `CUDA 13` Index, sonst könnten wir die CPU-Version oder eine Nichtübereinstimmung bei Architektur und Fähigkeiten erhalten!
{% endhint %}

<div><figure><img src="https://797013937-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://797013937-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>

Jetzt können wir Unsloth installieren:

```bash
installieren.
```

<div><figure><img src="https://797013937-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://797013937-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>

Jetzt installieren wir `xformers` und optional bauen `flash-attention` aus dem Quellcode. Beide Pakete brauchen Zeit, also bitte etwas Geduld, während sie gebaut werden.

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

```bash
pip install --no-deps --no-build-isolation xformers==0.0.33.post1
# Optional flash-attn
# Klonen und bauen (zielt auf sm_100 für B300) 
git clone https://github.com/Dao-AILab/flash-attention
cd flash-attention 
# B300 = sm_100, Architektur explizit festlegen 
TORCH_CUDA_ARCH_LIST="10.0" MAX_JOBS=8 pip install . --no-build-isolation
cd ..
```

{% endcode %}

<div><figure><img src="https://797013937-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://797013937-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 %}
Für Qwen 3.5 MoE möchten wir zwei Kernel-Pakete herunterladen `flash-linear-attention` und `causal-conv1d` um es schnell zu machen.

{% 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://797013937-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 %}

Wenn Sie noch keinen Notebook-Client haben, installieren Sie einen. Für diesen Leitfaden verwenden wir Jupyter Notebook:

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

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

{% endcode %}

Schließlich laden wir die eigentlichen Unsloth-Notebooks zum Ausführen herunter. Es gibt über 250 Notebooks für das LLM-Training sowie Python-Skripte.

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

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

{% endcode %}

### Trainings-Tutorials

{% columns %}
{% column %}
Jetzt können wir Jupyter Notebook starten und im Browser zur Benutzeroberfläche navigieren.

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

```bash
jupyter notebook
```

{% endcode %}
{% endcolumn %}

{% column %}

<figure><img src="https://797013937-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 %}
Kopieren und fügen Sie die `localhost` Seite mit dem Token-Parameter ein und fügen Sie sie in Ihren Browser ein. Sie sollten etwas wie Folgendes sehen:

Der `nb` Ordner enthält alle Notebooks zum Ausführen.
{% endcolumn %}

{% column %}

<figure><img src="https://797013937-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 %}

#### Qwen3.5-35B-A3B-Training

{% columns %}
{% column %}
Öffnen Sie die Datei `nb/Qwen3_5_MoE.ipynb`. Überspringen Sie den Installationsabschnitt, da wir bereits alles installiert haben, was wir brauchen. Navigieren Sie zum Unsloth-Abschnitt und beginnen Sie dort mit der Ausführung der Zellen.

{% endcolumn %}

{% column %}

<figure><img src="https://797013937-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 %}
Das Notebook behandelt die Modellkonfiguration, die Vorbereitung des Datensatzes und die Trainer-Konfiguration. Jeder Schritt kann einige Zeit dauern, da wir ein sehr großes Modell herunterladen, Milliarden von Gewichten initialisieren und weiter optimieren, um es schnell laufen zu lassen.&#x20;
{% endcolumn %}

{% column %}

<figure><img src="https://797013937-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 %}

Das Training ist mit der Standardeinstellung sehr schnell. Auf der DGX Station gibt es reichlich Speicher, sodass Sie mit den Standard-Trainings-Hyperparametern experimentieren können, um Speicher und Rechenleistung wirklich auszulasten. Sobald das Training abgeschlossen ist, können Sie das Modell für die spätere Verwendung speichern, das Modell auf den Hugging Face Hub hochladen, um es mit anderen zu teilen, oder in ein quantisiertes Format exportieren.

#### gpt-oss-120b-Training

{% columns %}
{% column %}
Öffnen Sie die Datei `nb/gpt-oss-(120B)_A100-Fine-tuning.ipynb`. Überspringen Sie den Installationsabschnitt, da wir die Voraussetzungen bereits installiert haben, und navigieren Sie zum Unsloth-Abschnitt. Von dort aus können wir mit der Ausführung des Notebooks beginnen. Das Notebook wird etwa 72 GB GPU-Speicher verwenden und ungefähr 10 Minuten dauern.
{% endcolumn %}

{% column %}

<figure><img src="https://797013937-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 %}
Jede Zelle kann einige Zeit zur Ausführung benötigen, da wir das Modell herunterladen, die Gewichte initialisieren und weiter optimieren müssen, um eine schnelle Nutzung zu ermöglichen. Das Notebook durchläuft die Vorverarbeitung des Datensatzes und die Einrichtung des Trainers. Sobald wir bei der `trainer.train()` Zelle angekommen sind und sie ausführen, beginnt das Training.
{% endcolumn %}

{% column %}

<figure><img src="https://797013937-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 %}

Jetzt, da es abgeschlossen ist, können wir das Modell für die spätere Verwendung speichern, es auf den Hugging Face Hub hochladen, um es mit der Welt zu teilen, oder es in das GGUF-Format exportieren.

<figure><img src="https://797013937-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>

Lesen Sie mehr über NVIDIAs DGX Station unter <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/de/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.
