-
-
Notifications
You must be signed in to change notification settings - Fork 6.1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[Hardware][Intel GPU]Add Initial Intel GPU(XPU) inference backend #3814
Merged
Merged
Changes from all commits
Commits
Show all changes
68 commits
Select commit
Hold shift + click to select a range
792736d
add build, dependency
jikunshang f762493
add python layer support for xpu
jikunshang 068d34b
add ipex ops
jikunshang 19bc177
add test
jikunshang df77d6f
revert prepare_prompt
jikunshang a5f2c85
revert prefill
jikunshang 1c3a527
fix
jikunshang feb6d66
fix alibi device support
jikunshang 607c46e
remove
jikunshang 09d0382
add tensorizer config, fix format
jikunshang ef280e0
update wheel, fix typo
jikunshang d5f3e1f
fix
jikunshang 6b5f58c
fix xpu_executor
jikunshang 27e2dcf
more fix
jikunshang 7a6e6cd
typo
jikunshang a63dbf8
add co-author
jikunshang 0acfe75
revert test, fix format
jikunshang 58eafd0
fix ray_xpu_executor
jikunshang bc45bce
use varlen_fwd
jikunshang 56b0016
use varlen_attention
jikunshang ded32a2
fix
jikunshang 25b368b
remove paading
jikunshang 3519897
avoid using page attention v2 for ipex
jikunshang 36fae83
refactor
jikunshang 8514432
minor
jikunshang e1a42da
add xpu test
jikunshang 917b74a
use oneapi base docker imahe
jikunshang 80961f7
format
jikunshang 9037564
rebase, remove some config
jikunshang 4e3d1ed
add LoadConfig
jikunshang e42f23a
fix execute_model
jikunshang 8d9ef99
use v2
jikunshang d4dd31e
revert torch sdpa cpu path
jikunshang b4ca330
fix sdpa split cache on cpu path
jikunshang eaec862
add vision model support
jikunshang 7d76334
fix ray xpu executor
jikunshang ce55b60
fix block table device
jikunshang 39c07d9
add intel xpu test
jikunshang 88d1b6e
address comments
jikunshang e00fbce
fix import, add doc
jikunshang 50719c4
fix doc
jikunshang 342ea72
fix
jikunshang b3231b7
format
jikunshang 765fc2e
fix rebase issues
jikunshang ba7c162
fix ray_xpu_executor
jikunshang 4d0ab33
fix rebase issue, copy/swap_blocks
jikunshang dc4d41a
fix format
jikunshang f505011
add xpu in benchmark_latency.py
abhilash1910 d23aec6
fix
jikunshang 2d86f22
fix format
jikunshang fc0a8b8
address comments
jikunshang 07c139b
fix tp issues
jikunshang 634c951
fix worker
jikunshang f0e6407
fix ray xpu executor
jikunshang 6871d55
fix due to code rebase
jikunshang bef2c78
setuptools version
jikunshang f037737
update docker file, due to public key expired.
jikunshang 84f6b3a
add RayXPUExecutorAsync for serving
jikunshang a1f2970
update _custom_ops.py
jikunshang ca88270
add ipex_attn backend
jikunshang f1ebe9f
revert torch sdpa backend
jikunshang 9046315
update document
jikunshang ebbc13e
format
jikunshang 5d823d9
more fix
jikunshang bdb6ca5
revert torch sdpa, fix doc
jikunshang bcdf65a
address comments
jikunshang 10ec2d2
remove fuse in ipex_attn backend
jikunshang b4fef36
Merge branch 'main' into xpu_0403
WoosukKwon File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
# This script build the CPU docker image and run the offline inference inside the container. | ||
# It serves a sanity check for compilation and basic model usage. | ||
set -ex | ||
|
||
# Try building the docker image | ||
docker build -t xpu-test -f Dockerfile.xpu . | ||
|
||
# Setup cleanup | ||
remove_docker_container() { docker rm -f xpu-test || true; } | ||
trap remove_docker_container EXIT | ||
remove_docker_container | ||
|
||
# Run the image and launch offline inference | ||
docker run --network host --name xpu-test --device /dev/dri -v /dev/dri/by-path:/dev/dri/by-path xpu-test python3 examples/offline_inference.py |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
FROM intel/oneapi-basekit:2024.1.0-devel-ubuntu22.04 | ||
|
||
RUN wget -O- https://apt.repos.intel.com/intel-gpg-keys/GPG-PUB-KEY-INTEL-SW-PRODUCTS.PUB | gpg --dearmor | tee /usr/share/keyrings/intel-oneapi-archive-keyring.gpg > /dev/null && \ | ||
echo "deb [signed-by=/usr/share/keyrings/intel-oneapi-archive-keyring.gpg] https://apt.repos.intel.com/oneapi all main " | tee /etc/apt/sources.list.d/oneAPI.list && \ | ||
chmod 644 /usr/share/keyrings/intel-oneapi-archive-keyring.gpg && \ | ||
rm /etc/apt/sources.list.d/intel-graphics.list && \ | ||
wget -O- https://repositories.intel.com/graphics/intel-graphics.key | gpg --dearmor | tee /usr/share/keyrings/intel-graphics.gpg > /dev/null && \ | ||
echo "deb [arch=amd64,i386 signed-by=/usr/share/keyrings/intel-graphics.gpg] https://repositories.intel.com/graphics/ubuntu jammy arc" | tee /etc/apt/sources.list.d/intel.gpu.jammy.list && \ | ||
chmod 644 /usr/share/keyrings/intel-graphics.gpg | ||
|
||
RUN apt-get update -y \ | ||
&& apt-get install -y curl libicu70 lsb-release git wget vim numactl python3 python3-pip | ||
|
||
COPY ./ /workspace/vllm | ||
|
||
WORKDIR /workspace/vllm | ||
|
||
RUN pip install -v -r requirements-xpu.txt | ||
|
||
RUN VLLM_TARGET_DEVICE=xpu python3 setup.py install | ||
|
||
CMD ["/bin/bash"] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
WoosukKwon marked this conversation as resolved.
Show resolved
Hide resolved
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,61 @@ | ||
.. _installation_xpu: | ||
|
||
Installation with XPU | ||
======================== | ||
|
||
vLLM initially supports basic model inferencing and serving on Intel GPU platform. | ||
|
||
Table of contents: | ||
|
||
#. :ref:`Requirements <xpu_backend_requirements>` | ||
#. :ref:`Quick start using Dockerfile <xpu_backend_quick_start_dockerfile>` | ||
#. :ref:`Build from source <build_xpu_backend_from_source>` | ||
|
||
.. _xpu_backend_requirements: | ||
|
||
Requirements | ||
------------ | ||
|
||
* OS: Linux | ||
* Supported Hardware: Intel Data Center GPU (Intel ARC GPU WIP) | ||
* OneAPI requirements: oneAPI 2024.1 | ||
|
||
.. _xpu_backend_quick_start_dockerfile: | ||
|
||
Quick start using Dockerfile | ||
---------------------------- | ||
|
||
.. code-block:: console | ||
|
||
$ docker build -f Dockerfile.xpu -t vllm-xpu-env --shm-size=4g . | ||
$ docker run -it \ | ||
--rm \ | ||
--network=host \ | ||
--device /dev/dri \ | ||
-v /dev/dri/by-path:/dev/dri/by-path \ | ||
vllm-xpu-env | ||
|
||
.. _build_xpu_backend_from_source: | ||
|
||
Build from source | ||
----------------- | ||
|
||
- First, install required driver and intel OneAPI 2024.1. | ||
|
||
- Second, install Python packages for vLLM XPU backend building: | ||
|
||
.. code-block:: console | ||
|
||
$ pip install --upgrade pip | ||
$ pip install -v -r requirements-xpu.txt | ||
|
||
- Finally, build and install vLLM XPU backend: | ||
|
||
.. code-block:: console | ||
|
||
$ VLLM_TARGET_DEVICE=xpu python setup.py install | ||
|
||
.. note:: | ||
- FP16 is the default data type in the current XPU backend. The BF16 data | ||
type will be supported in the future. | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
# Common dependencies | ||
-r requirements-common.txt | ||
|
||
setuptools < 70.0.0 # IPEX's torch have some dependency. to be removed. | ||
|
||
torch @ https://intel-extension-for-pytorch.s3.amazonaws.com/ipex_dev/xpu/torch-2.1.0.post1%2Bcxx11.abi-cp310-cp310-linux_x86_64.whl | ||
WoosukKwon marked this conversation as resolved.
Show resolved
Hide resolved
WoosukKwon marked this conversation as resolved.
Show resolved
Hide resolved
|
||
intel_extension_for_pytorch @ https://intel-extension-for-pytorch.s3.amazonaws.com/ipex_dev/xpu/intel_extension_for_pytorch-2.1.30a0-cp310-cp310-linux_x86_64.whl | ||
oneccl_bind_pt @ https://intel-extension-for-pytorch.s3.amazonaws.com/ipex_stable/xpu/oneccl_bind_pt-2.1.200%2Bxpu-cp310-cp310-linux_x86_64.whl | ||
|
||
triton @ https://github.com/intel/intel-xpu-backend-for-triton/releases/download/v2.1.0/triton-2.1.0-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I got the following warning messages while running the benchmark:
Is this expected?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is a ccl/tp issue, still wip. will not influence single card case.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@jikunshang Do you have an update on this?