# UnslothによるマルチGPUファインチューニング

Unslothは現在、AccelerateやDeepSpeedのようなライブラリを通じてマルチGPU構成をサポートしています。つまり、既に次のような並列化手法を活用できます： **FSDP** および **DDP** をUnslothで利用できます。

#### **新しいDistributed Data Parallel** [**（DDP）マルチGPUガイドはこちら**](/docs/jp/ji-ben/multi-gpu-training-with-unsloth/ddp.md)**.**

このプロセスは複雑で手動設定が必要になることを承知しています。マルチGPUサポートをより簡単で使いやすくするために全力で取り組んでおり、近いうちにUnslothの公式マルチGPUサポートを発表します。

現時点では、次を使用できます： [Magistral-2509のKaggleノートブック](/docs/jp/moderu/tutorials/magistral-how-to-run-and-fine-tune.md#fine-tuning-magistral-with-unsloth) は、24BパラメータモデルにフィットさせるためにマルチGPUのUnslothを利用する例です。または、私たちの [DDPガイド](/docs/jp/ji-ben/multi-gpu-training-with-unsloth/ddp.md).

**その間に**、DDPでマルチGPUを有効にするには次を行ってください：

1. トレーニングスクリプトを次の名前で作成します： `train.py` （または類似の名前）。たとえば、私たちの次のいずれかの [トレーニングスクリプト](https://github.com/unslothai/notebooks/tree/main/python_scripts) を、さまざまなノートブックから作成したものとして使用できます！
2. 次を実行します `accelerate launch train.py` または `torchrun --nproc_per_node N_GPUS train.py` ここで `N_GPUS` はあなたが持っているGPUの数です。

#### **パイプライン／モデル分割の読み込み**

もし1台のGPUで例えばLlama 70Bを読み込むためのVRAMが足りない場合でも心配いりません — モデルを各GPUに分割して読み込みます！これを有効にするには、次のフラグを使用してください： `device_map = "balanced"` フラグ：

```python
from unsloth import FastLanguageModel
model, tokenizer = FastLanguageModel.from_pretrained(
    "unsloth/Llama-3.3-70B-Instruct",
    load_in_4bit = True,
    device_map = "balanced",
)
```

**公式発表をお楽しみに！**\
詳細については、進行中のこちらの [プルリクエスト](https://github.com/unslothai/unsloth/issues/2435) でマルチGPUサポートについて議論しています。


---

# 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/jp/ji-ben/multi-gpu-training-with-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.
