|
10 | 10 | FROM nvidia/cuda:12.4.1-devel-ubuntu22.04 AS dev
|
11 | 11 |
|
12 | 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 | 14 |
|
15 | 15 | # Workaround for https://github.com/openai/triton/issues/2507 and
|
16 | 16 | # https://github.com/pytorch/pytorch/issues/107960 -- hopefully
|
@@ -70,10 +70,28 @@ ENV NVCC_THREADS=$nvcc_threads
|
70 | 70 | # make sure punica kernels are built (for LoRA)
|
71 | 71 | ENV VLLM_INSTALL_PUNICA_KERNELS=1
|
72 | 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 | + |
73 | 89 | ENV CCACHE_DIR=/root/.cache/ccache
|
74 | 90 | RUN --mount=type=cache,target=/root/.cache/ccache \
|
75 | 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 |
77 | 95 |
|
78 | 96 | # check the size of the wheel, we cannot upload wheels larger than 100MB
|
79 | 97 | COPY .buildkite/check-wheel-size.py check-wheel-size.py
|
|
0 commit comments