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

# NVIDIA DGX Station で Unsloth を使って LLM をファインチューニングする

Unsloth のノートブックを使ってファインチューニングする方法を解説する NVIDIA DGX Station チュートリアル。

現在、NVIDIA DGX Station上でLLMをローカルにトレーニングできるようになりました。 [Unsloth](https://github.com/unslothai/unsloth)。DGX Stationには、 **約200GBのVRAM** と、 **700GBを超える統合GPU / CPUメモリ** を備えており、NVLink-C2Cで接続されたGrace CPUとBlackwell GPUを、緊密に連携したシステム内に組み合わせています。CPUとGPUは別個のままですが、従来のCPU-GPU構成よりはるかに効率的に連携して動作します。

このガイドでは、Unslothのノートブックを使ってトレーニングします [Qwen3.5](#qwen3.5-35b-a3b-fine-tuning) そして [gpt-oss-120b](#gpt-oss-120b-fine-tuning) 。Unslothの検証のために、早期アクセス用のDGX Stationハードウェアを提供してくれたNVIDIAに感謝します。

### クイックスタート

必要なもの `python3` がインストールされており、特にdevヘッダーが必要です。私たちのシステムでは `Python 3.12` があるので、3.12のdevヘッダーをインストールします。

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

次に、新しい仮想環境を作成して [Unsloth](https://github.com/unslothai/unsloth)をインストールします。これにより依存関係の競合を最小限に抑え、現在の作業環境の状態を維持できます。&#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" %}
まず `torch` の `CUDA 13` のインデックスをインストールします。そうしないと、CPU版になったり、アーキテクチャや機能に不一致が起きたりする可能性があります！
{% endhint %}

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

これでUnslothをインストールできます。

```bash
pip install unsloth
```

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

次に `xformers` をインストールし、必要に応じて `flash-attention` をソースからビルドします。どちらのパッケージも時間がかかるので、ビルドが終わるまでしばらくお待ちください。

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

```bash
pip install --no-deps --no-build-isolation xformers==0.0.33.post1
# 必要に応じて flash-attn
# クローンしてビルドする（B300向けにsm_100をターゲット） 
git clone https://github.com/Dao-AILab/flash-attention
cd flash-attention 
# B300 = sm_100、アーキテクチャを明示的に設定 
TORCH_CUDA_ARCH_LIST="10.0" MAX_JOBS=8 pip install . --no-build-isolation
cd ..
```

{% endcode %}

<div><figure><img src="https://735611837-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://735611837-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 %}
Qwen 3.5 MoEでは、2つのカーネルパッケージをダウンロードする必要があります `flash-linear-attention` そして `causal-conv1d` を使って高速化します。

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

まだノートブッククライアントを持っていない場合は、インストールしてください。このガイドではJupyter Notebookを使用します：

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

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

{% endcode %}

最後に、実際に実行するUnslothのノートブックをダウンロードします。LLMトレーニング用の250以上のノートブックとPythonスクリプトがあります。

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

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

{% endcode %}

### トレーニングチュートリアル

{% columns %}
{% column %}
これでJupyter Notebookを起動し、ブラウザでUIに移動できます。

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

```bash
jupyter notebook
```

{% endcode %}
{% endcolumn %}

{% column %}

<figure><img src="https://735611837-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 %}
以下をコピーして貼り付けてください `localhost` トークンパラメータ付きのサイトをブラウザに貼り付けます。次のようなものが表示されるはずです：

その `nb` フォルダには、実行するすべてのノートブックがあります。
{% endcolumn %}

{% column %}

<figure><img src="https://735611837-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トレーニング

{% columns %}
{% column %}
ファイルを開いてください `nb/Qwen3_5_MoE.ipynb`。インストールのセクションは、必要なものはすでに事前にすべてインストール済みなので飛ばしてください。Unslothのセクションに移動し、そこからセルの実行を開始します。

{% endcolumn %}

{% column %}

<figure><img src="https://735611837-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 %}
このノートブックでは、モデル設定、データセット準備、トレーナー設定を扱います。非常に大きなモデルをダウンロードし、数十億の重みを初期化し、さらに高速化するために最適化するので、各ステップにはある程度時間がかかることがあります。&#x20;
{% endcolumn %}

{% column %}

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

デフォルト設定ではトレーニングは非常に高速です。DGX Stationには十分なメモリがあるので、デフォルトのトレーニングハイパーパラメータを試して、メモリと計算性能を実際に使い切ることができます。完了したら、後で使うためにモデルを保存したり、他の人と共有するためにHugging Face Hubへプッシュしたり、量子化形式へエクスポートしたりできます。

#### gpt-oss-120b トレーニング

{% columns %}
{% column %}
ファイルを開いてください `nb/gpt-oss-(120B)_A100-Fine-tuning.ipynb`。必要な前提条件はすでにインストール済みなのでインストールのセクションは飛ばし、Unslothのセクションに移動してください。そこからノートブックの実行を開始できます。ノートブックは約72 GBのGPUメモリを使用し、約10分かかります。
{% endcolumn %}

{% column %}

<figure><img src="https://735611837-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 %}
モデルのダウンロード、重みの初期化、そして高速な体験のためのさらなる最適化が必要なので、各セルの実行には多少時間がかかることがあります。ノートブックでは、データセットの前処理とトレーナー設定を行います。 `trainer.train()` セルに到達して実行すると、トレーニングが始まります。
{% endcolumn %}

{% column %}

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

完了したので、後で使うためにモデルを保存したり、Hugging Face Hubへプッシュして世界と共有したり、GGUF形式へエクスポートしたりできます。

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

NVIDIAのDGX Stationについて詳しくは <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/jp/burogu/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.
