Getting started
Getting started with Red Hat AI Inference Server
Abstract
Chapter 1. About AI Inference Server Copy linkLink copied to clipboard!
AI Inference Server provides enterprise-grade stability and security, building on the open source vLLM project, which provides state-of-the-art inferencing features.
AI Inference Server uses continuous batching to process requests as they arrive instead of waiting for a full batch to be accumulated. It also uses tensor parallelism to distribute LLM workloads across multiple GPUs. These features provide reduced latency and higher throughput.
To reduce the cost of inferencing models, AI Inference Server uses paged attention. LLMs use a mechanism called attention to understand conversations with users. Normally, attention uses a significant amount of memory, much of which is wasted. Paged attention addresses this memory waste by provisioning memory for LLMs similar to the way that virtual memory works for operating systems. This approach consumes less memory and lowers costs.
To verify cost savings and performance gains with AI Inference Server, complete the following procedures:
- Serving and inferencing with AI Inference Server
- Validating Red Hat AI Inference Server benefits using key metrics
Chapter 2. Product and version compatibility Copy linkLink copied to clipboard!
The following table lists the supported product versions for Red Hat AI Inference Server, Red Hat Enterprise Linux AI, and Red Hat OpenShift AI.
| Product version | vLLM core version | LLM Compressor version |
|---|---|---|
| 3.3.0 | v0.13.0 | v0.9.0.1 |
| 3.2.5 | v0.11.2 | v0.8.1 |
| 3.2.4 | v0.11.0 | v0.8.1 |
| 3.2.3 | v0.11.0 | v0.8.1 |
| 3.2.2 | v0.10.1.1 | v0.7.1 |
| 3.2.1 | v0.10.0 | Not included in this release |
| 3.2.0 | v0.9.2 | Not included in this release |
| Product version | vLLM core version | LLM Compressor version |
|---|---|---|
| 3.2 | v0.11.2 | v0.8.1 |
| 3.0 | v0.11.0 | v0.8.1 |
| Product version | vLLM core version | LLM Compressor version |
|---|---|---|
| 3.2 | v0.11.2 | v0.8.1 |
| 3.0 | v0.11.0 | v0.8.1 |
Chapter 3. Reviewing AI Inference Server Python packages Copy linkLink copied to clipboard!
You can review the Python packages installed in the Red Hat AI Inference Server container image by running the container with Podman and reviewing the pip list package output.
Prerequisites
- You have installed Podman or Docker.
- You are logged in as a user with sudo access.
-
You have access to
registry.redhat.ioand have logged in.
Procedure
Run the Red Hat AI Inference Server container image with the
pip list packagecommand to view all installed Python packages. For example:podman run --rm --entrypoint=/bin/bash \ registry.redhat.io/rhaiis/vllm-cuda-rhel9:3.3.0 \ -c "pip list"
$ podman run --rm --entrypoint=/bin/bash \ registry.redhat.io/rhaiis/vllm-cuda-rhel9:3.3.0 \ -c "pip list"Copy to Clipboard Copied! Toggle word wrap Toggle overflow To view detailed information about a specific package, run the Podman command with
pip show <package_name>. For example:podman run --rm --entrypoint=/bin/bash \ registry.redhat.io/rhaiis/vllm-cuda-rhel9:3.3.0 \ -c "pip show vllm"
$ podman run --rm --entrypoint=/bin/bash \ registry.redhat.io/rhaiis/vllm-cuda-rhel9:3.3.0 \ -c "pip show vllm"Copy to Clipboard Copied! Toggle word wrap Toggle overflow Example output
Name: vllm Version: v0.13.0
Name: vllm Version: v0.13.0Copy to Clipboard Copied! Toggle word wrap Toggle overflow
Chapter 4. Serving and inferencing with Podman using NVIDIA CUDA AI accelerators Copy linkLink copied to clipboard!
Serve and inference a large language model with Podman and Red Hat AI Inference Server running on NVIDIA CUDA AI accelerators.
Prerequisites
- You have installed Podman or Docker.
- You are logged in as a user with sudo access.
-
You have access to
registry.redhat.ioand have logged in. - You have a Hugging Face account and have generated a Hugging Face access token.
You have access to a Linux server with data center grade NVIDIA AI accelerators installed.
For NVIDIA GPUs:
- Install NVIDIA drivers
- Install the NVIDIA Container Toolkit
- If your system has multiple NVIDIA GPUs that use NVSwitch, you must have root access to start Fabric Manager
For more information about supported vLLM quantization schemes for accelerators, see Supported hardware.
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 Pull the relevant the NVIDIA CUDA image by running the following command:
podman pull registry.redhat.io/rhaiis/vllm-cuda-rhel9:3.3.0
$ podman pull registry.redhat.io/rhaiis/vllm-cuda-rhel9:3.3.0Copy 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 Create a volume and mount it into the container. Adjust the container permissions so that the container can use it.
mkdir -p rhaiis-cache
$ mkdir -p rhaiis-cacheCopy to Clipboard Copied! Toggle word wrap Toggle overflow chmod g+rwX rhaiis-cache
$ chmod g+rwX rhaiis-cacheCopy to Clipboard Copied! Toggle word wrap Toggle overflow Create or append your
HF_TOKENHugging Face token to theprivate.envfile. Source theprivate.envfile.echo "export HF_TOKEN=<your_HF_token>" > private.env
$ echo "export HF_TOKEN=<your_HF_token>" > private.envCopy to Clipboard Copied! Toggle word wrap Toggle overflow source private.env
$ source private.envCopy to Clipboard Copied! Toggle word wrap Toggle overflow Start the AI Inference Server container image.
For NVIDIA CUDA accelerators, if the host system has multiple GPUs and uses NVSwitch, then start NVIDIA Fabric Manager. To detect if your system is using NVSwitch, first check if files are present in
/proc/driver/nvidia-nvswitch/devices/, and then start NVIDIA Fabric Manager. Starting NVIDIA Fabric Manager requires root privileges.ls /proc/driver/nvidia-nvswitch/devices/
$ ls /proc/driver/nvidia-nvswitch/devices/Copy to Clipboard Copied! Toggle word wrap Toggle overflow Example output
0000:0c:09.0 0000:0c:0a.0 0000:0c:0b.0 0000:0c:0c.0 0000:0c:0d.0 0000:0c:0e.0
0000:0c:09.0 0000:0c:0a.0 0000:0c:0b.0 0000:0c:0c.0 0000:0c:0d.0 0000:0c:0e.0Copy to Clipboard Copied! Toggle word wrap Toggle overflow systemctl start nvidia-fabricmanager
$ systemctl start nvidia-fabricmanagerCopy to Clipboard Copied! Toggle word wrap Toggle overflow ImportantNVIDIA Fabric Manager is only required on systems with multiple GPUs that use NVSwitch. For more information, see NVIDIA Server Architectures.
Check that the Red Hat AI Inference Server container can access NVIDIA GPUs on the host by running the following command:
podman run --rm -it \ --security-opt=label=disable \ --device nvidia.com/gpu=all \ nvcr.io/nvidia/cuda:12.4.1-base-ubi9 \ nvidia-smi
$ podman run --rm -it \ --security-opt=label=disable \ --device nvidia.com/gpu=all \ nvcr.io/nvidia/cuda:12.4.1-base-ubi9 \ nvidia-smiCopy to Clipboard Copied! Toggle word wrap Toggle overflow Example output
Copy to Clipboard Copied! Toggle word wrap Toggle overflow Start the container.
Copy to Clipboard Copied! Toggle word wrap Toggle overflow Where:
--security-opt=label=disable- Disables SELinux label relabeling for volume mounts. Required for systems where SELinux is enabled. Without this option, the container might fail to start.
--shm-size=4g -p 8000:8000-
Specifies the shared memory size and port mapping. Increase
--shm-sizeto8GBif you experience shared memory issues. --userns=keep-id:uid=1001-
Maps the host UID to the effective UID of the vLLM process in the container. Alternatively, you can pass
--user=0, but this is less secure because it runs vLLM as root inside the container. --env "HUGGING_FACE_HUB_TOKEN=$HF_TOKEN"-
Specifies the Hugging Face API access token. Set and export
HF_TOKENwith your Hugging Face token. -v ./rhaiis-cache:/opt/app-root/src/.cache:Z-
Mounts the cache directory with SELinux context. The
:Zsuffix is required for systems where SELinux is enabled. On Debian, Ubuntu, or Docker without SELinux, omit the:Zsuffix. --tensor-parallel-size 2- Specifies the number of GPUs to use for tensor parallelism. Set this value to match the number of available GPUs.
In a separate tab in your terminal, make a request to your model with the API.
curl -X POST -H "Content-Type: application/json" -d '{ "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 '{ "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
Chapter 5. Serving and inferencing with Podman using AMD ROCm AI accelerators Copy linkLink copied to clipboard!
Serve and inference a large language model with Podman and Red Hat AI Inference Server running on AMD ROCm AI accelerators.
Prerequisites
- You have installed Podman or Docker.
- You are logged in as a user with sudo access.
-
You have access to
registry.redhat.ioand have logged in. - You have a Hugging Face account and have generated a Hugging Face access token.
You have access to a Linux server with data center grade AMD ROCm AI accelerators installed.
For AMD GPUs:
For more information about supported vLLM quantization schemes for accelerators, see Supported hardware.
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 Pull the AMD ROCm image by running the following command:
podman pull registry.redhat.io/rhaiis/vllm-rocm-rhel9:3.3.0
$ podman pull registry.redhat.io/rhaiis/vllm-rocm-rhel9:3.3.0Copy 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 Create a volume and mount it into the container. Adjust the container permissions so that the container can use it.
mkdir -p rhaiis-cache
$ mkdir -p rhaiis-cacheCopy to Clipboard Copied! Toggle word wrap Toggle overflow chmod g+rwX rhaiis-cache
$ chmod g+rwX rhaiis-cacheCopy to Clipboard Copied! Toggle word wrap Toggle overflow Create or append your
HF_TOKENHugging Face token to theprivate.envfile. Source theprivate.envfile.echo "export HF_TOKEN=<your_HF_token>" > private.env
$ echo "export HF_TOKEN=<your_HF_token>" > private.envCopy to Clipboard Copied! Toggle word wrap Toggle overflow source private.env
$ source private.envCopy to Clipboard Copied! Toggle word wrap Toggle overflow Start the AI Inference Server container image.
For AMD ROCm accelerators:
Use
amd-smi static -ato verify that the container can access the host system GPUs:Copy to Clipboard Copied! Toggle word wrap Toggle overflow Where:
--group-add keep-groups-
Preserves the supplementary groups from the host user. On AMD systems, you must belong to both the
videoandrendergroups to access GPUs.
Start the container:
Copy to Clipboard Copied! Toggle word wrap Toggle overflow Where:
--security-opt=label=disable- Disables SELinux label relabeling for volume mounts. Without this option, the container might fail to start.
--shm-size=4GB -p 8000:8000-
Specifies the shared memory size and port mapping. Increase
--shm-sizeto8GBif you experience shared memory issues. --tensor-parallel-size 2- Specifies the number of GPUs to use for tensor parallelism. Set this value to match the number of available GPUs.
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 '{ "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 '{ "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
Chapter 6. Serving and inferencing language models with Podman using Google TPU AI accelerators Copy linkLink copied to clipboard!
Serve and inference a large language model with Podman or Docker and Red Hat AI Inference Server in a Google cloud VM that has Google TPU AI accelerators available.
Prerequisites
You have access to a Google cloud TPU VM with Google TPU AI accelerators configured. For more information, see:
- You have installed Podman or Docker.
- You are logged in as a user with sudo access.
-
You have access to the
registry.redhat.ioimage registry and have logged in. - You have a Hugging Face account and have generated a Hugging Face access token.
For more information about supported vLLM quantization schemes for accelerators, see Supported hardware.
Procedure
Open a terminal on your TPU 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 Pull the Red Hat AI Inference Server image by running the following command:
podman pull registry.redhat.io/rhaiis/vllm-tpu-rhel9:3.3.0
$ podman pull registry.redhat.io/rhaiis/vllm-tpu-rhel9:3.3.0Copy to Clipboard Copied! Toggle word wrap Toggle overflow Optional: Verify that the TPUs are available in the host.
Open a shell prompt in the Red Hat AI Inference Server container. Run the following command:
podman run -it --net=host --privileged -e PJRT_DEVICE=TPU --rm --entrypoint /bin/bash registry.redhat.io/rhaiis/vllm-tpu-rhel9:3.3.0
$ podman run -it --net=host --privileged -e PJRT_DEVICE=TPU --rm --entrypoint /bin/bash registry.redhat.io/rhaiis/vllm-tpu-rhel9:3.3.0Copy to Clipboard Copied! Toggle word wrap Toggle overflow Verify system TPU access and basic operations by running the following Python code in the container shell prompt:
Copy to Clipboard Copied! Toggle word wrap Toggle overflow Example output
Copy to Clipboard Copied! Toggle word wrap Toggle overflow Exit the shell prompt.
exit
$ exitCopy to Clipboard Copied! Toggle word wrap Toggle overflow
Create a volume and mount it into the container. Adjust the container permissions so that the container can use it.
mkdir ./.cache/rhaiis
$ mkdir ./.cache/rhaiisCopy to Clipboard Copied! Toggle word wrap Toggle overflow chmod g+rwX ./.cache/rhaiis
$ chmod g+rwX ./.cache/rhaiisCopy to Clipboard Copied! Toggle word wrap Toggle overflow Add the
HF_TOKENHugging Face token to theprivate.envfile.echo "export HF_TOKEN=<huggingface_token>" > private.env
$ echo "export HF_TOKEN=<huggingface_token>" > private.envCopy to Clipboard Copied! Toggle word wrap Toggle overflow Append the
HF_HOMEvariable to theprivate.envfile.echo "export HF_HOME=./.cache/rhaiis" >> private.env
$ echo "export HF_HOME=./.cache/rhaiis" >> private.envCopy to Clipboard Copied! Toggle word wrap Toggle overflow Source the
private.envfile.source private.env
$ source private.envCopy to Clipboard Copied! Toggle word wrap Toggle overflow Start the AI Inference Server container image:
Copy to Clipboard Copied! Toggle word wrap Toggle overflow Where:
--tensor-parallel-size 1- Specifies the number of TPUs to use for tensor parallelism. Set this value to match the number of available TPUs.
--max-model-len=256- Specifies the maximum model context length. For optimal performance, set this value as low as your workload allows.
Verification
Check that the AI Inference Server server is up. Open a separate tab in your terminal, and make a model request with the API:
Example output
Chapter 7. Inference serving with Podman on IBM Power with IBM Spyre AI accelerators Copy linkLink copied to clipboard!
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.3.0
$ podman pull registry.redhat.io/rhaiis/vllm-spyre:3.3.0Copy 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
Chapter 8. Inference serving with Podman on IBM Z with IBM Spyre AI accelerators Copy linkLink copied to clipboard!
Serve and inference a large language model with Podman and Red Hat AI Inference Server running on IBM Z with IBM Spyre AI accelerators.
Prerequisites
- You have access to an IBM Z (s390x) server running RHEL 9.6 with IBM Spyre for Z 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 a Hugging Face account and have generated a Hugging Face access token.
IBM Spyre AI accelerator cards support FP16 format model weights only. For compatible models, the Red Hat AI Inference Server inference engine automatically converts weights to FP16 at startup. No additional configuration is needed.
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 Pull the Red Hat AI Inference Server image by running the following command:
podman pull registry.redhat.io/rhaiis/vllm-spyre:3.3.0
$ podman pull registry.redhat.io/rhaiis/vllm-spyre:3.3.0Copy 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 IOMMU group IDs for the available Spyre devices:
lspci
$ lspciCopy to Clipboard Copied! Toggle word wrap Toggle overflow Example output
0000:00:00.0 Processing accelerators: IBM Spyre Accelerator Virtual Function (rev 02) 0001:00:00.0 Processing accelerators: IBM Spyre Accelerator Virtual Function (rev 02) 0002:00:00.0 Processing accelerators: IBM Spyre Accelerator Virtual Function (rev ff) 0003:00:00.0 Processing accelerators: IBM Spyre Accelerator Virtual Function (rev 02)
0000:00:00.0 Processing accelerators: IBM Spyre Accelerator Virtual Function (rev 02) 0001:00:00.0 Processing accelerators: IBM Spyre Accelerator Virtual Function (rev 02) 0002:00:00.0 Processing accelerators: IBM Spyre Accelerator Virtual Function (rev ff) 0003:00:00.0 Processing accelerators: IBM Spyre Accelerator Virtual Function (rev 02)Copy to Clipboard Copied! Toggle word wrap Toggle overflow Each line begins with the PCI device address, for example,
0000:00:00.0.Use the PCI address to determine the IOMMU group ID for the required Spyre card, for example:
readlink /sys/bus/pci/devices/<PCI_ADDRESS>/iommu_group
$ readlink /sys/bus/pci/devices/<PCI_ADDRESS>/iommu_groupCopy to Clipboard Copied! Toggle word wrap Toggle overflow Example output
../../../kernel/iommu_groups/0
../../../kernel/iommu_groups/0Copy to Clipboard Copied! Toggle word wrap Toggle overflow The IOMMU group ID (0) is the trailing number in the
readlinkoutput.Repeat for each required Spyre card.
Set
IOMMU_GROUP_IDvariables for the required Spyre cards using thereadlinkoutput. For example:IOMMU_GROUP_ID0=0 IOMMU_GROUP_ID1=1 IOMMU_GROUP_ID2=2 IOMMU_GROUP_ID3=3
IOMMU_GROUP_ID0=0 IOMMU_GROUP_ID1=1 IOMMU_GROUP_ID2=2 IOMMU_GROUP_ID3=3Copy to Clipboard Copied! Toggle word wrap Toggle overflow Start the AI Inference Server container, passing in the IOMMU group ID variables for the required Spyre devices. For example, deploy the granite-3.3-8b-instruct model configured for entity extraction across 4 Spyre devices:
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
Chapter 9. Serving and inferencing language models with Podman using AWS Trainium and Inferentia AI accelerators Copy linkLink copied to clipboard!
Serve and inference a large language model with Podman or Docker and Red Hat AI Inference Server on an AWS cloud instance that has AWS Trainium or Inferentia AI accelerators configured.
AWS Inferentia and AWS Trainium are custom-designed machine learning chips from Amazon Web Services (AWS). Red Hat AI Inference Server integrates with these accelerators through the AWS Neuron SDK, providing a path to deploy vLLM-based inference workloads on AWS cloud infrastructure.
AWS Trainium and Inferentia support is a Technology Preview feature only. Technology Preview features are not supported with Red Hat production service level agreements (SLAs) and might not be functionally complete. Red Hat does not recommend using them in production. These features provide early access to upcoming product features, enabling customers to test functionality and provide feedback during the development process.
For more information about the support scope of Red Hat Technology Preview features, see Technology Preview Features Support Scope.
Prerequisites
- You have access to an AWS Inf2, Trn1, Trn1n, or Trn2 instance with AWS Neuron drivers configured. See Neuron setup guide.
- You have installed Podman or Docker.
- You are logged in as a user that has sudo access.
-
You have access to the
registry.redhat.ioimage registry. - You have a Hugging Face account and have generated a Hugging Face access token.
Procedure
Open a terminal on your AWS 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 Pull the Red Hat AI Inference Server image for Neuron by running the following command:
podman pull registry.redhat.io/rhaiis/vllm-neuron-rhel9:3.3.0
$ podman pull registry.redhat.io/rhaiis/vllm-neuron-rhel9:3.3.0Copy to Clipboard Copied! Toggle word wrap Toggle overflow Optional: Verify that the Neuron drivers and devices are available on the host.
Run
neuron-lsto verify that Neuron drivers are installed and to view detailed information about the Neuron hardware:neuron-ls
$ neuron-lsCopy to Clipboard Copied! Toggle word wrap Toggle overflow Example output
Copy to Clipboard Copied! Toggle word wrap Toggle overflow Note the number of Neuron cores available. Use this information to set
--tensor-parallel-sizeargument when starting the container.List the Neuron devices:
ls /dev/neuron*
$ ls /dev/neuron*Copy to Clipboard Copied! Toggle word wrap Toggle overflow Example output
/dev/neuron0
/dev/neuron0Copy to Clipboard Copied! Toggle word wrap Toggle overflow
Create a volume for mounting into the container and adjust the permissions so that the container can use it:
mkdir -p ./.cache/rhaiis && chmod g+rwX ./.cache/rhaiis
$ mkdir -p ./.cache/rhaiis && chmod g+rwX ./.cache/rhaiisCopy to Clipboard Copied! Toggle word wrap Toggle overflow Add the
HF_TOKENHugging Face token to theprivate.envfile.echo "export HF_TOKEN=<huggingface_token>" > private.env
$ echo "export HF_TOKEN=<huggingface_token>" > private.envCopy to Clipboard Copied! Toggle word wrap Toggle overflow Append the
HF_HOMEvariable to theprivate.envfile.echo "export HF_HOME=./.cache/rhaiis" >> private.env
$ echo "export HF_HOME=./.cache/rhaiis" >> private.envCopy to Clipboard Copied! Toggle word wrap Toggle overflow Source the
private.envfile.source private.env
$ source private.envCopy to Clipboard Copied! Toggle word wrap Toggle overflow Start the AI Inference Server container image:
Copy to Clipboard Copied! Toggle word wrap Toggle overflow --device=/dev/neuron0- Map the required Neuron device. Adjust based on your model requirements and available Neuron memory.
--no-enable-prefix-caching- Disable prefix caching for Neuron hardware.
--tensor-parallel-size 2-
Set
--tensor-parallel-sizeto match the number of neuron cores being used. --additional-config '{ "override_neuron_config": { "async_mode": false } }'-
The
--additional-configparameter passes Neuron-specific configuration. Settingasync_modetofalseis recommended for stability.
Verification
Check that the AI Inference Server server is up. Open a separate tab in your terminal, and make a model request with the API:
Copy to Clipboard Copied! Toggle word wrap Toggle overflow Example output
Copy to Clipboard Copied! Toggle word wrap Toggle overflow
Chapter 10. Serving and inferencing with Podman using CPU (x86_64 AVX2) Copy linkLink copied to clipboard!
Serve and inference a large language model with Podman and Red Hat AI Inference Server running on x86_64 CPUs with AVX2 instruction set support.
With CPU-only inference, you can run Red Hat AI Inference Server workloads on x86_64 CPUs without requiring GPU hardware. This feature provides a cost-effective option for development, testing, and small-scale deployments using smaller language models.
{feature-name} is a Technology Preview feature only. Technology Preview features are not supported with Red Hat production service level agreements (SLAs) and might not be functionally complete. Red Hat does not recommend using them in production. These features provide early access to upcoming product features, enabling customers to test functionality and provide feedback during the development process.
For more information about the support scope of Red Hat Technology Preview features, see Technology Preview Features Support Scope.
AVX512 instruction set support is planned for a future release.
Prerequisites
- You have installed Podman or Docker.
- You are logged in as a user with sudo access.
-
You have access to
registry.redhat.ioand have logged in. - You have a Hugging Face account and have generated a Hugging Face access token.
You have access to a Linux server with an x86_64 CPU that supports the AVX2 instruction set:
- Intel Haswell (2013) or newer processors
- AMD Excavator (2015) or newer processors
- You have a minimum of 16GB system RAM. 32GB or more is recommended for larger models.
CPU inference is optimized for smaller models, typically under 3 billion parameters. For larger models or production workloads requiring higher throughput, consider using GPU acceleration.
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 Pull the CPU inference image by running the following command:
podman pull registry.redhat.io/rhaiis/vllm-cpu-rhel9:3.3.0
$ podman pull registry.redhat.io/rhaiis/vllm-cpu-rhel9:3.3.0Copy to Clipboard Copied! Toggle word wrap Toggle overflow Create a volume and mount it into the container. Adjust the container permissions so that the container can use it.
mkdir -p rhaiis-cache && chmod g+rwX rhaiis-cache
$ mkdir -p rhaiis-cache && chmod g+rwX rhaiis-cacheCopy to Clipboard Copied! Toggle word wrap Toggle overflow Create or append your
HF_TOKENHugging Face token to theprivate.envfile. Source theprivate.envfile.echo "export HF_TOKEN=<your_HF_token>" > private.env
$ echo "export HF_TOKEN=<your_HF_token>" > private.envCopy to Clipboard Copied! Toggle word wrap Toggle overflow source private.env
$ source private.envCopy to Clipboard Copied! Toggle word wrap Toggle overflow Verify that your CPU supports the AVX2 instruction set:
grep -q avx2 /proc/cpuinfo && echo "AVX2 supported" || echo "AVX2 not supported"
$ grep -q avx2 /proc/cpuinfo && echo "AVX2 supported" || echo "AVX2 not supported"Copy to Clipboard Copied! Toggle word wrap Toggle overflow ImportantIf your CPU does not support AVX2, you cannot use CPU inference with Red Hat AI Inference Server.
Start the AI Inference Server container image.
Copy to Clipboard Copied! Toggle word wrap Toggle overflow -
--security-opt=label=disable: Disables SELinux label relabeling for volume mounts. Required for systems where SELinux is enabled. Without this option, the container might fail to start. -
--shm-size=4g -p 8000:8000: Specifies the shared memory size and port mapping. Increase--shm-sizeto8GBif you experience shared memory issues. -
--userns=keep-id:uid=1001: Maps the host UID to the effective UID of the vLLM process in the container. Alternatively, you can pass--user=0, but this is less secure because it runs vLLM as root inside the container. -
--env "HUGGING_FACE_HUB_TOKEN=$HF_TOKEN": Specifies the Hugging Face API access token. Set and exportHF_TOKENwith your Hugging Face token. -
--env "VLLM_CPU_KVCACHE_SPACE=4": Allocates 4GB for the CPU key-value cache. Increase this value for larger models or longer context lengths. The default is 4GB. -
-v ./rhaiis-cache:/opt/app-root/src/.cache:Z: Mounts the cache directory with SELinux context. The:Zsuffix is required for systems where SELinux is enabled. On Debian, Ubuntu, or Docker without SELinux, omit the:Zsuffix. -
--model TinyLlama/TinyLlama-1.1B-Chat-v1.0: Specifies the Hugging Face model to serve. For CPU inference, use smaller models (under 3B parameters) for optimal performance.
-
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 '{ "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 '{ "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 The model returns a valid JSON response answering your question.
Chapter 11. Validating Red Hat AI Inference Server benefits using key metrics Copy linkLink copied to clipboard!
Use the following metrics to evaluate the performance of the LLM model being served with AI Inference Server:
- Time to first token (TTFT): The time from when a request is sent to when the first token of the response is received.
- Time per output token (TPOT): The average time it takes to generate each token after the first one.
- Latency: The total time required to generate the full response.
- Throughput: The total number of output tokens the model can produce at the same time across all users and requests.
Complete the procedure below to run a benchmark test that shows how AI Inference Server, and other inference servers, perform according to these metrics.
Prerequisites
- AI Inference Server container image
- GitHub account
- Python 3.9 or higher
Procedure
On your host system, start an AI Inference Server container and serve a model.
Copy to Clipboard Copied! Toggle word wrap Toggle overflow In a separate terminal tab, install the benchmark tool dependencies.
pip install vllm pandas datasets
$ pip install vllm pandas datasetsCopy to Clipboard Copied! Toggle word wrap Toggle overflow Clone the vLLM Git repository:
git clone https://github.com/vllm-project/vllm.git
$ git clone https://github.com/vllm-project/vllm.gitCopy to Clipboard Copied! Toggle word wrap Toggle overflow Run the
./vllm/benchmarks/benchmark_serving.pyscript.python vllm/benchmarks/benchmark_serving.py --backend vllm --model RedHatAI/Llama-3.2-1B-Instruct-FP8 --num-prompts 100 --dataset-name random --random-input 1024 --random-output 512 --port 8000
$ python vllm/benchmarks/benchmark_serving.py --backend vllm --model RedHatAI/Llama-3.2-1B-Instruct-FP8 --num-prompts 100 --dataset-name random --random-input 1024 --random-output 512 --port 8000Copy to Clipboard Copied! Toggle word wrap Toggle overflow
Verification
The results show how AI Inference Server performs according to key server metrics:
Try changing the parameters of this benchmark and running it again. Notice how vllm as a backend compares to other options. Throughput should be consistently higher, while latency should be lower.
-
Other options for
--backendare:tgi,lmdeploy,deepspeed-mii,openai, andopenai-chat -
Other options for
--dataset-nameare:sharegpt,burstgpt,sonnet,random,hf
Additional resources
- vLLM documentation
- LLM Inference Performance Engineering: Best Practices, by Mosaic AI Research, which explains metrics such as throughput and latency
Chapter 12. Troubleshooting Copy linkLink copied to clipboard!
The following troubleshooting information for Red Hat AI Inference Server 3.3.0 describes common problems related to model loading, memory, model response quality, networking, and GPU drivers. Where available, workarounds for common issues are described.
Most common issues in vLLM relate to installation, model loading, memory management, and GPU communication. Most problems can be resolved by using a correctly configured environment, ensuring compatible hardware and software versions, and following the recommended configuration practices.
For persistent issues, export VLLM_LOGGING_LEVEL=DEBUG to enable debug logging and then check the logs.
export VLLM_LOGGING_LEVEL=DEBUG
$ export VLLM_LOGGING_LEVEL=DEBUG
12.1. Model loading errors Copy linkLink copied to clipboard!
When you run the Red Hat AI Inference Server container image without specifying a user namespace, an unrecognized model error is returned.
Copy to Clipboard Copied! Toggle word wrap Toggle overflow Example output
ValueError: Unrecognized model in RedHatAI/Llama-3.2-1B-Instruct-FP8. Should have a model_type key in its config.json
ValueError: Unrecognized model in RedHatAI/Llama-3.2-1B-Instruct-FP8. Should have a model_type key in its config.jsonCopy to Clipboard Copied! Toggle word wrap Toggle overflow To resolve this error, pass
--userns=keep-id:uid=1001as the first Podman parameter to ensure that the container runs with the root user.Copy to Clipboard Copied! Toggle word wrap Toggle overflow Sometimes when Red Hat AI Inference Server downloads the model, the download fails or gets stuck. To prevent the model download from hanging, first download the model using the
huggingface-cli. For example:huggingface-cli download <MODEL_ID> --local-dir <DOWNLOAD_PATH>
$ huggingface-cli download <MODEL_ID> --local-dir <DOWNLOAD_PATH>Copy to Clipboard Copied! Toggle word wrap Toggle overflow When serving the model, pass the local model path to vLLM to prevent the model from being downloaded again.
When Red Hat AI Inference Server loads a model from disk, the process sometimes hangs. Large models consume memory, and if memory runs low, the system slows down as it swaps data between RAM and disk. Slow network file system speeds or a lack of available memory can trigger excessive swapping. This can happen in clusters where file systems are shared between cluster nodes.
Where possible, store the model in a local disk to prevent slow down during model loading. Ensure that the system has sufficient CPU memory available.
Ensure that your system has enough CPU capacity to handle the model.
Sometimes, Red Hat AI Inference Server fails to inspect the model. Errors are reported in the log. For example:
#... File "vllm/model_executor/models/registry.py", line xxx, in \_raise_for_unsupported raise ValueError( ValueError: Model architectures [''] failed to be inspected. Please check the logs for more details.#... File "vllm/model_executor/models/registry.py", line xxx, in \_raise_for_unsupported raise ValueError( ValueError: Model architectures [''] failed to be inspected. Please check the logs for more details.Copy to Clipboard Copied! Toggle word wrap Toggle overflow The error occurs when vLLM fails to import the model file, which is usually related to missing dependencies or outdated binaries in the vLLM build.
Some model architectures are not supported. Refer to the list of Red Hat AI validated models. For example, the following errors indicate that the model you are trying to use is not supported:
Traceback (most recent call last): #... File "vllm/model_executor/models/registry.py", line xxx, in inspect_model_cls for arch in architectures: TypeError: 'NoneType' object is not iterableTraceback (most recent call last): #... File "vllm/model_executor/models/registry.py", line xxx, in inspect_model_cls for arch in architectures: TypeError: 'NoneType' object is not iterableCopy to Clipboard Copied! Toggle word wrap Toggle overflow #... File "vllm/model_executor/models/registry.py", line xxx, in \_raise_for_unsupported raise ValueError( ValueError: Model architectures [''] are not supported for now. Supported architectures: #...#... File "vllm/model_executor/models/registry.py", line xxx, in \_raise_for_unsupported raise ValueError( ValueError: Model architectures [''] are not supported for now. Supported architectures: #...Copy to Clipboard Copied! Toggle word wrap Toggle overflow NoteSome architectures such as
DeepSeekV2VLrequire the architecture to be explicitly specified using the--hf_overridesflag, for example:--hf_overrides '{\"architectures\": [\"DeepseekVLV2ForCausalLM\"]}--hf_overrides '{\"architectures\": [\"DeepseekVLV2ForCausalLM\"]}Copy to Clipboard Copied! Toggle word wrap Toggle overflow Sometimes a runtime error occurs for certain hardware when you load 8-bit floating point (FP8) models. FP8 requires GPU hardware acceleration. Errors occur when you load FP8 models like
deepseek-r1or models tagged with theF8_E4M3tensor type. For example:triton.compiler.errors.CompilationError: at 1:0: def \_per_token_group_quant_fp8( \^ ValueError("type fp8e4nv not supported in this architecture. The supported fp8 dtypes are ('fp8e4b15', 'fp8e5')") [rank0]:[W502 11:12:56.323757996 ProcessGroupNCCL.cpp:1496] Warning: WARNING: destroy_process_group() was not called before program exit, which can leak resources. For more info, please see https://pytorch.org/docs/stable/distributed.html#shutdown (function operator())triton.compiler.errors.CompilationError: at 1:0: def \_per_token_group_quant_fp8( \^ ValueError("type fp8e4nv not supported in this architecture. The supported fp8 dtypes are ('fp8e4b15', 'fp8e5')") [rank0]:[W502 11:12:56.323757996 ProcessGroupNCCL.cpp:1496] Warning: WARNING: destroy_process_group() was not called before program exit, which can leak resources. For more info, please see https://pytorch.org/docs/stable/distributed.html#shutdown (function operator())Copy to Clipboard Copied! Toggle word wrap Toggle overflow NoteReview Getting started to ensure your specific accelerator is supported. Accelerators that are currently supported for FP8 models include:
Sometimes when serving a model a runtime error occurs that is related to the host system. For example, you might see errors in the log like this:
Copy to Clipboard Copied! Toggle word wrap Toggle overflow You can work around this issue by passing the
--shm-size=2gargument when startingvllm.
12.2. Memory optimization Copy linkLink copied to clipboard!
- If the model is too large to run with a single GPU, you will get out-of-memory (OOM) errors. Use memory optimization options such as quantization, tensor parallelism, or reduced precision to reduce the memory consumption. For more information, see Conserving memory.
12.3. Generated model response quality Copy linkLink copied to clipboard!
In some scenarios, the quality of the generated model responses might deteriorate after an update.
Default sampling parameters source have been updated in newer versions. For vLLM version 0.8.4 and higher, the default sampling parameters come from the
generation_config.jsonfile that is provided by the model creator. In most cases, this should lead to higher quality responses, because the model creator is likely to know which sampling parameters are best for their model. However, in some cases the defaults provided by the model creator can lead to degraded performance.If you experience this problem, try serving the model with the old defaults by using the
--generation-config vllmserver argument.ImportantIf applying the
--generation-config vllmserver argument improves the model output, continue to use the vLLM defaults and petition the model creator on Hugging Face to update their defaultgeneration_config.jsonso that it produces better quality generations.
12.4. CUDA accelerator errors Copy linkLink copied to clipboard!
You might experience a
self.graph.replay()error when running a model using CUDA accelerators.If vLLM crashes and the error trace captures the error somewhere around the
self.graph.replay()method in thevllm/worker/model_runner.pymodule, this is most likely a CUDA error that occurs inside theCUDAGraphclass.To identify the particular CUDA operation that causes the error, add the
--enforce-eagerserver argument to thevllmcommand line to disableCUDAGraphoptimization and isolate the problematic CUDA operation.You might experience accelerator and CPU communication problems that are caused by incorrect hardware or driver settings.
NVIDIA Fabric Manager is required for multi-GPU systems for some types of NVIDIA GPUs. The
nvidia-fabricmanagerpackage and associated systemd service might not be installed or the package might not be running.Run the diagnostic Python script to check whether the NVIDIA Collective Communications Library (NCCL) and Gloo library components are communicating correctly.
On an NVIDIA system, check the fabric manager status by running the following command:
systemctl status nvidia-fabricmanager
$ systemctl status nvidia-fabricmanagerCopy to Clipboard Copied! Toggle word wrap Toggle overflow On successfully configured systems, the service should be active and running with no errors.
-
Running vLLM with tensor parallelism enabled and setting
--tensor-parallel-sizeto be greater than 1 on NVIDIA Multi-Instance GPU (MIG) hardware causes anAssertionErrorduring the initial model loading or shape checking phase. This typically occurs as one of the first errors when starting vLLM.
12.5. Networking errors Copy linkLink copied to clipboard!
You might experience network errors with complicated network configurations.
To troubleshoot network issues, search the logs for DEBUG statements where an incorrect IP address is listed, for example:
DEBUG 06-10 21:32:17 parallel_state.py:88] world_size=8 rank=0 local_rank=0 distributed_init_method=tcp://<incorrect_ip_address>:54641 backend=nccl
DEBUG 06-10 21:32:17 parallel_state.py:88] world_size=8 rank=0 local_rank=0 distributed_init_method=tcp://<incorrect_ip_address>:54641 backend=ncclCopy to Clipboard Copied! Toggle word wrap Toggle overflow To correct the issue, set the correct IP address with the
VLLM_HOST_IPenvironment variable, for example:export VLLM_HOST_IP=<correct_ip_address>
$ export VLLM_HOST_IP=<correct_ip_address>Copy to Clipboard Copied! Toggle word wrap Toggle overflow Specify the network interface that is tied to the IP address for NCCL and Gloo:
export NCCL_SOCKET_IFNAME=<your_network_interface>
$ export NCCL_SOCKET_IFNAME=<your_network_interface>Copy to Clipboard Copied! Toggle word wrap Toggle overflow export GLOO_SOCKET_IFNAME=<your_network_interface>
$ export GLOO_SOCKET_IFNAME=<your_network_interface>Copy to Clipboard Copied! Toggle word wrap Toggle overflow
12.6. Python multiprocessing errors Copy linkLink copied to clipboard!
You might experience Python multiprocessing warnings or runtime errors. This can be caused by code that is not properly structured for Python multiprocessing. The following is an example console warning:
WARNING 12-11 14:50:37 multiproc_worker_utils.py:281] CUDA was previously initialized. We must use the `spawn` multiprocessing start method. Setting VLLM_WORKER_MULTIPROC_METHOD to 'spawn'.WARNING 12-11 14:50:37 multiproc_worker_utils.py:281] CUDA was previously initialized. We must use the `spawn` multiprocessing start method. Setting VLLM_WORKER_MULTIPROC_METHOD to 'spawn'.Copy to Clipboard Copied! Toggle word wrap Toggle overflow The following is an example Python runtime error:
Copy to Clipboard Copied! Toggle word wrap Toggle overflow To resolve the runtime error, update your Python code to guard the usage of
vllmbehind anif__name__ = "__main__":block, for example:if __name__ = "__main__": import vllm llm = vllm.LLM(...)if __name__ = "__main__": import vllm llm = vllm.LLM(...)Copy to Clipboard Copied! Toggle word wrap Toggle overflow
12.7. GPU driver or device pass-through issues Copy linkLink copied to clipboard!
When you run the Red Hat AI Inference Server container image, sometimes it is unclear whether device pass-through errors are being caused by GPU drivers or tools such as the NVIDIA Container Toolkit.
Check that the NVIDIA Container toolkit that is installed on the host machine can see the host GPUs:
nvidia-ctk cdi list
$ nvidia-ctk cdi listCopy to Clipboard Copied! Toggle word wrap Toggle overflow Example output
Copy to Clipboard Copied! Toggle word wrap Toggle overflow Ensure that the NVIDIA accelerator configuration has been created on the host machine:
sudo nvidia-ctk cdi generate --output=/etc/cdi/nvidia.yaml
$ sudo nvidia-ctk cdi generate --output=/etc/cdi/nvidia.yamlCopy to Clipboard Copied! Toggle word wrap Toggle overflow Check that the Red Hat AI Inference Server container can access NVIDIA GPUs on the host by running the following command:
podman run --rm -it --security-opt=label=disable --device nvidia.com/gpu=all nvcr.io/nvidia/cuda:12.4.1-base-ubi9 nvidia-smi
$ podman run --rm -it --security-opt=label=disable --device nvidia.com/gpu=all nvcr.io/nvidia/cuda:12.4.1-base-ubi9 nvidia-smiCopy to Clipboard Copied! Toggle word wrap Toggle overflow Example output
Copy to Clipboard Copied! Toggle word wrap Toggle overflow
12.8. Troubleshooting IBM Power issues Copy linkLink copied to clipboard!
If you are unable to access the model data from the AI Inference Server container, complete the following steps:
-
Verify that the
/modelsfolder mapping to the container is correct - Review the host SELinux settings
Ensure that you have applied appropriate permissions on the
$HOME/modelsfolder, for example:chmod -R 755 $HOME/models
$ chmod -R 755 $HOME/modelsCopy to Clipboard Copied! Toggle word wrap Toggle overflow Ensure that you are using the
:Zoption for the Podman volume mounts:podman run -d --device=/dev/vfio \ -v $HOME/models:/models:Z \ # ...$ podman run -d --device=/dev/vfio \ -v $HOME/models:/models:Z \ # ...Copy to Clipboard Copied! Toggle word wrap Toggle overflow -
Ensure that you set
VLLM_SPYRE_USE_CB=1for decoding models.
12.8.1. IBM Spyre for Power AI acclerator card problems Copy linkLink copied to clipboard!
-
Ensure that the IBM Spyre AI accelerator cards are visible on the host. Use
lspcito verify that the cards are available. -
Ensure your user is in the
sentientgroup. - Use the Service Report tool to diagnose and correct card access issues. See IBM Power Systems service and productivity tools.
12.8.2. IBM Spyre for Power performance issues Copy linkLink copied to clipboard!
- Ensure all Spyre cards are securely seated in the first four slots of the IBM Power server I/O drawer. The first four slots have the highest speed PCIe interfaces.
- Ensure that cards assigned to an LPAR are all in the same drawer. Do not separate cards across drawers as this increases I/O latency. See IBM Power11 documentation for more information.
If you encounter errors with the IBM Spyre AI accelerator card, you can use the
aiu-smitool alongside the workload you want to profile. Perform the following steps:- Start the model.
From a second terminal, query the model. For example:
Copy to Clipboard Copied! Toggle word wrap Toggle overflow From a third terminal, run the
aiu-smitool:podman exec -it <CONTAINER_ID> -c aiu-smi
$ podman exec -it <CONTAINER_ID> -c aiu-smiCopy to Clipboard Copied! Toggle word wrap Toggle overflow Alternatively, exec into the running container and run
aiu-smi. For example:podman exec -it <CONTAINER_ID> bash
$ podman exec -it <CONTAINER_ID> bashCopy to Clipboard Copied! Toggle word wrap Toggle overflow Run the
aiu-smitool inside the container:aiu-smi
[senuser@689230aca2ba ~]$ aiu-smiCopy to Clipboard Copied! Toggle word wrap Toggle overflow Example aiu-smi output
Copy to Clipboard Copied! Toggle word wrap Toggle overflow
Chapter 13. Gathering system information with the vLLM collect environment script Copy linkLink copied to clipboard!
Use the vllm collect-env command that you run from the Red Hat AI Inference Server container to gather system information for troubleshooting AI Inference Server deployments. This script collects system details, hardware configurations, and dependency information that can help diagnose deployment problems and model inference serving issues.
Prerequisites
- You have installed Podman or Docker.
- You are logged in as a user with sudo access.
- You have access to a Linux server with data center grade AI accelerators installed.
- You have pulled and successfully deployed the Red Hat AI Inference Server container.
Procedure
Open a terminal 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 Pull the specific Red Hat AI Inference Server container image for the AI accelerator that is installed. For example, to pull the Red Hat AI Inference Server container for Google cloud TPUs, run the following command:
podman pull registry.redhat.io/rhaiis/vllm-tpu-rhel9:3.3.0
$ podman pull registry.redhat.io/rhaiis/vllm-tpu-rhel9:3.3.0Copy to Clipboard Copied! Toggle word wrap Toggle overflow Run the collect environment script in the container:
Copy to Clipboard Copied! Toggle word wrap Toggle overflow
Verification
The vllm collect-env command output details environment information including the following:
- System hardware details
- Operating system details
- Python environment and dependencies
- GPU/TPU accelerator information
Review the output for any warnings or errors that might indicate configuration issues. Include the collect-env output for your system when reporting problems to Red Hat Support.
An example Google Cloud TPU report is provided below: