Skip to content

Commit

Permalink
misc(backend): let's actually cache things now
Browse files Browse the repository at this point in the history
  • Loading branch information
mfuntowicz committed Dec 20, 2024
1 parent 6da97ae commit 6790cd6
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 3 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/build_trtllm.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ jobs:
- name: Extract TensorRT-LLM version
run: |
echo "TENSORRT_LLM_VERSION=$(grep -oP '([a-z,0-9]{40})' $GITHUB_WORKSPACE/backends/trtllm/cmake/trtllm.cmake)" >> $GITHUB_ENV
echo "TensorRT-LLM version: $TENSORRT_LLM_VERSION"
echo "TensorRT-LLM version: ${{ env.TENSORRT_LLM_VERSION }}"
- name: "Configure AWS Credentials"
id: aws-creds
Expand Down
3 changes: 2 additions & 1 deletion Dockerfile_trtllm
Original file line number Diff line number Diff line change
Expand Up @@ -91,13 +91,14 @@ ENV IS_GHA_BUILD ${is_gha_build}
ENV LD_LIBRARY_PATH="/usr/local/mpi/lib:$LD_LIBRARY_PATH"
ENV PKG_CONFIG_PATH="/usr/local/mpi/lib/pkgconfig:$PKG_CONFIG_PATH"

Check warning on line 92 in Dockerfile_trtllm

View workflow job for this annotation

GitHub Actions / build

Variables should be defined before their use

UndefinedVar: Usage of undefined variable '$PKG_CONFIG_PATH' More info: https://docs.docker.com/go/dockerfile/rule/undefined-var/
ENV USE_LLD_LINKER=ON
ENV RUSTC_WRAPPER=sccache

COPY . .
COPY --from=trt-builder /usr/local/tensorrt /usr/local/tensorrt
COPY --from=mpi-builder /usr/local/mpi /usr/local/mpi
RUN mkdir $TGI_INSTALL_PREFIX && mkdir "$TGI_INSTALL_PREFIX/include" && mkdir "$TGI_INSTALL_PREFIX/lib" && \
python3 backends/trtllm/scripts/setup_sccache.py --is-gha-build ${IS_GHA_BUILD} && \
RUSTC_WRAPPER=sccache CMAKE_INSTALL_PREFIX=$TGI_INSTALL_PREFIX cargo build --profile ${build_type} --package text-generation-backends-trtllm --bin text-generation-backends-trtllm && \
CMAKE_INSTALL_PREFIX=$TGI_INSTALL_PREFIX cargo build --profile ${build_type} --package text-generation-backends-trtllm --bin text-generation-backends-trtllm && \
sccache --show-stats

FROM nvidia/cuda:12.6.3-cudnn-runtime-ubuntu24.04 AS runtime
Expand Down
3 changes: 2 additions & 1 deletion backends/trtllm/build.rs
Original file line number Diff line number Diff line change
Expand Up @@ -119,7 +119,8 @@ fn build_backend(is_debug: bool, opt_level: &str, out_dir: &PathBuf) -> (PathBuf

if let Some(wrapper) = option_env!("RUSTC_WRAPPER") {
if wrapper == "sccache" {
config.define("CMAKE_CXX_COMPILER_LAUNCHER", "sccache");
println!("cargo:warning=Using caching tool: {wrapper}");
config.define("CMAKE_CXX_COMPILER_LAUNCHER", wrapper);
}
}

Expand Down

0 comments on commit 6790cd6

Please sign in to comment.