# Unsloth AMD PyTorch Synthetic Data Hackathon

Sobald Sie Zugriff auf eine MI300-Maschine haben, sehen Sie eine Jupyter-Notebook-Oberfläche:

<figure><img src="/files/8b553f98ab123e3d0e1c31327cc253c2b9863ae8" alt=""><figcaption></figcaption></figure>

**Aktualisieren Sie zuerst Unsloth** und bestätigen Sie, dass alles wie erwartet funktioniert - klicken Sie auf **Terminal**

<figure><img src="/files/cc55ddde915d770aff10bcd9816fd29d9882d280" alt=""><figcaption></figcaption></figure>

Führen Sie dann Folgendes im **Terminal** aus, um Unsloth zu aktualisieren - stellen Sie sicher, dass die Version **2025.10.5** oder höher ist.

```
pip install --upgrade -qqq --no-cache-dir --force-reinstall --no-deps unsloth unsloth_zoo
python -c "import unsloth; print(unsloth.__version__)"
```

<figure><img src="/files/08d6a8095efc9bd5a799db106485da99da7a6fd1" alt=""><figcaption></figcaption></figure>

Um ein neues Notebook oder Terminal zu erstellen, klicken Sie auf die PLUS-Schaltfläche

<figure><img src="/files/c578ee00b2f38332eea22d5c0c17a888bb803a81" alt=""><figcaption></figcaption></figure>

{% hint style="success" %}
**Öffnen Sie die README.ipynb-Datei, um Anweisungen und Bewertungskriterien zu lesen**
{% endhint %}

### :butterfly:TUTORIAL 1: Bestätigen, dass Unsloth funktioniert

Bestätigen Sie, dass unser einfaches Llama 3.2 1B / 3B Konversations-Notebook in einem neuen **Terminal**.

{% code overflow="wrap" %}

```bash
wget "https://raw.githubusercontent.com/unslothai/notebooks/refs/heads/main/python_scripts/Llama3.2_(1B_and_3B)-Conversational.py" -O llama_basic.py
python llama_basic.py
```

{% endcode %}

Sie sollten Folgendes sehen (es dauert etwa 2 Minuten). Wenn etwas fehlschlägt, versuchen Sie zuerst, Unsloth über

{% code overflow="wrap" %}

```bash
pip install --upgrade -qqq --no-cache-dir --force-reinstall --no-deps unsloth unsloth_zoo
python -c "import unsloth; print(unsloth.__version__)"
```

{% endcode %}

<figure><img src="/files/89d64c6c3d479d91f4516fce542ff6272d76219a" alt=""><figcaption></figcaption></figure>

<figure><img src="/files/6746694ec91c31b6b6cf7897a16c961a8c141edd" alt=""><figcaption></figcaption></figure>

### :sloth:TUTORIAL 2: Ausführen der synthetischen Datengenerierung

{% hint style="success" %}
**Sie können auch das tutorial.ipynb ausführen, das sofort auf unserer Maschine vorhanden sein sollte, ohne unten nachzusehen:**
{% endhint %}

Versuchen wir jetzt das Beispiel unter <https://github.com/edamamez/Unsloth-AMD-Fine-Tuning-Synthetic-Data> und auch <https://www.amd.com/en/developer/resources/technical-articles/2025/10x-model-fine-tuning-using-synthetic-data-with-unsloth.html>

Erstellen Sie zuerst ein neues **Terminal** nochmals - die PLUS-Schaltfläche ermöglicht ein neues **Terminal**.

<figure><img src="/files/cc55ddde915d770aff10bcd9816fd29d9882d280" alt=""><figcaption></figcaption></figure>

Starten Sie vLLM, um Llama 3.3 70B Instruct in einem neuen **Terminal** (verwenden Sie die PLUS-Schaltfläche für ein neues Terminal)

{% code overflow="wrap" %}

```
vllm serve Unsloth/Llama-3.3-70B-Instruct --port 8001 --max-model-len 48000 --gpu-memory-utilization 0.85
```

{% endcode %}

Sie werden sehen:

<figure><img src="/files/edfcd6265621d04f709fcb8da919b95bb93698cb" alt=""><figcaption></figcaption></figure>

Warten Sie, bis Sie `INFO: Application startup complete.` sehen, und klicken Sie dann auf die PLUS-Schaltfläche, um einen neuen Tab zu öffnen

<figure><img src="/files/12354192d92cc280e94fb2f7eb2392778960faf0" alt=""><figcaption></figcaption></figure>

Installieren Sie **synthetic-data-kit** <https://github.com/meta-llama/synthetic-data-kit> in einem neuen **Terminal** Fenster.

```
pip install --upgrade synthetic-data-kit
```

