2025-05-23 11:09:53 +02:00
# --8<-- [start:installation]
2024-12-23 17:35:38 -05:00
2025-03-13 20:33:09 -07:00
vLLM initially supports basic model inference and serving on Intel GPU platform.
2024-12-23 17:35:38 -05:00
2025-05-23 11:09:53 +02:00
# --8<-- [end:installation]
# --8<-- [start:requirements]
2024-12-23 17:35:38 -05:00
- Supported Hardware: Intel Data Center GPU, Intel ARC GPU
2025-09-08 10:07:16 +08:00
- OneAPI requirements: oneAPI 2025.1
- Python: 3.12
!!! warning
The provided IPEX whl is Python3.12 specific so this version is a MUST.
2024-12-23 17:35:38 -05:00
2025-05-23 11:09:53 +02:00
# --8<-- [end:requirements]
# --8<-- [start:set-up-using-python]
2024-12-23 17:35:38 -05:00
2025-07-07 15:44:34 +01:00
There is no extra information on creating a new Python environment for this device.
2025-05-23 11:09:53 +02:00
# --8<-- [end:set-up-using-python]
# --8<-- [start:pre-built-wheels]
2024-12-23 17:35:38 -05:00
2025-01-13 12:27:36 +00:00
Currently, there are no pre-built XPU wheels.
2024-12-23 17:35:38 -05:00
2025-05-23 11:09:53 +02:00
# --8<-- [end:pre-built-wheels]
# --8<-- [start:build-wheel-from-source]
2024-12-23 17:35:38 -05:00
2025-09-08 10:07:16 +08:00
- First, install required [driver ](https://dgpu-docs.intel.com/driver/installation.html#installing-gpu-drivers ) and [Intel OneAPI ](https://www.intel.com/content/www/us/en/developer/tools/oneapi/base-toolkit.html ) 2025.1 or later.
2024-12-23 17:35:38 -05:00
- Second, install Python packages for vLLM XPU backend building:
2025-06-23 18:59:09 +01:00
```bash
2025-04-22 00:02:57 +08:00
git clone https://github.com/vllm-project/vllm.git
cd vllm
2025-01-12 03:17:13 -05:00
pip install --upgrade pip
2025-03-08 17:44:35 +01:00
pip install -v -r requirements/xpu.txt
2024-12-23 17:35:38 -05:00
```
2025-03-11 10:11:47 -07:00
- Then, build and install vLLM XPU backend:
2024-12-23 17:35:38 -05:00
2025-06-23 18:59:09 +01:00
```bash
2025-01-12 03:17:13 -05:00
VLLM_TARGET_DEVICE=xpu python setup.py install
2024-12-23 17:35:38 -05:00
```
2025-05-23 11:09:53 +02:00
# --8<-- [end:build-wheel-from-source]
# --8<-- [start:pre-built-images]
2025-01-13 12:27:36 +00:00
2025-09-08 10:07:16 +08:00
Currently, we release prebuilt XPU images at docker [hub ](https://hub.docker.com/r/intel/vllm/tags ) based on vLLM released version. For more information, please refer release [note ](https://github.com/intel/ai-containers/blob/main/vllm ).
2025-01-13 12:27:36 +00:00
2025-05-23 11:09:53 +02:00
# --8<-- [end:pre-built-images]
# --8<-- [start:build-image-from-source]
2025-01-13 12:27:36 +00:00
2025-06-23 18:59:09 +01:00
```bash
docker build -f docker/Dockerfile.xpu -t vllm-xpu-env --shm-size=4g .
docker run -it \
2025-01-13 12:27:36 +00:00
--rm \
--network=host \
2025-10-30 11:17:13 +08:00
--device /dev/dri:/dev/dri \
2025-01-13 12:27:36 +00:00
-v /dev/dri/by-path:/dev/dri/by-path \
2025-10-30 11:17:13 +08:00
--ipc=host \
--privileged \
2025-01-13 12:27:36 +00:00
vllm-xpu-env
```
2025-06-14 00:25:08 +08:00
# --8<-- [end:build-image-from-source]
# --8<-- [start:supported-features]
2024-12-23 17:35:38 -05:00
2025-09-08 10:07:16 +08:00
XPU platform supports **tensor parallel ** inference/serving and also supports **pipeline parallel ** as a beta feature for online serving. For **pipeline parallel ** , we support it on single node with mp as the backend. For example, a reference execution like following:
2024-12-23 17:35:38 -05:00
2025-06-23 18:59:09 +01:00
```bash
2025-10-03 01:04:57 +08:00
vllm serve facebook/opt-13b \
2025-01-12 03:17:13 -05:00
--dtype=bfloat16 \
--max_model_len=1024 \
2025-09-08 10:07:16 +08:00
--distributed-executor-backend=mp \
2025-01-12 03:17:13 -05:00
--pipeline-parallel-size=2 \
-tp=8
2024-12-23 17:35:38 -05:00
```
2025-10-17 04:05:34 +01:00
By default, a ray instance will be launched automatically if no existing one is detected in the system, with `num-gpus` equals to `parallel_config.world_size` . We recommend properly starting a ray cluster before execution, referring to the [examples/online_serving/run_cluster.sh ](https://github.com/vllm-project/vllm/blob/main/examples/online_serving/run_cluster.sh ) helper script.
2025-06-14 00:25:08 +08:00
# --8<-- [end:supported-features]
2025-07-07 12:32:32 +08:00
# --8<-- [start:distributed-backend]
XPU platform uses **torch-ccl ** for torch<2.8 and **xccl ** for torch>=2.8 as distributed backend, since torch 2.8 supports **xccl ** as built-in backend for XPU.
# --8<-- [end:distributed-backend]