gpu.xpu.inc.md 4.11 KB
Newer Older
1
2
<!-- markdownlint-disable MD041 -->
--8<-- [start:installation]
3

4
vLLM initially supports basic model inference and serving on Intel GPU platform.
5

6
7
--8<-- [end:installation]
--8<-- [start:requirements]
8
9

- Supported Hardware: Intel Data Center GPU, Intel ARC GPU
10
- Dependency: [vllm-xpu-kernels](https://github.com/vllm-project/vllm-xpu-kernels): a package provide all necessary vllm custom kernel when running vLLM on Intel GPU platform,
11
12
- Python: 3.12
!!! warning
13
    The provided vllm-xpu-kernels whl is Python3.12 specific so this version is a MUST.
14

15
16
--8<-- [end:requirements]
--8<-- [start:set-up-using-python]
17

18
19
There is no extra information on creating a new Python environment for this device.

20
21
--8<-- [end:set-up-using-python]
--8<-- [start:pre-built-wheels]
22

23
Currently, there are no pre-built XPU wheels.
24

25
26
--8<-- [end:pre-built-wheels]
--8<-- [start:build-wheel-from-source]
27

28
29
- First, install required [driver](https://dgpu-docs.intel.com/driver/installation.html#installing-gpu-drivers).
- Second, install Python packages for vLLM XPU backend building (Intel OneAPI dependencies are installed automatically as part of `torch-xpu`, see [PyTorch XPU get started](https://docs.pytorch.org/docs/stable/notes/get_start_xpu.html)):
30

31
```bash
32
33
git clone https://github.com/vllm-project/vllm.git
cd vllm
34
pip install --upgrade pip
35
pip install -v -r requirements/xpu.txt
36
37
```

38
39
40
41
42
43
44
45
46
47
48
49
50
51
- Then, install the correct Triton package for Intel XPU.

    The default `triton` package (for NVIDIA GPUs) may be installed as a transitive dependency (e.g., via `xgrammar`). For Intel XPU, you must replace it with `triton-xpu`:

    ```bash
    pip uninstall -y triton triton-xpu
    pip install triton-xpu==3.6.0 --extra-index-url https://download.pytorch.org/whl/xpu
    ```

    !!! note
        - `triton` (without suffix) is for NVIDIA GPUs only. On XPU, using it instead of `triton-xpu` can cause correctness or runtime issues.
        - For torch 2.10 (the version used in `requirements/xpu.txt`), the matching package is `triton-xpu==3.6.0`. If you use a different version of torch, check the corresponding `triton-xpu` version in [docker/Dockerfile.xpu](https://github.com/vllm-project/vllm/blob/main/docker/Dockerfile.xpu).

- Finally, build and install vLLM XPU backend:
52

53
```bash
54
VLLM_TARGET_DEVICE=xpu pip install --no-build-isolation -e . -v
55
56
```

57
58
--8<-- [end:build-wheel-from-source]
--8<-- [start:pre-built-images]
59

60
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).
61

62
63
--8<-- [end:pre-built-images]
--8<-- [start:build-image-from-source]
64

65
66
67
```bash
docker build -f docker/Dockerfile.xpu -t vllm-xpu-env --shm-size=4g .
docker run -it \
68
69
             --rm \
             --network=host \
70
             --device /dev/dri:/dev/dri \
71
             -v /dev/dri/by-path:/dev/dri/by-path \
72
73
             --ipc=host \
             --privileged \
74
75
76
             vllm-xpu-env
```

77
78
--8<-- [end:build-image-from-source]
--8<-- [start:supported-features]
79

80
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:
81

82
```bash
83
vllm serve facebook/opt-13b \
84
85
     --dtype=bfloat16 \
     --max_model_len=1024 \
86
     --distributed-executor-backend=mp \
87
88
     --pipeline-parallel-size=2 \
     -tp=8
89
90
```

91
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.
92

93
94
--8<-- [end:supported-features]
--8<-- [start:distributed-backend]
95
96
97

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.

98
--8<-- [end:distributed-backend]