<figure><img src="/files/a936757821a9048a6586e7b7fd9c06f8fe26c8e5" alt=""><figcaption></figcaption></figure>

Holen Sie `config.yaml` entweder von <https://raw.githubusercontent.com/edamamez/Unsloth-AMD-Fine-Tuning-Synthetic-Data/refs/heads/main/config.yaml>oder unten:

{% file src="/files/f710f04c9c9fb691f24680958fa041d2d4078b69" %}

{% code overflow="wrap" %}

```bash
wget https://raw.githubusercontent.com/edamamez/Unsloth-AMD-Fine-Tuning-Synthetic-Data/refs/heads/main/config.yaml -O config.yaml
```

{% endcode %}

Prüfen Sie, ob das synthetic data kit funktioniert hat. Wenn Sie Fehler sehen, bestätigen Sie, dass vLLM in der ersten Zelle ausgeführt wird.

{% code overflow="wrap" %}

```bash
synthetic-data-kit -c config.yaml system-check
```

{% endcode %}

<figure><img src="/files/f8cfde4fc3bc608d37a2cfb9f13e27174a5faf62" alt=""><figcaption></figcaption></figure>

Holen Sie nun einige Dateien, die wir für die Verarbeitung verwenden werden:

{% code overflow="wrap" %}

```bash
# Erstellen Sie die Repositories, in denen wir das PDF verwenden und die Beispiele speichern werden
mkdir -p logical_reasoning/{sources,data/{input,parsed,generated,curated,final}}

wget -P logical_reasoning/sources/ -q --show-progress "https://www.csus.edu/indiv/d/dowdenb/4/logical-reasoning-archives/logical-reasoning-2017-12-02.pdf"   "https://people.cs.umass.edu/~pthomas/solutions/Liar_Truth.pdf"

cp logical_reasoning/sources/* logical_reasoning/data/input/
cp config.yaml logical_reasoning
```

{% endcode %}

<figure><img src="/files/79b25bc26a46b7d44262d0c145cfda6cba535cf8" alt=""><figcaption></figcaption></figure>

Lassen Sie uns jetzt die Daten einlesen und verarbeiten:

{% code overflow="wrap" %}

```bash
cd logical_reasoning
synthetic-data-kit ingest ./data/input/ --verbose
```

{% endcode %}

Erstellen Sie nun entweder Q\&A (Frage- & Antwortpaare) oder CoT (Chain-of-Thought)-Paare (das kann 3 Minuten dauern)

{% code overflow="wrap" %}

```bash
synthetic-data-kit -c ../config.yaml create ./data/parsed/ --type qa --num-pairs 15 --verbose

##### ODER #####

synthetic-data-kit -c ../config.yaml create ./data/parsed/ --type cot --num-pairs 15 --verbose
```

{% endcode %}

<figure><img src="/files/1259d6dee4268c236eb3890797b64a2bd78356a9" alt=""><figcaption></figcaption></figure>

Bitten wir nun ein LLM, die Daten zu kuratieren und rufen das LLM als Richter auf, um weniger wünschenswerte synthetische Datensätze zu entfernen, und speichern dann die Ausgabe - es kann 3 Minuten dauern

{% code overflow="wrap" %}

```bash
synthetic-data-kit -c ../config.yaml curate ./data/generated/ --threshold 7.0 --verbose

synthetic-data-kit save-as ./data/curated/ --format ft --verbose
```

{% endcode %}

<figure><img src="/files/664a86aae4051f79bfb6ba0baf9ed6cd7b63a7cf" alt=""><figcaption></figcaption></figure>

