XPU+Unsloth環境を作り上げていく

Artificial Intelligence

unslothはXPUに対応しているか?

unslothはXPUに対応している。それ用のインストール手順もありがたいことにUnslothが提供してくれている。

Fine-tuning LLMs on Intel GPUs with Unsloth | Unsloth Documentation
Learn how to train and fine-tune large language models on Intel GPUs.

pytorchとtritonの組み合わせに注意した方がよさそう

今ちょうど2.9.0+XPUのtorchをインストールしているのだけど、こういうバージョン間の整合性は気を付けた方が良いらしい。

torch (+xpu)Intel extra入れるべき XPU Triton
2.6.0intel-gpu-torch260pytorch_triton_xpu 3.2.0(Linux のみ)
2.7.0intel-gpu-torch270pytorch_triton_xpu 3.3.0
2.7.1intel-gpu-torch271pytorch_triton_xpu 3.3.1
2.8.0intel-gpu-torch280 / intelpytorch_triton_xpu 3.4.0
2.9.0 / 2.9.1intel-gpu-torch290 / 291pytorch_triton_xpu 3.5.0
2.10.0intel-gpu-torch210triton_xpu 3.6.0
2.11.0intel-gpu-torch2110triton_xpu 3.7.0
2.12.0intel-gpu-torch2120triton_xpu 3.7.1

Qwenをファインチューニングするには

Gated DeltaNetをチューニングする際、その効率を高めるには以下2つのコンポーネントが必要になる。

  • causal_conv1d
  • flash-linear-attention

これらをチューニングするために必要となるバージョンなのだけど、実は causal_conv1d に関してはCUDA専用でありXPU環境では使用できない。flash-linear-attention に関しては0.5.1にしておかないとTriton 3.5が対応してないため、注意が必要(執筆段階で 0.6.0 が最新)です。

なお、torch のバージョンを 2.9.0 にしてるのは、単純に Unsloth のXPU向けインストール手順で torch 2.9.0 の前提があったからであり、今後バージョンが上がっていけば普通にこれらのバージョンも上げることが可能だとは思われるんですが・・とりあえずは torch=2.9.0+xpu ならば上記の対応が無難なんだろうなと思います。

ちなみに、flash-linear-attention は絶対入れておいた方が良いです。torch直接の計算処理では 40s-50s かかってた処理が、最速で 10s 以下になります。当然ファンの音はうるさくなるわけですが(;´Д`)

我が家のB70も本来Pro向け・Enterprise向けのGPUです。やっぱしそれなりの能力を発揮してもらわねば困るのは確かですね。今のところ Qwen3.5-4B は bf16 はカード一枚でちゃんと FineTuning できそうです。

コメント

タイトルとURLをコピーしました