@tduncan / Nvidia-Optimization-Stack-VLLM Mirror · read-only / commits / 19091efc44
Fork 0

A high-throughput and memory-efficient inference and serving engine for LLMs

Mirrored from https://github.com/tduncan-lum/Nvidia-Optimization-Stack---VLLM.git

Synced Nov 16, 23:15 UTC

[ci] Setup Release pipeline and build release wheels with cache (#5610)

Signed-off-by: kevin <kevin@anyscale.com>

Kevin H. Luu committed Jun 18, 2024 at 11:00 UTC 19091efc44c6f9b1e008dc5469c63a1f01684745
2 files changed +62 -17
.buildkite/release-pipeline.yaml new
+21
@@ -0,0 +1,21 @@
1 +steps:
2 + - block: "Build wheels"
3 +
4 + - label: "Build wheel - Python {{matrix.python_version}}, CUDA {{matrix.cuda_version}}"
5 + agents:
6 + queue: cpu_queue
7 + commands:
8 + - "DOCKER_BUILDKIT=1 docker build --build-arg max_jobs=16 --build-arg USE_SCCACHE=1 --build-arg CUDA_VERSION={{matrix.cuda_version}} --build-arg PYTHON_VERSION={{matrix.python_version}} --tag vllm-ci:build-image --target build --progress plain ."
9 + - "mkdir artifacts"
10 + - "docker run --rm -v $(pwd)/artifacts:/artifacts_host vllm-ci:build-image cp -r dist /artifacts_host"
11 + - "aws s3 cp --recursive artifacts/dist s3://vllm-wheels/$BUILDKITE_COMMIT/"
12 + matrix:
13 + setup:
14 + cuda_version:
15 + - "11.8.0"
16 + - "12.1.0"
17 + python_version:
18 + - "3.8"
19 + - "3.9"
20 + - "3.10"
21 + - "3.11"
Dockerfile
+41 -17
@@ -5,9 +5,26 @@
5 # docs/source/dev/dockerfile/dockerfile.rst and
6 # docs/source/assets/dev/dockerfile-stages-dependency.png
7
8 +ARG CUDA_VERSION=12.4.1
9 #################### BASE BUILD IMAGE ####################
10 # prepare basic build environment
10 -FROM nvidia/cuda:12.4.1-devel-ubuntu22.04 AS dev
11 +FROM nvidia/cuda:${CUDA_VERSION}-devel-ubuntu22.04 AS base
12 +
13 +ARG CUDA_VERSION=12.4.1
14 +ARG PYTHON_VERSION=3
15 +
16 +ENV DEBIAN_FRONTEND=noninteractive
17 +
18 +RUN echo 'tzdata tzdata/Areas select America' | debconf-set-selections \
19 + && echo 'tzdata tzdata/Zones/America select Los_Angeles' | debconf-set-selections \
20 + && apt-get update -y \
21 + && apt-get install -y ccache software-properties-common \
22 + && add-apt-repository ppa:deadsnakes/ppa \
23 + && apt-get update -y \
24 + && apt-get install -y python${PYTHON_VERSION} python${PYTHON_VERSION}-dev python${PYTHON_VERSION}-venv python3-pip \
25 + && if [ "${PYTHON_VERSION}" != "3" ]; then update-alternatives --install /usr/bin/python3 python3 /usr/bin/python${PYTHON_VERSION} 1; fi \
26 + && python3 --version \
27 + && python3 -m pip --version
28
29 RUN apt-get update -y \
30 && apt-get install -y python3-pip git curl sudo
@@ -16,7 +33,7 @@ RUN apt-get update -y \
33 # https://github.com/pytorch/pytorch/issues/107960 -- hopefully
34 # this won't be needed for future versions of this docker image
35 # or future versions of triton.
19 -RUN ldconfig /usr/local/cuda-12.4/compat/
36 +RUN ldconfig /usr/local/cuda-$(echo $CUDA_VERSION | cut -d. -f1,2)/compat/
37
38 WORKDIR /workspace
39
@@ -24,14 +41,7 @@ WORKDIR /workspace
41 COPY requirements-common.txt requirements-common.txt
42 COPY requirements-cuda.txt requirements-cuda.txt
43 RUN --mount=type=cache,target=/root/.cache/pip \
27 - pip install -r requirements-cuda.txt
28 -
29 -# install development dependencies
30 -COPY requirements-lint.txt requirements-lint.txt
31 -COPY requirements-test.txt requirements-test.txt
32 -COPY requirements-dev.txt requirements-dev.txt
33 -RUN --mount=type=cache,target=/root/.cache/pip \
34 - pip install -r requirements-dev.txt
44 + python3 -m pip install -r requirements-cuda.txt
45
46 # cuda arch list used by torch
47 # can be useful for both `dev` and `test`
@@ -41,14 +51,16 @@ ARG torch_cuda_arch_list='7.0 7.5 8.0 8.6 8.9 9.0+PTX'
51 ENV TORCH_CUDA_ARCH_LIST=${torch_cuda_arch_list}
52 #################### BASE BUILD IMAGE ####################
53
44 -
54 #################### WHEEL BUILD IMAGE ####################
46 -FROM dev AS build
55 +FROM base AS build
56 +
57 +ARG PYTHON_VERSION=3
58
59 # install build dependencies
60 COPY requirements-build.txt requirements-build.txt
61 +
62 RUN --mount=type=cache,target=/root/.cache/pip \
51 - pip install -r requirements-build.txt
63 + python3 -m pip install -r requirements-build.txt
64
65 # install compiler cache to speed up compilation leveraging local or remote caching
66 RUN apt-get update -y && apt-get install -y ccache
@@ -101,9 +113,21 @@ RUN python3 check-wheel-size.py dist
113
114 #################### EXTENSION Build IMAGE ####################
115
116 +#################### DEV IMAGE ####################
117 +FROM base as dev
118 +
119 +COPY requirements-lint.txt requirements-lint.txt
120 +COPY requirements-test.txt requirements-test.txt
121 +COPY requirements-dev.txt requirements-dev.txt
122 +RUN --mount=type=cache,target=/root/.cache/pip \
123 + python3 -m pip install -r requirements-dev.txt
124 +
125 +#################### DEV IMAGE ####################
126 +
127 #################### vLLM installation IMAGE ####################
128 # image with vLLM installed
106 -FROM nvidia/cuda:12.4.1-base-ubuntu22.04 AS vllm-base
129 +FROM nvidia/cuda:${CUDA_VERSION}-base-ubuntu22.04 AS vllm-base
130 +ARG CUDA_VERSION=12.4.1
131 WORKDIR /vllm-workspace
132
133 RUN apt-get update -y \
@@ -113,12 +137,12 @@ RUN apt-get update -y \
137 # https://github.com/pytorch/pytorch/issues/107960 -- hopefully
138 # this won't be needed for future versions of this docker image
139 # or future versions of triton.
116 -RUN ldconfig /usr/local/cuda-12.4/compat/
140 +RUN ldconfig /usr/local/cuda-$(echo $CUDA_VERSION | cut -d. -f1,2)/compat/
141
142 # install vllm wheel first, so that torch etc will be installed
143 RUN --mount=type=bind,from=build,src=/workspace/dist,target=/vllm-workspace/dist \
144 --mount=type=cache,target=/root/.cache/pip \
121 - pip install dist/*.whl --verbose
145 + python3 -m pip install dist/*.whl --verbose
146 #################### vLLM installation IMAGE ####################
147
148
@@ -131,7 +155,7 @@ ADD . /vllm-workspace/
155
156 # install development dependencies (for testing)
157 RUN --mount=type=cache,target=/root/.cache/pip \
134 - pip install -r requirements-dev.txt
158 + python3 -m pip install -r requirements-dev.txt
159
160 # doc requires source code
161 # we hide them inside `test_docs/` , so that this source code