forked from vllm-project/vllm
-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
e20ae23
commit 62936e3
Showing
11 changed files
with
185 additions
and
36 deletions.
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
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,77 @@ | ||
FROM python:3.10 AS dev | ||
|
||
RUN apt-get update -y \ | ||
&& apt-get install -y python3-pip | ||
|
||
WORKDIR /workspace | ||
|
||
# install build and runtime dependencies | ||
COPY requirements-cpu.txt requirements-cpu.txt | ||
RUN --mount=type=cache,target=/root/.cache/pip \ | ||
pip install -r requirements-cpu.txt | ||
|
||
# install development dependencies | ||
COPY requirements-dev.txt requirements-dev.txt | ||
RUN --mount=type=cache,target=/root/.cache/pip \ | ||
pip install -r requirements-dev.txt | ||
|
||
# image to build pytorch extensions | ||
FROM dev AS build | ||
|
||
# install build dependencies | ||
COPY requirements-build-cpu.txt requirements-build-cpu.txt | ||
RUN --mount=type=cache,target=/root/.cache/pip \ | ||
pip install -r requirements-build-cpu.txt | ||
|
||
# copy input files | ||
COPY csrc csrc | ||
COPY setup.py setup.py | ||
COPY requirements-cpu.txt requirements-cpu.txt | ||
COPY pyproject.toml pyproject.toml | ||
COPY vllm/__init__.py vllm/__init__.py | ||
|
||
# max jobs used by Ninja to build extensions | ||
ENV MAX_JOBS=$max_jobs | ||
RUN python3 setup.py build_ext --inplace | ||
|
||
# image to run unit testing suite | ||
FROM dev AS test | ||
|
||
# copy pytorch extensions separately to avoid having to rebuild | ||
# when python code changes | ||
COPY --from=build /workspace/vllm/*.so /workspace/vllm/ | ||
COPY tests tests | ||
COPY vllm vllm | ||
|
||
ENTRYPOINT ["python3", "-m", "pytest", "tests"] | ||
|
||
# use CUDA base as CUDA runtime dependencies are already installed via pip | ||
FROM python:3.10 AS dev | ||
|
||
# libnccl required for ray | ||
RUN apt-get update -y \ | ||
&& apt-get install -y python3-pip | ||
|
||
WORKDIR /workspace | ||
COPY requirements-cpu.txt requirements-cpu.txt | ||
RUN --mount=type=cache,target=/root/.cache/pip \ | ||
pip install -r requirements-cpu.txt | ||
|
||
FROM vllm-base AS vllm | ||
COPY --from=build /workspace/vllm/*.so /workspace/vllm/ | ||
COPY vllm vllm | ||
|
||
EXPOSE 8000 | ||
ENTRYPOINT ["python3", "-m", "vllm.entrypoints.api_server"] | ||
|
||
# openai api server alternative | ||
FROM vllm-base AS vllm-openai | ||
# install additional dependencies for openai api server | ||
RUN --mount=type=cache,target=/root/.cache/pip \ | ||
pip install accelerate fschat | ||
|
||
COPY --from=build /workspace/vllm/*.so /workspace/vllm/ | ||
COPY vllm vllm | ||
|
||
ENTRYPOINT ["python3", "-m", "vllm.entrypoints.openai.api_server"] | ||
|
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
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,6 @@ | ||
# Should be mirrored in pyproject.toml | ||
ninja | ||
packaging | ||
setuptools>=49.4.0 | ||
torch @ https://download.pytorch.org/whl/cpu-cxx11-abi/torch-2.1.0%2Bcpu.cxx11.abi-cp310-cp310-linux_x86_64.whl#sha256=88f1ee550c6291af8d0417871fb7af84b86527d18bc02ac4249f07dcd84dda56 #2.1.0+cpu | ||
wheel |
File renamed without changes.
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 @@ | ||
ninja # For faster builds. | ||
psutil | ||
ray >= 2.5.1 | ||
pandas # Required for Ray data. | ||
pyarrow # Required for Ray data. | ||
sentencepiece # Required for LLaMA tokenizer. | ||
numpy | ||
einops # Required for phi-1_5 | ||
torch @ https://download.pytorch.org/whl/cpu-cxx11-abi/torch-2.1.0%2Bcpu.cxx11.abi-cp310-cp310-linux_x86_64.whl#sha256=88f1ee550c6291af8d0417871fb7af84b86527d18bc02ac4249f07dcd84dda56 #2.1.0+cpu | ||
transformers >= 4.34.0 # Required for Mistral. | ||
fastapi | ||
uvicorn[standard] | ||
pydantic == 1.10.13 # Required for OpenAI server. | ||
aioprometheus[starlette] |
File renamed without changes.
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