1- # Fetch and extract the TGI sources
1+ # Fetch and extract the TGI sources (TGI_VERSION is mandatory)
22FROM alpine AS tgi
33RUN mkdir -p /tgi
4- ADD https://github.com/huggingface/text-generation-inference/archive/refs/tags/v1.4.1 .tar.gz /tgi/sources.tar.gz
4+ ADD https://github.com/huggingface/text-generation-inference/archive/refs/tags/v2.0.2 .tar.gz /tgi/sources.tar.gz
55RUN tar -C /tgi -xf /tgi/sources.tar.gz --strip-components=1
66
77# Build cargo components (adapted from TGI original Dockerfile)
@@ -13,7 +13,6 @@ ARG CARGO_REGISTRIES_CRATES_IO_PROTOCOL=sparse
1313
1414FROM chef as planner
1515COPY --from=tgi /tgi/Cargo.toml Cargo.toml
16- COPY --from=tgi /tgi/Cargo.lock Cargo.lock
1716COPY --from=tgi /tgi/rust-toolchain.toml rust-toolchain.toml
1817COPY --from=tgi /tgi/proto proto
1918COPY --from=tgi /tgi/benchmark benchmark
@@ -33,7 +32,6 @@ COPY --from=planner /usr/src/recipe.json recipe.json
3332RUN cargo chef cook --release --recipe-path recipe.json
3433
3534COPY --from=tgi /tgi/Cargo.toml Cargo.toml
36- COPY --from=tgi /tgi/Cargo.lock Cargo.lock
3735COPY --from=tgi /tgi/rust-toolchain.toml rust-toolchain.toml
3836COPY --from=tgi /tgi/proto proto
3937COPY --from=tgi /tgi/benchmark benchmark
@@ -43,13 +41,13 @@ RUN cargo build --release --workspace --exclude benchmark
4341
4442# Fetch optimum-neuron sources
4543FROM alpine/git AS optimum-neuron
46- RUN git clone --depth 1 --branch v0.0.21 https://github.com/huggingface/optimum-neuron.git /optimum-neuron
44+ RUN git clone --depth 1 --branch v0.0.22 https://github.com/huggingface/optimum-neuron.git /optimum-neuron
4745
4846# Python base image
4947FROM ubuntu:22.04 AS base
5048
5149RUN apt-get update -y \
52- && apt-get install -y --no-install-recommends \
50+ && apt-get install -y --no-install-recommends \
5351 python3-pip \
5452 python3-setuptools \
5553 python-is-python3 \
@@ -61,7 +59,7 @@ RUN pip3 --no-cache-dir install --upgrade pip
6159FROM base AS pyserver
6260
6361RUN apt-get update -y \
64- && apt-get install -y --no-install-recommends \
62+ && apt-get install -y --no-install-recommends \
6563 make \
6664 python3-venv \
6765 && rm -rf /var/lib/apt/lists/* \
@@ -79,9 +77,10 @@ FROM base AS neuron
7977
8078# Install system prerequisites
8179RUN apt-get update -y \
82- && apt-get install -y --no-install-recommends \
80+ && apt-get install -y --no-install-recommends \
8381 gnupg2 \
8482 wget \
83+ python3-dev \
8584 && rm -rf /var/lib/apt/lists/* \
8685 && apt-get clean
8786
@@ -90,7 +89,7 @@ RUN wget -qO - https://apt.repos.neuron.amazonaws.com/GPG-PUB-KEY-AMAZON-AWS-NEU
9089
9190# Install neuronx packages
9291RUN apt-get update -y \
93- && apt-get install -y --no-install-recommends \
92+ && apt-get install -y --no-install-recommends \
9493 aws-neuronx-dkms=2.16.7.0 \
9594 aws-neuronx-collectives=2.20.22.0-c101c322e \
9695 aws-neuronx-runtime-lib=2.20.22.0-1b3ca6425 \
@@ -102,13 +101,13 @@ ENV PATH="/opt/bin/:/opt/aws/neuron/bin:${PATH}"
102101
103102RUN pip3 install \
104103 neuronx-cc==2.13.66.0 \
105- torch-neuronx==1.13.1.1.14 .0 \
104+ torch-neuronx==2.1.2.2.1 .0 \
106105 transformers-neuronx==0.10.0.21 \
107106 --extra-index-url=https://pip.repos.neuron.amazonaws.com
108107
109108# Install HuggingFace packages
110109RUN pip3 install \
111- hf_transfer
110+ hf_transfer huggingface_hub
112111
113112# Install optimum-neuron
114113COPY --from=optimum-neuron /optimum-neuron optimum-neuron
@@ -152,13 +151,13 @@ RUN HOME_DIR=/root && \
152151 rm -rf ${HOME_DIR}/oss_compliance*
153152
154153RUN echo "N.B.: Although this image is released under the Apache-2.0 License, the Dockerfile used to build the image \
155- has an indirect documentation dependency on third party <docutils/tools/editors/emacs/rst.el> project. The \
156- <docutils/tools/editors/emacs/rst.el> project's licensing includes the <GPL v3> license. \
157- \n\n \
158- N.B.: Although this image is released under the Apache-2.0 License, the Dockerfile used to build the image uses the \
159- third party <Text Generation Inference (TGI)> project. The <Text Generation Inference (TGI)> project's licensing \
160- includes the <HFOIL --> https://github.com/huggingface/text-generation-inference/blob/main/LICENSE> \
161- license." > /root/THIRD_PARTY_LICENSES
154+ has an indirect documentation dependency on third party <docutils/tools/editors/emacs/rst.el> project. The \
155+ <docutils/tools/editors/emacs/rst.el> project's licensing includes the <GPL v3> license. \
156+ \n\n \
157+ N.B.: Although this image is released under the Apache-2.0 License, the Dockerfile used to build the image uses the \
158+ third party <Text Generation Inference (TGI)> project. The <Text Generation Inference (TGI)> project's licensing \
159+ includes the <HFOIL --> https://github.com/huggingface/text-generation-inference/blob/main/LICENSE> \
160+ license." > /root/THIRD_PARTY_LICENSES
162161
163162LABEL dlc_major_version="1"
164163LABEL com.amazonaws.ml.engines.sagemaker.dlc.framework.huggingface.tgi="true"
0 commit comments