@tduncan / Nvidia-Optimization-Stack-VLLM Mirror · read-only / commits / a2c71c5405
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, 10:45 UTC

[CI/Build] remove .github from .dockerignore, add dirty repo check (#9375)

Daniele committed Oct 17, 2024 at 19:25 UTC a2c71c5405fdd8822956bcd785e72149c1cfb655
12 files changed +54 -17
.buildkite/release-pipeline.yaml
+2 -2
@@ -3,7 +3,7 @@ steps:
3 agents:
4 queue: cpu_queue
5 commands:
6 - - "DOCKER_BUILDKIT=1 docker build --build-arg max_jobs=16 --build-arg USE_SCCACHE=1 --build-arg CUDA_VERSION=12.1.0 --tag vllm-ci:build-image --target build --progress plain ."
6 + - "DOCKER_BUILDKIT=1 docker build --build-arg max_jobs=16 --build-arg USE_SCCACHE=1 --build-arg GIT_REPO_CHECK=1 --build-arg CUDA_VERSION=12.1.0 --tag vllm-ci:build-image --target build --progress plain ."
7 - "mkdir artifacts"
8 - "docker run --rm -v $(pwd)/artifacts:/artifacts_host vllm-ci:build-image bash -c 'cp -r dist /artifacts_host && chmod -R a+rw /artifacts_host'"
9 # rename the files to change linux -> manylinux1
@@ -22,7 +22,7 @@ steps:
22 agents:
23 queue: cpu_queue
24 commands:
25 - - "DOCKER_BUILDKIT=1 docker build --build-arg max_jobs=16 --build-arg USE_SCCACHE=1 --build-arg CUDA_VERSION=11.8.0 --tag vllm-ci:build-image --target build --progress plain ."
25 + - "DOCKER_BUILDKIT=1 docker build --build-arg max_jobs=16 --build-arg USE_SCCACHE=1 --build-arg GIT_REPO_CHECK=1 --build-arg CUDA_VERSION=11.8.0 --tag vllm-ci:build-image --target build --progress plain ."
26 - "mkdir artifacts"
27 - "docker run --rm -v $(pwd)/artifacts:/artifacts_host vllm-ci:build-image bash -c 'cp -r dist /artifacts_host && chmod -R a+rw /artifacts_host'"
28 # rename the files to change linux -> manylinux1
.dockerignore
-1
@@ -1,4 +1,3 @@
1 -/.github/
1 /.venv
2 /build
3 dist
.github/workflows/scripts/build.sh
+4
@@ -1,4 +1,5 @@
1 #!/bin/bash
2 +set -eux
3
4 python_executable=python$1
5 cuda_home=/usr/local/cuda-$2
@@ -15,5 +16,8 @@ export MAX_JOBS=1
16 # Make sure release wheels are built for the following architectures
17 export TORCH_CUDA_ARCH_LIST="7.0 7.5 8.0 8.6 8.9 9.0+PTX"
18 export VLLM_FA_CMAKE_GPU_ARCHES="80-real;90-real"
19 +
20 +bash tools/check_repo.sh
21 +
22 # Build
23 $python_executable setup.py bdist_wheel --dist-dir=dist
Dockerfile
+3 -1
@@ -70,8 +70,10 @@ COPY requirements-build.txt requirements-build.txt
70 RUN --mount=type=cache,target=/root/.cache/pip \
71 python3 -m pip install -r requirements-build.txt
72
73 -# files and directories related to build wheels
73 COPY . .
74 +ARG GIT_REPO_CHECK=0
75 +RUN --mount=type=bind,source=.git,target=.git \
76 + if [ "$GIT_REPO_CHECK" != 0 ]; then bash tools/check_repo.sh ; fi
77
78 # max jobs used by Ninja to build extensions
79 ARG max_jobs=2
Dockerfile.cpu
+4 -1
@@ -42,7 +42,10 @@ RUN --mount=type=cache,target=/root/.cache/pip \
42 --mount=type=bind,src=requirements-cpu.txt,target=requirements-cpu.txt \
43 pip install -v -r requirements-cpu.txt
44
45 -COPY ./ ./
45 +COPY . .
46 +ARG GIT_REPO_CHECK=0
47 +RUN --mount=type=bind,source=.git,target=.git \
48 + if [ "$GIT_REPO_CHECK" != 0 ]; then bash tools/check_repo.sh ; fi
49
50 # Support for building with non-AVX512 vLLM: docker build --build-arg VLLM_CPU_DISABLE_AVX512="true" ...
51 ARG VLLM_CPU_DISABLE_AVX512
Dockerfile.neuron
+7 -7
@@ -17,7 +17,7 @@ RUN apt-get update && \
17 # When launching the container, mount the code directory to /app
18 ARG APP_MOUNT=/app
19 VOLUME [ ${APP_MOUNT} ]
20 -WORKDIR ${APP_MOUNT}
20 +WORKDIR ${APP_MOUNT}/vllm
21
22 RUN python3 -m pip install --upgrade pip
23 RUN python3 -m pip install --no-cache-dir fastapi ninja tokenizers pandas
@@ -25,17 +25,17 @@ RUN python3 -m pip install sentencepiece transformers==4.36.2 -U
25 RUN python3 -m pip install transformers-neuronx --extra-index-url=https://pip.repos.neuron.amazonaws.com -U
26 RUN python3 -m pip install --pre neuronx-cc==2.15.* --extra-index-url=https://pip.repos.neuron.amazonaws.com -U
27
28 -COPY . /app/vllm
28 +COPY . .
29 +ARG GIT_REPO_CHECK=0
30 +RUN --mount=type=bind,source=.git,target=.git \
31 + if [ "$GIT_REPO_CHECK" != 0 ]; then bash tools/check_repo.sh ; fi
32
30 -RUN cd /app/vllm \
31 - && python3 -m pip install -U \
33 +RUN python3 -m pip install -U \
34 cmake>=3.26 ninja packaging setuptools-scm>=8 wheel jinja2 \
35 -r requirements-neuron.txt
36
37 ENV VLLM_TARGET_DEVICE neuron
38 RUN --mount=type=bind,source=.git,target=.git \
37 - cd /app/vllm \
38 - && pip install --no-build-isolation -v -e . \
39 - && cd ..
39 + pip install --no-build-isolation -v -e . \
40
41 CMD ["/bin/bash"]
Dockerfile.openvino
+3
@@ -10,6 +10,9 @@ RUN apt-get update -y && \
10 WORKDIR /workspace
11
12 COPY . .
13 +ARG GIT_REPO_CHECK=0
14 +RUN --mount=type=bind,source=.git,target=.git \
15 + if [ "$GIT_REPO_CHECK" != 0 ]; then bash tools/check_repo.sh ; fi
16
17 # install build requirements
18 RUN PIP_EXTRA_INDEX_URL="https://download.pytorch.org/whl/cpu" python3 -m pip install -r /workspace/vllm/requirements-build.txt
Dockerfile.ppc64le
+3
@@ -14,6 +14,9 @@ RUN micromamba install -y -n base -c https://ftp.osuosl.org/pub/open-ce/1.11.0-p
14 COPY ./ /workspace/vllm
15
16 WORKDIR /workspace/vllm
17 +ARG GIT_REPO_CHECK=0
18 +RUN --mount=type=bind,source=.git,target=.git \
19 + if [ "$GIT_REPO_CHECK" != 0 ]; then bash tools/check_repo.sh; fi
20
21 # These packages will be in rocketce eventually
22 RUN --mount=type=cache,target=/root/.cache/pip \
Dockerfile.rocm
+3
@@ -117,6 +117,9 @@ RUN --mount=type=cache,target=${CCACHE_DIR} \
117 FROM base AS final
118 # Import the vLLM development directory from the build context
119 COPY . .
120 +ARG GIT_REPO_CHECK=0
121 +RUN --mount=type=bind,source=.git,target=.git \
122 + if [ "$GIT_REPO_CHECK" != 0 ]; then bash tools/check_repo.sh ; fi
123
124 # Package upgrades for useful functionality or to avoid dependency issues
125 RUN --mount=type=cache,target=/root/.cache/pip \
Dockerfile.tpu
+7 -4
@@ -2,7 +2,7 @@ ARG NIGHTLY_DATE="20240828"
2 ARG BASE_IMAGE="us-central1-docker.pkg.dev/tpu-pytorch-releases/docker/xla:nightly_3.10_tpuvm_$NIGHTLY_DATE"
3
4 FROM $BASE_IMAGE
5 -WORKDIR /workspace
5 +WORKDIR /workspace/vllm
6
7 # Install some basic utilities
8 RUN apt-get update && apt-get install -y \
@@ -16,14 +16,17 @@ RUN --mount=type=cache,target=/root/.cache/pip \
16 python3 -m pip install torch_xla[pallas] -f https://storage.googleapis.com/jax-releases/jax_nightly_releases.html -f https://storage.googleapis.com/jax-releases/jaxlib_nightly_releases.html
17
18 # Build vLLM.
19 -COPY . /workspace/vllm
19 +COPY . .
20 +ARG GIT_REPO_CHECK=0
21 +RUN --mount=type=bind,source=.git,target=.git \
22 + if [ "$GIT_REPO_CHECK" != 0 ]; then bash tools/check_repo.sh; fi
23 +
24 ENV VLLM_TARGET_DEVICE="tpu"
25 RUN --mount=type=cache,target=/root/.cache/pip \
26 --mount=type=bind,source=.git,target=.git \
23 - cd /workspace/vllm && \
27 python3 -m pip install \
28 cmake>=3.26 ninja packaging setuptools-scm>=8 wheel jinja2 \
29 -r requirements-tpu.txt
27 -RUN cd /workspace/vllm && python3 setup.py develop
30 +RUN python3 setup.py develop
31
32 CMD ["/bin/bash"]
Dockerfile.xpu
+4 -1
@@ -33,7 +33,10 @@ RUN --mount=type=cache,target=/root/.cache/pip \
33 --extra-index-url https://pytorch-extension.intel.com/release-whl/stable/xpu/us/ \
34 -r requirements-xpu.txt
35
36 -COPY ./ /workspace/vllm
36 +COPY . .
37 +ARG GIT_REPO_CHECK
38 +RUN --mount=type=bind,source=.git,target=.git \
39 + if [ "$GIT_REPO_CHECK" != 0 ]; then bash tools/check_repo.sh; fi
40
41 ENV VLLM_TARGET_DEVICE=xpu
42
tools/check_repo.sh new
+14
@@ -0,0 +1,14 @@
1 +#!/bin/bash
2 +# Checks whether the repo is clean and whether tags are available (necessary to correctly produce vllm version at build time)
3 +
4 +if ! git diff --quiet; then
5 + echo "Repo is dirty" >&2
6 +
7 + exit 1
8 +fi
9 +
10 +if ! git describe --tags; then
11 + echo "No tags are present. Is this a shallow clone? git fetch --unshallow --tags" >&2
12 +
13 + exit 1
14 +fi