-
-
Notifications
You must be signed in to change notification settings - Fork 7.7k
[Bugfix][Intel] Fix XPU Dockerfile Build #7824
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
Merged
Merged
Changes from all commits
Commits
Show all changes
34 commits
Select commit
Hold shift + click to select a range
0d94a73
Update requirements-xpu.txt
tylertitsworth 94f6c0f
Update Dockerfile.xpu
tylertitsworth 87f2ae9
Update Dockerfile.xpu
tylertitsworth 8c2ac7f
Update Dockerfile.xpu
tylertitsworth 405ba25
update dockerfile
d2b2cae
closer to build
8501045
Merge branch 'vllm-project:main' into main
tylertitsworth 1a1dbad
Merge branch 'vllm-project:main' into main
tylertitsworth 3b140cc
update interface
7ccc035
fix platform spec
ac335d4
Update xpu.py
tylertitsworth 6899720
Update __init__.py
tylertitsworth 8a6eecf
Update .dockerignore
tylertitsworth 60743aa
uncap tiktoken
b14a869
bump oneapi
916144e
Merge branch 'vllm-project:main' into main
tylertitsworth 0d5c597
remove openai server support
tylertitsworth f6c9577
remove unecessary reqs
tylertitsworth 1df6d83
Merge branch 'vllm-project:main' into main
tylertitsworth d8ad520
Merge branch 'main' into main
tylertitsworth cc3df2f
update ipex versions
98f14b8
fix lint error
61a5506
Merge branch 'vllm-project:main' into main
tylertitsworth ea3a728
Merge branch 'main' into main
tylertitsworth 55ad39e
Update Dockerfile.xpu
tylertitsworth 843278e
Merge branch 'main' into main
tylertitsworth cbbd0f4
fix lint and build errors
2f4f8e9
Update xpu.py
tylertitsworth 17adb23
isort xpu.py
73060af
yapf xpu.py (this formatting sucks)
e01fa0a
address pr comments
be5646e
Merge branch 'vllm-project:main' into main
tylertitsworth 1429aba
Update run-xpu-test.sh
tylertitsworth c901ecf
Merge branch 'main' into xpu-main
youkaichao 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 hidden or 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 hidden or 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 |
---|---|---|
@@ -1,4 +1,6 @@ | ||
vllm/*.so | ||
/.github/ | ||
/.venv | ||
/build | ||
dist | ||
Dockerfile* | ||
vllm/*.so |
This file contains hidden or 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 |
---|---|---|
@@ -1,4 +1,4 @@ | ||
FROM intel/oneapi-basekit:2024.2.1-0-devel-ubuntu22.04 | ||
FROM intel/oneapi-basekit:2024.2.1-0-devel-ubuntu22.04 AS vllm-base | ||
|
||
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 && \ | ||
|
@@ -7,20 +7,49 @@ RUN wget -O- https://apt.repos.intel.com/intel-gpg-keys/GPG-PUB-KEY-INTEL-SW-PRO | |
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 ffmpeg libsm6 libxext6 libgl1 | ||
|
||
COPY ./ /workspace/vllm | ||
RUN apt-get update -y && \ | ||
apt-get install -y --no-install-recommends --fix-missing \ | ||
curl \ | ||
ffmpeg \ | ||
git \ | ||
libsndfile1 \ | ||
libsm6 \ | ||
libxext6 \ | ||
libgl1 \ | ||
lsb-release \ | ||
numactl \ | ||
python3 \ | ||
python3-dev \ | ||
python3-pip \ | ||
# vim \ | ||
wget | ||
|
||
WORKDIR /workspace/vllm | ||
COPY requirements-xpu.txt /workspace/vllm/requirements-xpu.txt | ||
COPY requirements-common.txt /workspace/vllm/requirements-common.txt | ||
|
||
RUN --mount=type=cache,target=/root/.cache/pip \ | ||
pip install -v --extra-index-url https://pytorch-extension.intel.com/release-whl/stable/xpu/us/ \ | ||
cmake>=3.26 ninja packaging setuptools-scm>=8 wheel jinja2 \ | ||
-r requirements-xpu.txt | ||
pip install --no-cache-dir \ | ||
--extra-index-url https://pytorch-extension.intel.com/release-whl/stable/xpu/us/ \ | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
|
||
-r requirements-xpu.txt | ||
|
||
COPY ./ /workspace/vllm | ||
|
||
ENV VLLM_TARGET_DEVICE=xpu | ||
|
||
RUN --mount=type=cache,target=/root/.cache/pip \ | ||
--mount=type=bind,source=.git,target=.git \ | ||
VLLM_TARGET_DEVICE=xpu python3 setup.py install | ||
python3 setup.py install | ||
|
||
CMD ["/bin/bash"] | ||
|
||
tylertitsworth marked this conversation as resolved.
Show resolved
Hide resolved
|
||
FROM vllm-base AS vllm-openai | ||
|
||
# install additional dependencies for openai api server | ||
RUN --mount=type=cache,target=/root/.cache/pip \ | ||
pip install accelerate hf_transfer 'modelscope!=1.15.0' | ||
|
||
ENV VLLM_USAGE_SOURCE production-docker-image \ | ||
TRITON_XPU_PROFILE 1 | ||
|
||
ENTRYPOINT ["python3", "-m", "vllm.entrypoints.openai.api_server"] |
This file contains hidden or 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 hidden or 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 hidden or 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 hidden or 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 hidden or 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 hidden or 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,20 @@ | ||
import torch | ||
|
||
from .interface import DeviceCapability, Platform, PlatformEnum | ||
|
||
|
||
class XPUPlatform(Platform): | ||
_enum = PlatformEnum.XPU | ||
|
||
@staticmethod | ||
def get_device_capability(device_id: int = 0) -> DeviceCapability: | ||
return DeviceCapability(major=int( | ||
torch.xpu.get_device_capability(device_id)['version'].split('.') | ||
[0]), | ||
minor=int( | ||
torch.xpu.get_device_capability(device_id) | ||
['version'].split('.')[1])) | ||
|
||
@staticmethod | ||
def get_device_name(device_id: int = 0) -> str: | ||
return torch.xpu.get_device_name(device_id) |
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.
Uh oh!
There was an error while loading. Please reload this page.