Chapter 7. Inference serving with Podman on IBM Power with IBM Spyre AI accelerators
Serve and inference a large language model with Podman and Red Hat AI Inference Server running on IBM Power with IBM Spyre AI accelerators.
Prerequisites
- You have access to an IBM Power 11 server running RHEL 9.6 with IBM Spyre for Power AI accelerators installed.
- You are logged in as a user with sudo access.
- You have installed Podman.
-
You have access to
registry.redhat.ioand have logged in. - You have installed the Service Report tool. See IBM Power Systems service and productivity tools.
-
You have created a
sentientsecurity group and added your Spyre user to the group.
Procedure
Open a terminal on your server host, and log in to
registry.redhat.io:podman login registry.redhat.io
$ podman login registry.redhat.ioCopy to Clipboard Copied! Toggle word wrap Toggle overflow Run the
servicereportcommand to verify your IBM Spyre hardware:servicereport -r -p spyre
$ servicereport -r -p spyreCopy to Clipboard Copied! Toggle word wrap Toggle overflow Example output
Copy to Clipboard Copied! Toggle word wrap Toggle overflow Pull the Red Hat AI Inference Server image by running the following command:
podman pull registry.redhat.io/rhaiis/vllm-spyre:3.2.5
$ podman pull registry.redhat.io/rhaiis/vllm-spyre:3.2.5Copy to Clipboard Copied! Toggle word wrap Toggle overflow If your system has SELinux enabled, configure SELinux to allow device access:
sudo setsebool -P container_use_devices 1
$ sudo setsebool -P container_use_devices 1Copy to Clipboard Copied! Toggle word wrap Toggle overflow Use
lspci -vto verify that the container can access the host system IBM Spyre AI accelerators:Copy to Clipboard Copied! Toggle word wrap Toggle overflow Example output
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)
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)Copy to Clipboard Copied! Toggle word wrap Toggle overflow Create a volume to mount into the container and adjust the container permissions so that the container can use it.
mkdir -p ~/models && chmod g+rwX ~/models
$ mkdir -p ~/models && chmod g+rwX ~/modelsCopy to Clipboard Copied! Toggle word wrap Toggle overflow -
Download the
granite-3.3-8b-instructmodel into themodels/folder. See Downloading models for more information. Gather the Spyre IDs for the
VLLM_AIU_PCIE_IDSvariable:lspci
$ lspciCopy to Clipboard Copied! Toggle word wrap Toggle overflow Example output
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)
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)Copy to Clipboard Copied! Toggle word wrap Toggle overflow Set the
SPYRE_IDSvariable:SPYRE_IDS="0381:50:00.0 0382:60:00.0 0383:70:00.0 0384:80:00.0"
$ SPYRE_IDS="0381:50:00.0 0382:60:00.0 0383:70:00.0 0384:80:00.0"Copy to Clipboard Copied! Toggle word wrap Toggle overflow Start the AI Inference Server container. For example, deploy the granite-3.3-8b-instruct model configured for entity extraction inference serving:
Copy to Clipboard Copied! Toggle word wrap Toggle overflow
Verification
In a separate tab in your terminal, make a request to the model with the 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 | jqcurl -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 | jqCopy to Clipboard Copied! Toggle word wrap Toggle overflow Example output
Copy to Clipboard Copied! Toggle word wrap Toggle overflow
7.1. Recommended model inference settings for IBM Power with IBM Spyre AI accelerators Copy linkLink copied to clipboard!
The following are the recommended model and AI Inference Server inference serving settings for IBM Power systems with IBM Spyre AI accelerators.
| Model | Batch size | Max input context size | Max output context size | Number of cards per container |
|---|---|---|---|---|
| granite3.3-8b-instruct | 16 | 3K | 3K | 1 |
| Model | Batch size | Max input context size | Max output context size | Number of cards per container |
|---|---|---|---|---|
| Up to 256 | 512 | Vector of size 768 | 1 |
| Up to 256 | 512 | Vector of size 384 | 1 |
| Model | Batch size | Max input context size | Max output context size | Number of cards per container |
|---|---|---|---|---|
| granite3.3-8b-instruct | 32 | 4K | 4K | 4 |
| 16 | 8K | 8K | 4 | |
| 8 | 16K | 16K | 4 | |
| 4 | 32K | 32K | 4 |
7.2. Example inference serving configurations for IBM Spyre AI accelerators on IBM Power Copy linkLink copied to clipboard!
The following examples describe common Red Hat AI Inference Server workloads on IBM Spyre AI accelerators and IBM Power.
- Entity extraction
Select a single Spyre card ID with the output from the
lspcicommand, for example:SPYRE_IDS="0381:50:00.0"
$ SPYRE_IDS="0381:50:00.0"Copy to Clipboard Copied! Toggle word wrap Toggle overflow Podman entity extraction example
Copy to Clipboard Copied! Toggle word wrap Toggle overflow - RAG inference serving
Select 4 Spyre card IDs with the output from the
lspcicommand, for example:SPYRE_IDS="0381:50:00.0 0382:60:00.0 0383:70:00.0 0384:80:00.0"
$ SPYRE_IDS="0381:50:00.0 0382:60:00.0 0383:70:00.0 0384:80:00.0"Copy to Clipboard Copied! Toggle word wrap Toggle overflow Podman RAG inference serving example
Copy to Clipboard Copied! Toggle word wrap Toggle overflow - RAG embedding
Select a single Spyre card ID with the output from the
lspcicommand, for example:SPYRE_IDS="0384:80:00.0"
$ SPYRE_IDS="0384:80:00.0"Copy to Clipboard Copied! Toggle word wrap Toggle overflow Podman RAG embedding inference serving example
Copy to Clipboard Copied! Toggle word wrap Toggle overflow - Re-ranker inference serving
Select a single Spyre AI accelerator card ID with the output from the
lspcicommand, for example:SPYRE_IDS="0384:80:00.0"
$ SPYRE_IDS="0384:80:00.0"Copy to Clipboard Copied! Toggle word wrap Toggle overflow Podman re-ranker inference serving example
Copy to Clipboard Copied! Toggle word wrap Toggle overflow