mirror of
https://github.com/huggingface/text-generation-inference.git
synced 2025-09-11 12:24:53 +00:00
misc(ci): attempt to fix sccache not building trtllm
This commit is contained in:
parent
edfafeb46c
commit
a4d069fe07
@ -88,8 +88,6 @@ ENV CMAKE_PREFIX_PATH="/usr/local/mpi:/usr/local/tensorrt:$CMAKE_PREFIX_PATH"
|
||||
|
||||
ENV USE_LLD_LINKER=ON
|
||||
ENV CUDA_ARCH_LIST=${cuda_arch_list}
|
||||
ENV CMAKE_CXX_COMPILER_LAUNCHER=sccache
|
||||
ENV RUSTC_WRAPPER=sccache
|
||||
ENV IS_GHA_BUILD=${is_gha_build}
|
||||
|
||||
COPY Cargo.lock Cargo.lock
|
||||
@ -104,7 +102,10 @@ 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} && \
|
||||
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 \
|
||||
CMAKE_CXX_COMPILER_LAUNCHER=sccache \
|
||||
RUSTC_WRAPPER=sccache \
|
||||
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
|
||||
|
@ -4,15 +4,15 @@ if (NOT DEFINED CMAKE_CXX_COMPILER_LAUNCHER)
|
||||
find_program(CCACHE_EXECUTABLE "ccache")
|
||||
if (CCACHE_EXECUTABLE)
|
||||
message(STATUS "Using ccache")
|
||||
set(CMAKE_C_COMPILER_LAUNCHER ${CCACHE_EXECUTABLE})
|
||||
set(CMAKE_CXX_COMPILER_LAUNCHER ${CCACHE_EXECUTABLE})
|
||||
set(CMAKE_CUDA_COMPILER_LAUNCHER ${CCACHE_EXECUTABLE})
|
||||
set(CMAKE_C_COMPILER_LAUNCHER "${CCACHE_EXECUTABLE}")
|
||||
set(CMAKE_CXX_COMPILER_LAUNCHER "${CCACHE_EXECUTABLE}")
|
||||
set(CMAKE_CUDA_COMPILER_LAUNCHER "${CCACHE_EXECUTABLE}")
|
||||
endif ()
|
||||
else ()
|
||||
message(STATUS "Using user specified cmake cxx compiler launcher: ${CMAKE_CXX_COMPILER_LAUNCHER}")
|
||||
set(CMAKE_C_COMPILER_LAUNCHER ${CMAKE_CXX_COMPILER_LAUNCHER})
|
||||
set(CMAKE_CXX_COMPILER_LAUNCHER ${CMAKE_CXX_COMPILER_LAUNCHER})
|
||||
set(CMAKE_CUDA_COMPILER_LAUNCHER ${CMAKE_CXX_COMPILER_LAUNCHER})
|
||||
set(CMAKE_C_COMPILER_LAUNCHER "${CMAKE_CXX_COMPILER_LAUNCHER}")
|
||||
set(CMAKE_CXX_COMPILER_LAUNCHER "${CMAKE_CXX_COMPILER_LAUNCHER}")
|
||||
set(CMAKE_CUDA_COMPILER_LAUNCHER "${CMAKE_CXX_COMPILER_LAUNCHER}")
|
||||
endif ()
|
||||
|
||||
if (CMAKE_VERSION VERSION_GREATER_EQUAL "3.24.0")
|
||||
|
@ -117,13 +117,6 @@ fn build_backend(is_debug: bool, opt_level: &str, out_dir: &PathBuf) -> (PathBuf
|
||||
config.define("TGI_TRTLLM_BACKEND_BUILD_TESTS", "ON");
|
||||
}
|
||||
|
||||
if let Some(wrapper) = option_env!("RUSTC_WRAPPER") {
|
||||
if wrapper == "sccache" {
|
||||
println!("cargo:warning=Using caching tool: {wrapper}");
|
||||
config.define("CMAKE_CXX_COMPILER_LAUNCHER", wrapper);
|
||||
}
|
||||
}
|
||||
|
||||
if option_env!("USE_LLD_LINKER").is_some() {
|
||||
println!("cargo:warning=Using lld linker");
|
||||
config.define("TGI_TRTLLM_BACKEND_BUILD_USE_LLD", "ON");
|
||||
@ -144,6 +137,7 @@ fn build_backend(is_debug: bool, opt_level: &str, out_dir: &PathBuf) -> (PathBuf
|
||||
}
|
||||
|
||||
if let Some(cxx_compiler_launcher) = option_env!("CMAKE_CXX_COMPILER_LAUNCHER") {
|
||||
println!("cargo:warning=Using caching tool: {cxx_compiler_launcher}");
|
||||
config.define("CMAKE_CXX_COMPILER_LAUNCHER", cxx_compiler_launcher);
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user