(docker) let's put rust in the TRTLLM folder when building

This commit is contained in:
Morgan Funtowicz 2024-07-31 09:06:11 +00:00
parent 6e564a30a2
commit ae66cf5593
1 changed files with 4 additions and 3 deletions

View File

@ -3,7 +3,7 @@ ARG OMPI_VERSION="4.1.6"
# Build dependencies resolver stage # Build dependencies resolver stage
FROM lukemathwalker/cargo-chef:latest AS chef FROM lukemathwalker/cargo-chef:latest AS chef
WORKDIR /usr/src/text-generation-inference WORKDIR /usr/src/text-generation-inference/backends/trtllm
FROM chef AS planner FROM chef AS planner
COPY . . COPY . .
@ -66,7 +66,7 @@ ENV PATH="/root/.cargo/bin:$PATH"
RUN cargo install cargo-chef RUN cargo install cargo-chef
# Cache dependencies # Cache dependencies
COPY --from=planner /usr/src/text-generation-inference/recipe.json . COPY --from=planner /usr/src/text-generation-inference/backends/trtllm/recipe.json .
RUN cargo chef cook --release --recipe-path recipe.json RUN cargo chef cook --release --recipe-path recipe.json
# Build actual TGI # Build actual TGI
@ -79,7 +79,8 @@ COPY . .
COPY --from=trt-builder /usr/local/tensorrt /usr/local/tensorrt COPY --from=trt-builder /usr/local/tensorrt /usr/local/tensorrt
COPY --from=mpi-builder /usr/local/mpi /usr/local/mpi 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" && \ RUN mkdir $TGI_INSTALL_PREFIX && mkdir "$TGI_INSTALL_PREFIX/include" && mkdir "$TGI_INSTALL_PREFIX/lib" && \
CMAKE_INSTALL_PREFIX=$TGI_INSTALL_PREFIX cargo build --release --bin text-generation-backends-trtllm cd backends/trtllm && \
CMAKE_INSTALL_PREFIX=$TGI_INSTALL_PREFIX cargo build --release
FROM nvidia/cuda:12.5.1-cudnn-runtime-ubuntu22.04 AS runtime FROM nvidia/cuda:12.5.1-cudnn-runtime-ubuntu22.04 AS runtime
WORKDIR /usr/local/tgi/bin WORKDIR /usr/local/tgi/bin