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] Use sccache to build images (#5419)
Signed-off-by: kevin <kevin@anyscale.com>
Kevin H. Luu committed
Jun 12, 2024 at 17:58 UTC
916d219d62e9e4005e10be23f81d881afdb8d6d0
3 files changed
+22
-4
.buildkite/test-template-aws.j2
+1
-1
@@ -7,7 +7,7 @@ steps:
7
queue: cpu_queue
8
commands:
9
- "aws ecr-public get-login-password --region us-east-1 | docker login --username AWS --password-stdin public.ecr.aws/q9t5s3a7"
10
- - "docker build --build-arg max_jobs=16 --tag {{ docker_image }} --target test --progress plain ."
10
+ - "docker build --build-arg max_jobs=16 --build-arg USE_SCCACHE=1 --tag {{ docker_image }} --target test --progress plain ."
11
- "docker push {{ docker_image }}"
12
env:
13
DOCKER_BUILDKIT: "1"
Dockerfile
+20
-2
@@ -10,7 +10,7 @@
10
FROM nvidia/cuda:12.4.1-devel-ubuntu22.04 AS dev
11
12
RUN apt-get update -y \
13
- && apt-get install -y python3-pip git
13
+ && apt-get install -y python3-pip git curl sudo
14
15
# Workaround for https://github.com/openai/triton/issues/2507 and
16
# https://github.com/pytorch/pytorch/issues/107960 -- hopefully
@@ -70,10 +70,28 @@ ENV NVCC_THREADS=$nvcc_threads
70
# make sure punica kernels are built (for LoRA)
71
ENV VLLM_INSTALL_PUNICA_KERNELS=1
72
73
+ARG USE_SCCACHE
74
+# if USE_SCCACHE is set, use sccache to speed up compilation
75
+RUN --mount=type=cache,target=/root/.cache/pip \
76
+ if [ "$USE_SCCACHE" = "1" ]; then \
77
+ echo "Installing sccache..." \
78
+ && curl -L -o sccache.tar.gz https://github.com/mozilla/sccache/releases/download/v0.8.1/sccache-v0.8.1-x86_64-unknown-linux-musl.tar.gz \
79
+ && tar -xzf sccache.tar.gz \
80
+ && sudo mv sccache-v0.8.1-x86_64-unknown-linux-musl/sccache /usr/bin/sccache \
81
+ && rm -rf sccache.tar.gz sccache-v0.8.1-x86_64-unknown-linux-musl \
82
+ && export SCCACHE_BUCKET=vllm-build-sccache \
83
+ && export SCCACHE_REGION=us-west-2 \
84
+ && sccache --show-stats \
85
+ && python3 setup.py bdist_wheel --dist-dir=dist \
86
+ && sccache --show-stats; \
87
+ fi
88
+
89
ENV CCACHE_DIR=/root/.cache/ccache
90
RUN --mount=type=cache,target=/root/.cache/ccache \
91
--mount=type=cache,target=/root/.cache/pip \
76
- python3 setup.py bdist_wheel --dist-dir=dist
92
+ if [ "$USE_SCCACHE" != "1" ]; then \
93
+ python3 setup.py bdist_wheel --dist-dir=dist; \
94
+ fi
95
96
# check the size of the wheel, we cannot upload wheels larger than 100MB
97
COPY .buildkite/check-wheel-size.py check-wheel-size.py
setup.py
+1
-1
@@ -140,6 +140,7 @@ class cmake_build_ext(build_ext):
140
cmake_args += [
141
'-DCMAKE_CXX_COMPILER_LAUNCHER=sccache',
142
'-DCMAKE_CUDA_COMPILER_LAUNCHER=sccache',
143
+ '-DCMAKE_C_COMPILER_LAUNCHER=sccache',
144
]
145
elif is_ccache_available():
146
cmake_args += [
@@ -171,7 +172,6 @@ class cmake_build_ext(build_ext):
172
else:
173
# Default build tool to whatever cmake picks.
174
build_tool = []
174
-
175
subprocess.check_call(
176
['cmake', ext.cmake_lists_dir, *build_tool, *cmake_args],
177
cwd=self.build_temp)