From 7bc94a0fddcd62d20b40390a7efb69c7a221ae5b Mon Sep 17 00:00:00 2001 From: Simon Mo Date: Thu, 28 Mar 2024 22:14:24 -0700 Subject: [PATCH] add ccache to docker build image (#3704) --- Dockerfile | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/Dockerfile b/Dockerfile index 20bbff34b7fc..a64b28edd651 100644 --- a/Dockerfile +++ b/Dockerfile @@ -35,6 +35,9 @@ COPY requirements-build.txt requirements-build.txt RUN --mount=type=cache,target=/root/.cache/pip \ pip install -r requirements-build.txt +# install compiler cache to speed up compilation leveraging local or remote caching +RUN apt-get update -y && apt-get install -y ccache + # copy input files COPY csrc csrc COPY setup.py setup.py @@ -56,7 +59,9 @@ ENV NVCC_THREADS=$nvcc_threads # make sure punica kernels are built (for LoRA) ENV VLLM_INSTALL_PUNICA_KERNELS=1 -RUN python3 setup.py build_ext --inplace +ENV CCACHE_DIR=/root/.cache/ccache +RUN --mount=type=cache,target=/root/.cache/ccache \ + python3 setup.py build_ext --inplace #################### EXTENSION Build IMAGE #################### #################### FLASH_ATTENTION Build IMAGE ####################