Noch einmal, <mark style="background-color:purple;">**FAHREN SIE den vLLM-Dienst herunter, um VRAM zu sparen!!! Gehen Sie zum vorherigen Tab und drücken Sie CTRL+C 3 Mal. Oder sehen Sie**</mark> [#how-do-i-free-amd-gpu-memory](#how-do-i-free-amd-gpu-memory "mention")

Holen Sie sich jetzt das Notebook, das wir unter <https://github.com/unslothai/notebooks/blob/main/nb/Synthetic_Data_Hackathon.ipynb>:

{% code overflow="wrap" %}

```bash
ausführen werden
```

{% endcode %}

{% hint style="info" %}
wget "<https://github.com/unslothai/notebooks/raw/refs/heads/main/nb/Synthetic\\_Data\\_Hackathon.ipynb>" -O "Synthetic\_Data\_Hackathon.ipynb" [#how-do-i-free-amd-gpu-memory](#how-do-i-free-amd-gpu-memory "mention")
{% endhint %}

Wenn Sie Out-of-Memory-Fehler erhalten, fahren Sie Ihre vLLM-Instanz herunter - siehe

<figure><img src="/files/82a1f295bafd0509c5bd0345e75018c500280d4d" alt=""><figcaption></figcaption></figure>

Klicken Sie auf die linke Ordner-Schaltfläche und öffnen Sie "Synthetic\_Data\_Hackathon.ipynb" (Doppelklick)

<figure><img src="/files/d84b1293b5d4b42e6eccafd852d24259a449293a" alt=""><figcaption></figcaption></figure>

Führen Sie dann alle Zellen aus!

<figure><img src="/files/a7b807d3200c303f101bf7e0f5611fecdfc86e85" alt=""><figcaption></figcaption></figure>

Siehe [Sie sehen in der Mitte des Notebooks:](https://github.com/edamamez/Unsloth-AMD-Fine-Tuning-Synthetic-Data/blob/main/tutorial.ipynb) <https://github.com/edamamez/Unsloth-AMD-Fine-Tuning-Synthetic-Data/blob/main/tutorial.ipynb>

### :dolphin:für weitere Details

TUTORIAL 3: GPT-OSS Reinforcement Learning Auto Kernel Erstellung

Sie können dies als Notebook oder als Python-Skript ausführen! [Python-Skript:](https://github.com/unslothai/notebooks/blob/main/python_scripts/gpt_oss_\(20B\)_GRPO_BF16.py)

<https://github.com/unslothai/notebooks/blob/main/python\\_scripts/gpt\\_oss\\_(20B)\\_GRPO\\_BF16.py> [Notebook:](https://github.com/unslothai/notebooks/blob/main/nb/gpt_oss_\(20B\)_GRPO_BF16.ipynb)

{% code overflow="wrap" %}

```bash
https://github.com/unslothai/notebooks/blob/main/nb/gpt_oss_(20B)_GRPO_BF16.ipynb
```

{% endcode %}

wget "<https://raw.githubusercontent.com/unslothai/notebooks/refs/heads/main/nb/gpt\\_oss\\_(20B)\\_GRPO\\_BF16.ipynb>" -O "Auto\_Kernels\_RL.ipynb"

<figure><img src="/files/eba360bf964f04760062f99587fba69f54dd663d" alt=""><figcaption></figcaption></figure>

Öffnen Sie dann wie in Tutorial 2 die Datei "Auto\_Kernels\_RL.ipynb" und starten Sie neu und führen Sie alles aus!

<figure><img src="/files/4aac00b5d1c3a238148b78733641b092169eea15" alt=""><figcaption></figcaption></figure>

### :diamonds:Wenn Sie es ausführen und nach unten scrollen, sehen Sie das 2048-Spiel, das mittels automatisch generierter Strategien durch RL ausgeführt wird:

TUTORIAL 3: GPT-OSS Reinforcement Learning Auto Kernel Erstellung

Sie können dies als Notebook oder als Python-Skript ausführen! [Python-Skript:](https://github.com/unslothai/notebooks/blob/main/python_scripts/gpt_oss_\(20B\)_GRPO_BF16.py)

<https://github.com/unslothai/notebooks/blob/main/python\\_scripts/gpt\\_oss\\_(20B)\\_GRPO\\_BF16.py> <https://github.com/unslothai/notebooks/blob/main/nb/gpt_oss_(20B)_Reinforcement_Learning_2048_Game_BF16.ipynb>

{% code overflow="wrap" %}

```bash
TUTORIAL 4: GPT-OSS Reinforcement Learning 2048-Spiel
```

{% endcode %}

wget "<https://github.com/unslothai/notebooks/raw/refs/heads/main/nb/gpt\\_oss\\_(20B)\\_Reinforcement\\_Learning\\_2048\\_Game\\_BF16.ipynb>" -O "RL\_2048\_Game.ipynb"

<figure><img src="/files/be2e6d0593e371a0afcd8ba1a57e27a2a818c249" alt=""><figcaption></figcaption></figure>

Öffnen Sie dann wie in Tutorial 3 die Datei "Auto\_Kernels\_RL.ipynb" und starten Sie neu und führen Sie alles aus!

<figure><img src="/files/d8540258159bda417c12691e970b202bad4df286" alt=""><figcaption></figcaption></figure>

### :sunflower:Wenn Sie nach unten scrollen, sehen Sie, wie der RL-Algorithmus automatisch Strategien erstellt, um 2048 zu gewinnen!

Optimale vLLM-Befehle auf AMD [#updating-vllm-to-the-latest-on-amd](#updating-vllm-to-the-latest-on-amd "mention")

Um Modelle auf AMD-GPUs bereitzustellen, verwenden Sie bitte die folgenden Befehle, die die Leistung steigern. Bestätigen Sie, dass aiter und flash-attention installiert sind, oder siehe

```bash
Für MI300X, MI325X und Radeon-GPUs:
export VLLM_ROCM_USE_AITER=1
# VLLM_USE_AITER_UNIFIED_ATTENTION funktioniert nur, wenn Flash Attention installiert ist
export VLLM_USE_AITER_UNIFIED_ATTENTION=0
export VLLM_ROCM_USE_AITER_MHA=0
  vllm serve unsloth/gpt-oss-20b \
  --no-enable-prefix-caching \
```

\--compilation-config '{"full\_cuda\_graph": true}'

```bash
Für MI300X, MI325X und Radeon-GPUs:
export VLLM_ROCM_USE_AITER=1
# VLLM_USE_AITER_UNIFIED_ATTENTION funktioniert nur, wenn Flash Attention installiert ist
export VLLM_USE_AITER_UNIFIED_ATTENTION=0
Für MI355X führen Sie Folgendes aus:
export VLLM_USE_AITER_TRITON_FUSED_SPLIT_QKV_ROPE=1
export VLLM_USE_AITER_TRITON_FUSED_ADD_RMSNORM_PAD=1
export TRITON_HIP_PRESHUFFLE_SCALES=1
 
export VLLM_USE_AITER_TRITON_GEMM=1
vllm serve unsloth/gpt-oss-20b \
vllm serve unsloth/gpt-oss-120b \
--compilation-config '{"compile_sizes": [1, 2, 4, 8, 16, 24, 32, 64, 128, 256, 4096, 8192], "full_cuda_graph": true}' \
```

## :tools:--block-size 64

### :free:<mark style="background-color:purple;">Fehlerbehebung und FAQs</mark>

Wie kann ich AMD-GPU-Speicher freigeben? **Terminal** `Wenn Sie sich in einem Docker-Image (wie beim Hackathon) befinden, führen Sie das Folgende in einem neuen` rocm-smi -d 0 --showpids

```bash
aus, wenn Sie auf einer lokalen Maschine sind
# Listet lokale PIDs auf, die /dev/kfd oder /dev/dri/render* geöffnet haben
  for p in /proc/[0-9]*; do
  readlink -f "$p/fd"/* 2>/dev/null | grep -qE '/dev/(kfd|dri/render)' || continue
  cmd=$(tr -d '\0' < "$p/cmdline" 2>/dev/null | sed 's/ \+/ /g')
printf "%-8s %s\n" "${p##*/}" "${cmd:-[unknown]}"
```

done | sort -n `Wenn Sie sich in einem Docker-Image (wie beim Hackathon) befinden, führen Sie das Folgende in einem neuen` Wenn Sie auf einer lokalen Maschine sind, tun Sie einfach `und führen Sie aus` sudo kill -9 XXXX `wobei` XXXX

<figure><img src="/files/e9877f411a6929e56db4841f947198ccc353f338" alt=""><figcaption></figcaption></figure>

die PID ist, die für den spezifischen Prozess aufgeführt ist, der den meisten VRAM verwendet.

<figure><img src="/files/b3bb573881b74f968a19e254e5e32e53e96012d0" alt=""><figcaption></figcaption></figure>

Für das Docker-Image wie beim Hackathon sehen Sie nach Ausführen der ersten Zelle möglicherweise etwas wie unten: `und führen Sie aus` sudo kill -9 XXXX `wobei` Suchen Sie dann nach dem Prozess, der den VRAM verwendet (z. B. vLLM), und geben Sie ein

<figure><img src="/files/123945673b6cc52bbc41b04058b4805ce88d7acb" alt=""><figcaption></figcaption></figure>

die PID wird in der linken Spalte wie unten aufgeführt: `Wenn Sie sich in einem Docker-Image (wie beim Hackathon) befinden, führen Sie das Folgende in einem neuen` Bestätigen Sie, dass der gesamte GPU-Speicher über

<figure><img src="/files/9d98d9f68b496c0585297dbc75f018200db63af4" alt=""><figcaption></figcaption></figure>

freigegeben ist. Zum Beispiel zeigt das Folgende 0 Speichernutzung:

<figure><img src="/files/8988387612be3f633a939e13606c235c6c43dd19" alt=""><figcaption></figcaption></figure>

### :pencil:<mark style="background-color:purple;">Wenn Sie dagegen Folgendes sehen, führen Sie die erste Docker-Zelle erneut aus, um den Prozess erneut zu beenden.</mark>

Bitte siehe [#how-do-i-free-amd-gpu-memory](#how-do-i-free-amd-gpu-memory "mention") torch.OutOfMemoryError: HIP out of memory RuntimeError: Engine process failed to start.

um zu prüfen, ob Ihre GPU Speicher von einem anderen Prozess verwendet, und versuchen Sie, diesen Prozess zu beenden, der Speicher verwendet. `Versuchen Sie auch` amd-smi process --gpu 0

<figure><img src="/files/9574007a07e75ecd3ccffa62014ffff40455c4e6" alt=""><figcaption></figcaption></figure>

### :arrow\_forward:<mark style="background-color:purple;">um alle Prozesse und die VRAM-Nutzung aller Prozesse aufzulisten, die die GPU verwenden:</mark>

Keine Plattform für vLLM erkannt, vLLM aktualisieren, gpt-oss auf vLLM `Wenn Sie ausführen` vllm serve Unsloth/gpt-oss-20b `verwenden Sie möglicherweise eine ältere vLLM-Version.` python -c "import vllm; print(vllm.\_\_version\_\_)"

um die vLLM-Version zu erhalten. `0.7.4` Im vorgefertigten Hackathon-Docker erhalten Sie `vllm serve Unsloth/Llama-3.3-70B-Instruct --port 8001 --max-model-len 48000 --gpu-memory-utilization 0.85`

<figure><img src="/files/96e3e72ce5c34bb23b37e9e92c2f8aec293c3ab6" alt=""><figcaption></figcaption></figure>

### :cupcake:<mark style="background-color:purple;">, das leider neuere Modelle wie GPT-OSS nicht unterstützt, jedoch funktionieren andere Modelle wie</mark>

{% hint style="warning" %}
**vLLM auf AMD aktualisieren** [**GPT-OSS kann nach dem Erstellen aus dem Quellcode derzeit noch nicht in vLLM ausgeführt werden - sehen Sie vorerst**](https://rocm.blogs.amd.com/ecosystems-and-partners/openai-day-0/README.html) **<https://rocm.blogs.amd.com/ecosystems-and-partners/openai-day-0/README.html>**

{% code overflow="wrap" %}

```
für Docker-Ausführung von gpt-oss - der Hackathon kann leider kein Docker innerhalb von Docker verwenden. Möglicherweise erhalten Sie den Fehler:
ImportError: cannot import name 'GFX950MXScaleLayout' from 'triton_kernels.tensor_details.layout' (/usr/local/lib/python3.12/dist-packages/triton_kernels/tensor_details/layout.py)
```

{% endcode %}
{% endhint %}

(EngineCore\_DP0 pid=44662) Process EngineCore\_DP0: [Um die neueste vLLM-Version zu erhalten, siehe bitte](https://docs.vllm.ai/en/latest/getting_started/installation/gpu.html#install-specific-revisions)<https://docs.vllm.ai/en/latest/getting\\_started/installation/gpu.html#install-specific-revisions> [#how-do-i-free-amd-gpu-memory](#how-do-i-free-amd-gpu-memory "mention")

{% code overflow="wrap" %}

```bash
, führen Sie speziell das Folgende aus, nachdem Sie alle Prozesse beendet haben, die die AMD-GPU verwenden via
# Installieren Sie PyTorch
pip uninstall torch -y
pip uninstall pytorch-triton-rocm -y
pip uninstall triton -y

pip install --upgrade torch==2.8.0 pytorch-triton-rocm torchvision torchaudio torchao==0.13.0 xformers --index-url https://download.pytorch.org/whl/rocm6.4
# Installieren Sie OpenAI Triton-Kernels
```

{% endcode %}

pip install git+<https://github.com/triton-lang/triton.git@05b2c186c1b6c9a08375389d5efe9cb4c401c075#subdirectory=python/triton\\_kernels> [#how-do-i-free-amd-gpu-memory](#how-do-i-free-amd-gpu-memory "mention"))

<figure><img src="/files/8a669920265e25c2cd329edccaf0a695537a0849" alt=""><figcaption></figcaption></figure>

<figure><img src="/files/20d5938799406d17c1332ad2b8a3491793ad4f3f" alt=""><figcaption></figcaption></figure>

<details>

<summary><mark style="background-color:red;"><strong>Die Ausführung des Vorherigen wird dies bewirken (Erinnerung: Fahren Sie zuerst alle Prozesse herunter, die die GPU verwenden! Siehe</strong></mark> (OPTIONAL ausklappbarer Code) <mark style="background-color:green;"><strong>Um</strong></mark> Flash Attention zu bauen<strong>über (</strong>dies wird 30 Minuten bis 1 Stunde dauern <mark style="background-color:green;"><strong>) Dies ist also optional, wenn Sie nicht 30 Minuten bis 1 Stunde warten möchten!</strong></mark> Ich würde diesen Prozess im Allgemeinen überspringen.</summary>

{% code overflow="wrap" %}

```bash
Erweitern Sie diese Zelle, wenn Sie Flash Attention installieren möchten.
Erweitern Sie diese Zelle, wenn Sie Flash Attention installieren möchten.
# ********OPTIONAL********* Sie müssen möglicherweise 1 Stunde warten!!
git clone https://github.com/Dao-AILab/flash-attention.git
cd flash-attention
git checkout 1a7f4dfa

Erweitern Sie diese Zelle, wenn Sie Flash Attention installieren möchten.
Erweitern Sie diese Zelle, wenn Sie Flash Attention installieren möchten.
git submodule update --init
ARCH=$(rocminfo | grep -m1 -oE 'gfx[0-9]+[a-z]*')
echo "Erkannte GPU-Arch: $ARCH"
GPU_ARCHS="$ARCH" python3 setup.py install
Erweitern Sie diese Zelle, wenn Sie Flash Attention installieren möchten.
```

{% endcode %}

Sie werden sehen:

<figure><img src="/files/c57f09c0a6a79d5b69113c24da3ed242b50856ba" alt=""><figcaption></figcaption></figure>

cd ..

<figure><img src="/files/a856d9c968d179e27ce171204639fa18bb052058" alt=""><figcaption></figcaption></figure>

</details>

<mark style="background-color:red;">**Um den Fortschritt von Flash-Attention zu überwachen (was sehr lange dauern kann), achten Sie auf den \[296/2206]-Fortschritt.**</mark> (NICHT OPTIONAL) [Bauen Sie dann aiter](https://github.com/ROCm/aiter) AI Tensor Engine für ROCm

{% code overflow="wrap" %}

```bash
(dies dauert etwa 5 Minuten)
python3 -m pip uninstall -y aiter
git clone --recursive https://github.com/ROCm/aiter.git
cd aiter
git checkout $AITER_BRANCH_OR_COMMIT
git submodule sync; git submodule update --init --recursive
GPU_ARCHS="$ARCH" python3 setup.py install
```

{% endcode %}

<mark style="background-color:red;">**Um den Fortschritt von Flash-Attention zu überwachen (was sehr lange dauern kann), achten Sie auf den \[296/2206]-Fortschritt.**</mark> python3 setup.py develop

```bash
Bauen Sie dann vLLM:
pip install --upgrade pip
pip install --upgrade -qqq --no-cache-dir --force-reinstall --no-deps unsloth unsloth_zoo
pip uninstall vllm -y
pip install "unsloth[amd] @ git+https://github.com/unslothai/unsloth"

pip uninstall bitsandbytes -y
# Build & install AMD SMI

pip install /opt/rocm/share/amd_smi
# Installieren Sie Abhängigkeiten
    pip install --upgrade numba \
    scipy \
    huggingface-hub[cli,hf_transfer] \

setuptools_scm
git clone --depth 1 --branch "v0.11.0" https://github.com/vllm-project/vllm.git vllm_build
cd vllm_build

pip install -r requirements/rocm.txt
# Build vLLM für MI210/MI250/MI300.
git submodule sync; git submodule update --init --recursive
GPU_ARCHS="$ARCH" python3 setup.py install
```

export PYTORCH\_ROCM\_ARCH="$(rocminfo | grep -m1 -oE 'gfx\[0-9]+\[a-z]\*')"**Sie werden Folgendes sehen (**)

<figure><img src="/files/1fd8050672208f30ddc4eaca3bff108d06d8f3f1" alt=""><figcaption></figcaption></figure>

<figure><img src="/files/c0ecd88684c9a7be49a1db438058531ff2815441" alt=""><figcaption></figcaption></figure>

bitte warten Sie 5 bis 10 Minuten!

{% code overflow="wrap" %}

```bash
Bestätigen Sie, dass vLLM und torch aktualisiert wurden via
python -c "import vllm, torch, unsloth; print(vllm.__version__); print(torch.__version__); print(unsloth.__version__);"
```

{% endcode %}

vllm `python -c "import vllm, torch, unsloth; print(vllm.__version__); print(torch.__version__); print(unsloth.__version__);"` was anzeigen sollte, dass vLLM 0.11.0 oder höher ist, und torch MUSS ab Oktober 2025 Version 2.8.0 sein. Der Befehl

```
um zu bestätigen, dass vLLM wie erwartet funktioniert.
0.11.0
🦥 Unsloth Zoo wird jetzt alles patchen, um das Training zu beschleunigen!
2025.10.6
```

<figure><img src="/files/5b117e8b8cd1ab43a4158437423ae855e4b69c49" alt=""><figcaption></figcaption></figure>

### :book:2.8.0+rocm6.4

{% hint style="warning" %}
**vLLM auf AMD aktualisieren** [**GPT-OSS kann nach dem Erstellen aus dem Quellcode derzeit noch nicht in vLLM ausgeführt werden - sehen Sie vorerst**](https://rocm.blogs.amd.com/ecosystems-and-partners/openai-day-0/README.html) **<https://rocm.blogs.amd.com/ecosystems-and-partners/openai-day-0/README.html>**

{% code overflow="wrap" %}

```
für Docker-Ausführung von gpt-oss - der Hackathon kann leider kein Docker innerhalb von Docker verwenden. Möglicherweise erhalten Sie den Fehler:
ImportError: cannot import name 'GFX950MXScaleLayout' from 'triton_kernels.tensor_details.layout' (/usr/local/lib/python3.12/dist-packages/triton_kernels/tensor_details/layout.py)
```

{% endcode %}
{% endhint %}

Ausführen von unsloth/gpt-oss-20b in vLLM [#updating-vllm-to-the-latest-on-amd](#updating-vllm-to-the-latest-on-amd "mention")Nach dem Aktualisieren von vLLM via [gpt-oss-20b](https://huggingface.co/unsloth/gpt-oss-20b)können Sie ausführen [#optimal-vllm-commands-on-amd](#optimal-vllm-commands-on-amd "mention") ! Siehe

{% code overflow="wrap" %}

```bash
Für MI300X, MI325X und Radeon-GPUs:
export VLLM_USE_AITER_UNIFIED_ATTENTION=0
export VLLM_ROCM_USE_AITER_MHA=0
  vllm serve unsloth/gpt-oss-20b \
  für bessere optimale Befehle zum Ausführen von vllm auf AMD-GPUs (Sie könnten eine schnellere Inferenz erhalten!)
  --port 8001 \
  --compilation-config '{"full_cuda_graph": true}' \
  --max-model-len 48000 \
```

{% endcode %}

### :interrobang:--gpu-memory-utilization 0.85

<figure><img src="/files/79e6560a7e99adbcb255f95243c21d87625d8d86" alt=""><figcaption></figcaption></figure>

**RuntimeError: User specified an unsupported autocast device\_type 'hip'** Bitte aktualisieren Sie Unsloth! [#updating-unsloth](#updating-unsloth "mention")

### :bug:Siehe unten

<figure><img src="/files/d448d726a926c3b243d44dbf4733a9bf4f5353e4" alt=""><figcaption></figcaption></figure>

### :new:NotImplementedError: Unsloth derzeit ok

**Aktualisieren Sie zuerst Unsloth** und bestätigen Sie, dass alles wie erwartet funktioniert - klicken Sie auf **Terminal**

<figure><img src="/files/cc55ddde915d770aff10bcd9816fd29d9882d280" alt=""><figcaption></figcaption></figure>

Führen Sie dann Folgendes im **Terminal** Unsloth aktualisieren **um Unsloth zu aktualisieren -**

```
pip install --upgrade -qqq --no-cache-dir --force-reinstall --no-deps unsloth unsloth_zoo
pip uninstall vllm -y
pip install "unsloth[amd] @ git+https://github.com/unslothai/unsloth"
python -c "import unsloth; print(unsloth.__version__)"
```

**stellen Sie sicher, dass die Version 2025.10.5 oder höher ist.**

<figure><img src="/files/0c2acffc315e78fff69038f7077514ae249fdd2d" alt=""><figcaption></figcaption></figure>

### :interrobang:Sie müssen auch die Laufzeit NEU STARTEN

terminate called after throwing an instance of 'std::logic\_error' what() `Bitte verifizieren Sie, dass Sie auf`torch==2.8.0

{% code overflow="wrap" %}

```bash
pip uninstall triton -y
```

{% endcode %}

<figure><img src="/files/5cd1c7d526a8adf86659499361802b129de4c143" alt=""><figcaption></figcaption></figure>

### :question:sind. Führen Sie erneut aus:

System wurde nicht gebootet, Verbindung zum Bus fehlgeschlagen

```
Sie könnten Folgendes sehen:
root@270fa7fa9157:/jupyter-tutorial/AIAC_129_212_183_103/assets# reboot
System wurde nicht mit systemd als Init-System (PID 1) gebootet. Kann nicht ausgeführt werden.
Verbindung zum Bus fehlgeschlagen: Host ist ausgefallen
```

Fehler bei der Kommunikation mit dem Init-Daemon.

### :bug:Bitte kontaktieren Sie uns, damit wir die Maschine neu starten können!

Konfiguriertes ROCm-Binary nicht gefunden - get\_native\_library()

{% code overflow="wrap" %}

```
Dies weist darauf hin, dass bitsandbytes nicht korrekt installiert ist, wie unten:
  Traceback (most recent call last):
    File "/usr/local/lib/python3.12/dist-packages/bitsandbytes/cextension.py", line 313, in <module>
          ^^^^^^^^^^^^^^^^^^^^
  lib = get_native_library()
    File "/usr/local/lib/python3.12/dist-packages/bitsandbytes/cextension.py", line 282, in get_native_library
raise RuntimeError(f"Configured {BNB_BACKEND} binary not found at {cuda_binary_path}")
```

{% endcode %}

Bitte siehe [#updating-unsloth](#updating-unsloth "mention")RuntimeError: Configured ROCm binary not found at /usr/local/lib/python3.12/dist-packages/bitsandbytes/libbitsandbytes\_rocm64.so

### :exclamation:um bitsandbytes und Unsloth zu aktualisieren!

NotImplementedError: Cannot copy out of meta tensor; no data! [#how-do-i-free-amd-gpu-memory](#how-do-i-free-amd-gpu-memory "mention") Dies bedeutet, dass Sie keinen Speicher mehr haben. Siehe

{% code overflow="wrap" %}

```
--------------------------------------------------------------------------
zum Freigeben von GPU-Speicher.
NotImplementedError                       Traceback (most recent call last)
      Cell In[18], line 8
      5     tokenizer.pad_token_id = tokenizer.eos_token_id
7 # Trainer mit ROCm-freundlichen Einstellungen und ordnungsgemäßer Datenverarbeitung einrichten
      ----> 8 trainer = SFTTrainer(
...
9     model=model,
    --> 235 lm_head_bad = lm_head_bad.cpu().float().numpy().round(3)
    236 from collections import Counter

um bitsandbytes und Unsloth zu aktualisieren!
```

{% endcode %}

### :thought\_balloon:Fehler beim Importieren von vllm.\_C mit ModuleNotFoundError("No module named 'vllm.\_C'")

Bitte installieren Sie vLLM neu. Verwenden Sie `vllm_build` als Ordner, in den Sie per git klonen, und nicht `python -c "import vllm, torch, unsloth; print(vllm.__version__); print(torch.__version__); print(unsloth.__version__);"`. [#updating-vllm-to-the-latest-on-amd](#updating-vllm-to-the-latest-on-amd "mention")

### :hushed:ModuleNotFoundError: No module named 'vllm'

Bitte führen Sie nicht aus `rm -rf vllm_build` den Ordner, den Sie gebaut haben. Oder installieren Sie vllm neu via [#updating-vllm-to-the-latest-on-amd](#updating-vllm-to-the-latest-on-amd "mention")

### :ledger:ipykernel>6.30.1 bricht Fortschrittsbalken.

Wenn Sie Folgendes sehen:

{% code overflow="wrap" %}

```
🦥 Unsloth: Wird Ihren Computer patchen, um 2x schnellere Free-Finetuning zu ermöglichen.
#### Unsloth: `hf_xet==1.1.10` und `ipykernel>6.30.1` brechen Fortschrittsbalken. Vorübergehend in XET deaktiviert.
#### Unsloth: Um Fortschrittsbalken wieder zu aktivieren, downgraden Sie bitte auf `ipykernel==6.30.1` oder warten Sie auf einen Fix für
https://github.com/huggingface/xet-core/issues/526
```

{% endcode %}

Ignorieren Sie es vorerst - Sie werden nur keine Fortschrittsbalken beim Herunterladen und Hochladen von Modellen sehen.

### :bug:AssertionError: No MXFP4 MoE backend

Wenn Sie gpt-oss-20b ausführen und dies während vLLM sehen, installieren Sie vLLM bitte erneut via [#updating-vllm-to-the-latest-on-amd](#updating-vllm-to-the-latest-on-amd "mention")

### :head\_bandage:NotImplementedError: Could not run \`aten::empty\_strided\`

<figure><img src="/files/df38f726177becbd1ae7a106df505c493448ca85" alt=""><figcaption></figcaption></figure>

Bitte verwenden Sie `.to("cuda")` und nicht `.to("hip")` Aktualisieren Sie außerdem Unsloth [#updating-unsloth](#updating-unsloth "mention")

### :bug:NotImplementedError: Could not run 'aten::empty.memory\_format'

Bitte siehe [#updating-unsloth](#updating-unsloth "mention")RuntimeError: Configured ROCm binary not found at /usr/local/lib/python3.12/dist-packages/bitsandbytes/libbitsandbytes\_rocm64.so


---

# Agent Instructions: Querying This Documentation

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

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://unsloth.ai/docs/de/blog/unsloth-amd-pytorch-synthetic-data-hackathon.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
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.
