第7章 IBM Spyre AI アクセラレーターを使用した IBM Power での Podman による推論
IBM Spyre AI アクセラレーターを備えた IBM Power で実行されている Podman および Red Hat AI Inference Server を使用して大規模な言語モデルを提供し、推論します。
前提条件
- RHEL 9.6 を実行している IBM Spyre for Power AI アクセラレーターがインストールされている IBM Power 11 サーバーにアクセスできる。
- sudo アクセス権を持つユーザーとしてログインしている。
- Podman をインストールしている。
-
registry.redhat.ioにアクセスでき、ログインしている。 - Service Report ツールがインストールされている。IBM Power Systems サービスおよび生産性ツール を参照してください。
-
送信済みセキュリティーグループを
作成し、Spyre ユーザーをグループに追加しました。
手順
サーバーホストでターミナルを開き、
registry.redhat.ioにログインします。$ podman login registry.redhat.ioservicereportコマンドを実行して、IBM Spyre ハードウェアを確認します。$ servicereport -r -p spyre出力例
servicereport 2.2.5 Spyre configuration checks PASS VFIO Driver configuration PASS User memlock configuration PASS sos config PASS sos package PASS VFIO udev rules configuration PASS User group configuration PASS VFIO device permission PASS VFIO kernel module loaded PASS VFIO module dep configuration PASS Memlock limit is set for the sentient group. Spyre user must be in the sentient group. To add run below command: sudo usermod -aG sentient <user> Example: sudo usermod -aG sentient abc Re-login as <user>.次のコマンドを実行して、Red Hat AI Inference Server イメージをプルします。
$ podman pull registry.redhat.io/rhaiis/vllm-spyre:3.2.5システムで SELinux が有効になっている場合は、デバイスアクセスを許可するように SELinux を設定します。
$ sudo setsebool -P container_use_devices 1lspci -vを使用して、コンテナーがホストシステムの IBM Spyre AI アクセラレーターにアクセスできることを確認します。$ podman run -it --rm --pull=newer \ --security-opt=label=disable \ --device=/dev/vfio \ --group-add keep-groups \ --entrypoint="lspci" \ registry.redhat.io/rhaiis/vllm-spyre:3.2.5出力例
0381:50:00.0 Processing accelerators: IBM Spyre Accelerator (rev 02) 0382:60:00.0 Processing accelerators: IBM Spyre Accelerator (rev 02) 0383:70:00.0 Processing accelerators: IBM Spyre Accelerator (rev 02) 0384:80:00.0 Processing accelerators: IBM Spyre Accelerator (rev 02)コンテナーにマウントするボリュームを作成し、コンテナーが使用できるようにコンテナーのパーミッションを調整します。
$ mkdir -p ~/models && chmod g+rwX ~/models-
granite-
3.3-8b-instructモデルはmodels/フォルダーにダウンロードします。詳細は、Downloading models を参照してください。 VLLM_AIU_PCIE_IDS変数の Spyre ID を収集します。$ lspci出力例
0381:50:00.0 Processing accelerators: IBM Spyre Accelerator (rev 02) 0382:60:00.0 Processing accelerators: IBM Spyre Accelerator (rev 02) 0383:70:00.0 Processing accelerators: IBM Spyre Accelerator (rev 02) 0384:80:00.0 Processing accelerators: IBM Spyre Accelerator (rev 02)SPYRE_IDS変数を設定します。$ SPYRE_IDS="0381:50:00.0 0382:60:00.0 0383:70:00.0 0384:80:00.0"AI 推論サーバーコンテナーを起動します。たとえば、エンティティー抽出の推論サービス用に設定された granite-3.3-8b-instruct モデルをデプロイします。
podman run \ --device=/dev/vfio \ -v $HOME/models:/models \ -e AIU_PCIE_IDS="${SPYRE_IDS}" \ -e VLLM_SPYRE_USE_CB=1 \ --pids-limit 0 \ --userns=keep-id \ --group-add=keep-groups \ --memory 200G \ --shm-size 64G \ -p 8000:8000 \ registry.redhat.io/rhaiis/vllm-spyre:3.2.5 \ --model /models/granite-3.3-8b-instruct \ -tp 4 \ --max-model-len 32768 \ --max-num-seqs 32
検証
ターミナルの別のタブで、API を使用してモデルにリクエストを送信します。
curl -X POST -H "Content-Type: application/json" -d '{ "model": "/models/granite-3.3-8b-instruct" "prompt": "What is the capital of France?", "max_tokens": 50 }' http://<your_server_ip>:8000/v1/completions | jq出力例
{ "id": "cmpl-b94beda1d5a4485c9cb9ed4a13072fca", "object": "text_completion", "created": 1746555421, "choices": [ { "index": 0, "text": " Paris.\nThe capital of France is Paris.", "logprobs": null, "finish_reason": "stop", "stop_reason": null, "prompt_logprobs": null } ], "usage": { "prompt_tokens": 8, "total_tokens": 18, "completion_tokens": 10, "prompt_tokens_details": null } }
7.1. IBM Power with IBM Spyre AI アクセラレーターの推奨モデルの推論設定 リンクのコピーリンクがクリップボードにコピーされました!
以下は、IBM Spyre AI アクセラレーターを備えた IBM Power システムに推奨されるモデルと AI 推論サーバー会議です。
| Model | バッチサイズ | 最大入力コンテキストサイズ | 最大出力コンテキストサイズ | コンテナーあたりのカード数 |
|---|---|---|---|---|
| granite3.3-8b-instruct | 16 | 3K | 3K | 1 |
| Model | バッチサイズ | 最大入力コンテキストサイズ | 最大出力コンテキストサイズ | コンテナーあたりのカード数 |
|---|---|---|---|---|
| 最大 256 | 512 | サイズ 768 のベクトル | 1 |
| 最大 256 | 512 | サイズ 384 のベクトル | 1 |
| Model | バッチサイズ | 最大入力コンテキストサイズ | 最大出力コンテキストサイズ | コンテナーあたりのカード数 |
|---|---|---|---|---|
| granite3.3-8b-instruct | 32 | 4K | 4K | 4 |
| 16 | 8K | 8K | 4 | |
| 8 | 16K | 16K | 4 | |
| 4 | 32K | 32K | 4 |