gpu.xpu.inc.md 3.24 KB
Newer Older
1
# --8<-- [start:installation]
2

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

5
!!! warning
6
    There are no pre-built wheels for this device, so you need build vLLM from source. Or you can use pre-built images which are based on vLLM released versions.
7

8
9
# --8<-- [end:installation]
# --8<-- [start:requirements]
10
11

- Supported Hardware: Intel Data Center GPU, Intel ARC GPU
12
13
14
15
- OneAPI requirements: oneAPI 2025.1
- Python: 3.12
!!! warning
    The provided IPEX whl is Python3.12 specific so this version is a MUST.
16

17
18
# --8<-- [end:requirements]
# --8<-- [start:set-up-using-python]
19

20
21
There is no extra information on creating a new Python environment for this device.

22
23
# --8<-- [end:set-up-using-python]
# --8<-- [start:pre-built-wheels]
24

25
Currently, there are no pre-built XPU wheels.
26

27
28
# --8<-- [end:pre-built-wheels]
# --8<-- [start:build-wheel-from-source]
29

30
- 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.
31
32
- Second, install Python packages for vLLM XPU backend building:

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

40
- Then, build and install vLLM XPU backend:
41

42
```bash
43
VLLM_TARGET_DEVICE=xpu python setup.py install
44
45
```

46
47
# --8<-- [end:build-wheel-from-source]
# --8<-- [start:pre-built-images]
48

49
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).
50

51
52
# --8<-- [end:pre-built-images]
# --8<-- [start:build-image-from-source]
53

54
55
56
```bash
docker build -f docker/Dockerfile.xpu -t vllm-xpu-env --shm-size=4g .
docker run -it \
57
58
             --rm \
             --network=host \
59
             --device /dev/dri:/dev/dri \
60
             -v /dev/dri/by-path:/dev/dri/by-path \
61
62
             --ipc=host \
             --privileged \
63
64
65
             vllm-xpu-env
```

66
67
# --8<-- [end:build-image-from-source]
# --8<-- [start:supported-features]
68

69
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:
70

71
```bash
72
vllm serve facebook/opt-13b \
73
74
     --dtype=bfloat16 \
     --max_model_len=1024 \
75
     --distributed-executor-backend=mp \
76
77
     --pipeline-parallel-size=2 \
     -tp=8
78
79
```

80
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.
81
82

# --8<-- [end:supported-features]
83
84
85
86
87
# --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]