> 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/fine-tuning-llms-with-blackwell-rtx-50-series-and-unsloth.md).

# Blackwell、RTX 50シリーズ、そしてUnslothでLLMをファインチューニングする

Unsloth は現在、NVIDIA の Blackwell アーキテクチャ GPU をサポートしています。これには、RTX 50 シリーズ GPU（5060〜5090）、RTX PRO 6000、そして B200、B40、GB100、GB102 などの GPU が含まれます！公式の [NVIDIA のブログ記事はこちら](https://developer.nvidia.com/blog/train-an-llm-on-an-nvidia-blackwell-desktop-with-unsloth-and-scale-it/).

Unsloth は現在、2018 年以降のすべての NVIDIA GPU と互換性があります。 [DGX Spark](/docs/jp/burogu/fine-tuning-llms-with-nvidia-dgx-spark-and-unsloth.md).

> **新しい** [**Docker イメージ**](#docker) **は Blackwell をサポートしています。Docker イメージを実行して、トレーニングを始めましょう！** [**ガイド**](/docs/jp/burogu/fine-tuning-llms-with-blackwell-rtx-50-series-and-unsloth.md)

### Pip インストール

Unsloth をそのままインストールしてください：

```bash
pip install unsloth
```

問題が見られる場合は、別の分離された環境を作成する方法もあります：

```bash
python -m venv unsloth
source unsloth/bin/activate
pip install unsloth
```

なお、これは `pip3` または `pip3.13` である場合もあり、同様に `python3` または `python3.13`

Xformers にいくつか問題が発生することがあります。その場合は、ソースからビルドしてください：

{% code overflow="wrap" %}

```bash
# まず、以前のライブラリによってインストールされた xformers をアンインストールします
pip uninstall xformers -y

# クローンしてビルド
pip install ninja
export TORCH_CUDA_ARCH_LIST="12.0"
git clone --depth=1 https://github.com/facebookresearch/xformers --recursive
cd xformers && python setup.py install && cd ..
```

{% endcode %}

### Docker

[**`unsloth/unsloth`**](https://hub.docker.com/r/unsloth/unsloth) は Unsloth の唯一の Docker イメージです。Blackwell および 50 シリーズ GPU では、この同じイメージを使用してください。別のイメージは不要です。

インストール手順については、こちらの [Unsloth Docker ガイド](/docs/jp/burogu/how-to-fine-tune-llms-with-unsloth-and-docker.md).

### uv

```bash
uv pip install unsloth
```

#### uv（上級者向け）

インストール順序は重要です。というのも、バンドルされた依存関係を特定のバージョン（つまり、 `xformers` および `triton`).

1. 私は `uv` よりも `pip` を使う方が好きです。なぜなら、より高速で依存関係の解決にも優れているからです。特に、 `torch` に依存しているが、このシナリオでは特定の `CUDA` バージョンが必要なライブラリに対して有効です。

   インストール `uv`

   ```bash
   curl -LsSf https://astral.sh/uv/install.sh | sh && source $HOME/.local/bin/env
   ```

   プロジェクトディレクトリと venv を作成：

   ```bash
   mkdir 'unsloth-blackwell' && cd 'unsloth-blackwell'
   uv venv .venv --python=3.12 --seed
   source .venv/bin/activate
   ```
2. インストール `vllm`

   ```bash
   uv pip install -U vllm --torch-backend=cu128
   ```

   指定する必要があることに注意してください `cu128`。そうしないと `vllm` がインストールされます `torch==2.7.0` ですが `cu126`.
3. インストール `unsloth` の依存関係になります

   ```bash
   uv pip install unsloth unsloth_zoo bitsandbytes
   ```

   Xformers が原因でおかしな解決問題が見られる場合は、Xformers なしでソースから Unsloth をインストールすることもできます：

   ```bash
   uv pip install -qqq \
   "unsloth_zoo[base] @ git+https://github.com/unslothai/unsloth-zoo" \
   "unsloth[base] @ git+https://github.com/unslothai/unsloth"
   ```
4. ダウンロードしてビルド `xformers` （任意）

   Xformers は任意ですが、確実に高速でメモリ使用量も少なくなります。Xformers を使わない場合は、PyTorch のネイティブ SDPA を使用します。Xformers をソースからビルドするのは時間がかかることがあるので注意してください！

   ```bash
   # まず、以前のライブラリによってインストールされた xformers をアンインストールします
   pip uninstall xformers -y

   # クローンしてビルド
   pip install ninja
   export TORCH_CUDA_ARCH_LIST="12.0"
   git clone --depth=1 https://github.com/facebookresearch/xformers --recursive
   cd xformers && python setup.py install && cd ..
   ```

   明示的に `TORCH_CUDA_ARCH_LIST=12.0`.
5. `transformers` 任意の transformers バージョンをインストールできますが、最新を取得するのが最善です。

   ```bash
   uv pip install -U transformers
   ```

### Conda または mamba（上級者向け）

1. インストール `conda/mamba`

   ```bash
   curl -L -O "https://github.com/conda-forge/miniforge/releases/latest/download/Miniforge3-$(uname)-$(uname -m).sh"
   ```

   インストールスクリプトを実行

   ```bash
   bash Miniforge3-$(uname)-$(uname -m).sh
   ```

   conda または mamba の環境を作成

   ```bash
   conda create --name unsloth-blackwell python==3.12 -y
   ```

   新しく作成した環境をアクティブ化

   ```bash
   conda activate unsloth-blackwell
   ```
2. インストール `vllm`

   アクティブ化された conda/mamba 環境の中にいることを確認してください。ターミナルのシェルの先頭に、次のように環境名が表示されるはずです `(unsloth-blackwell)user@machine:`

   ```bash
   pip install -U vllm --extra-index-url https://download.pytorch.org/whl/cu128
   ```

   指定する必要があることに注意してください `cu128`。そうしないと `vllm` がインストールされます `torch==2.7.0` ですが `cu126`.
3. インストール `unsloth` の依存関係になります

   アクティブ化された conda/mamba 環境の中にいることを確認してください。ターミナルのシェルの先頭に、次のように環境名が表示されるはずです `(unsloth-blackwell)user@machine:`

   ```bash
   pip install unsloth unsloth_zoo bitsandbytes
   ```
4. ダウンロードしてビルド `xformers` （任意）

   Xformers は任意ですが、確実に高速でメモリ使用量も少なくなります。Xformers を使わない場合は、PyTorch のネイティブ SDPA を使用します。Xformers をソースからビルドするのは時間がかかることがあるので注意してください！

   ターミナルのシェルの先頭に、次のように環境名が表示されるはずです `(unsloth-blackwell)user@machine:`

   ```bash
   # まず、以前のライブラリによってインストールされた xformers をアンインストールします
   pip uninstall xformers -y

   # クローンしてビルド
   pip install ninja
   export TORCH_CUDA_ARCH_LIST="12.0"
   git clone --depth=1 https://github.com/facebookresearch/xformers --recursive
   cd xformers && python setup.py install && cd ..
   ```

   明示的に `TORCH_CUDA_ARCH_LIST=12.0`.
5. 更新 `triton`

   アクティブ化された conda/mamba 環境の中にいることを確認してください。ターミナルのシェルの先頭に、次のように環境名が表示されるはずです `(unsloth-blackwell)user@machine:`

   ```bash
   pip install -U "triton>=3.3.1"
   ```

   `triton>=3.3.1` は `Blackwell` のサポートに必要です。
6. `Transformers` 任意の transformers バージョンをインストールできますが、最新を取得するのが最善です。

   ```bash
   uv pip install -U transformers
   ```

mamba をパッケージマネージャーとして使っている場合は、上記のすべてのコマンドで conda を mamba に置き換えてください。

### WSL 固有の注意事項

WSL（Windows Subsystem for Linux）を使用していて、xformers のコンパイル中に問題が発生した場合（注意：Xformers は任意ですが、トレーニングではより高速です）、以下の追加手順に従ってください：

1. **WSL のメモリ制限を増やす** WSL の設定ファイルを作成または編集します：

   ```bash
   # Windows のユーザーディレクトリに .wslconfig を作成または編集します
   #（通常は C:\Users\YourUsername\.wslconfig）

   # 次の行をファイルに追加します
   [wsl2]
   memory=16GB  # xformers のコンパイルには最低 16GB を推奨
   processors=4  # CPU コア数に応じて調整
   swap=2GB
   localhostForwarding=true
   ```

   これらの変更を行った後、WSL を再起動します：

   ```powershell
   wsl --shutdown
   ```
2. **xformers をインストール** WSL 用に最適化されたコンパイルで xformers をインストールするには、次のコマンドを使用してください：

   ```bash
   # Blackwell GPU 用の CUDA アーキテクチャを設定
   export TORCH_CUDA_ARCH_LIST="12.0"

   # 最適化されたビルドフラグでソースから xformers をインストール
   pip install -v --no-build-isolation -U git+https://github.com/facebookresearch/xformers.git@main#egg=xformers
   ```

   この `--no-build-isolation` フラグは、WSL 環境で起こりうるビルド問題の回避に役立ちます。


---

# 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 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/jp/burogu/fine-tuning-llms-with-blackwell-rtx-50-series-and-unsloth.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.
