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

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

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

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

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

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

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

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

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

27
- 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.
28
29
- Second, install Python packages for vLLM XPU backend building:

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

37
- Then, build and install vLLM XPU backend:
38

39
```bash
40
VLLM_TARGET_DEVICE=xpu python setup.py install
41
42
```

43
44
# --8<-- [end:build-wheel-from-source]
# --8<-- [start:pre-built-images]
45

46
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).
47

48
49
# --8<-- [end:pre-built-images]
# --8<-- [start:build-image-from-source]
50

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

63
64
# --8<-- [end:build-image-from-source]
# --8<-- [start:supported-features]
65

66
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:
67

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

77
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.
78
79

# --8<-- [end:supported-features]
80
81
82
83
84
# --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]