-
Notifications
You must be signed in to change notification settings - Fork 68
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
dd03899
commit 4e36594
Showing
2 changed files
with
59 additions
and
23 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -12,21 +12,28 @@ | |
FROM ubuntu:22.04 | ||
ARG djl_version | ||
ARG djl_serving_version | ||
ARG python_version=3.10 | ||
|
||
# PyTorch and Vision | ||
ARG torch_version=2.1.2 | ||
ARG torchvision_version=0.16.2 | ||
ARG python_version=3.10 | ||
ARG neuronsdk_version=2.20.2 | ||
ARG torch_neuronx_version=2.1.2.2.3.2 | ||
ARG transformers_neuronx_version=0.12.313 | ||
ARG neuronx_distributed_version=0.9.0 | ||
ARG neuronx_cc_version=2.15.143.0 | ||
ARG neuronx_cc_stubs_version=2.15.143.0 | ||
ARG torch_xla_version=2.1.5 | ||
|
||
# Neuron SDK components | ||
ARG neuronsdk_version=2.21.0 | ||
ARG torch_neuronx_version=2.1.2.2.4.0 | ||
ARG transformers_neuronx_version=0.13.322 | ||
ARG neuronx_distributed_version=0.10.0 | ||
ARG neuronx_distributed_inference_version=0.1.0 | ||
ARG neuronx_cc_version=2.16.345.0 | ||
ARG neuronx_cc_stubs_version=2.16.345.0 | ||
ARG torch_xla_version=2.1.6 | ||
ARG libneuronxla_version=2.1.681.0 | ||
|
||
ARG transformers_version=4.45.2 | ||
ARG accelerate_version=0.29.2 | ||
ARG diffusers_version=0.28.2 | ||
ARG pydantic_version=2.6.1 | ||
ARG optimum_neuron_version=0.0.24 | ||
ARG optimum_neuron_version=0.0.27 | ||
ARG huggingface_hub_version=0.25.2 | ||
# %2B is the url escape for the '+' character | ||
ARG vllm_wheel="https://publish.djl.ai/neuron_vllm/vllm-0.6.2%2Bnightly-py3-none-any.whl" | ||
|
@@ -72,24 +79,53 @@ COPY config.properties /opt/djl/conf/ | |
COPY partition /opt/djl/partition | ||
RUN mkdir -p /opt/djl/bin && cp scripts/telemetry.sh /opt/djl/bin && \ | ||
echo "${djl_serving_version} inf2" > /opt/djl/bin/telemetry && \ | ||
# Install python and djl serving | ||
scripts/install_python.sh && \ | ||
scripts/install_djl_serving.sh $djl_version $djl_serving_version && \ | ||
scripts/install_djl_serving.sh $djl_version $djl_serving_version ${torch_version} && \ | ||
# Install inferentia packages | ||
scripts/install_inferentia2.sh && \ | ||
pip install accelerate==${accelerate_version} safetensors torchvision==${torchvision_version} \ | ||
neuronx-cc==${neuronx_cc_version} torch-neuronx==${torch_neuronx_version} transformers-neuronx==${transformers_neuronx_version} \ | ||
torch_xla==${torch_xla_version} neuronx-cc-stubs==${neuronx_cc_stubs_version} huggingface-hub==${huggingface_hub_version} \ | ||
neuronx_distributed==${neuronx_distributed_version} protobuf sentencepiece jinja2 \ | ||
diffusers==${diffusers_version} opencv-contrib-python-headless Pillow --extra-index-url=https://pip.repos.neuron.amazonaws.com \ | ||
pydantic==${pydantic_version} optimum optimum-neuron==${optimum_neuron_version} tiktoken blobfile && \ | ||
pip install transformers==${transformers_version} ${vllm_wheel} && \ | ||
echo y | pip uninstall triton && \ | ||
# Configure pip and install python packages | ||
pip config set global.extra-index-url "https://pip.repos.neuron.amazonaws.com" && \ | ||
pip install \ | ||
accelerate==${accelerate_version} \ | ||
safetensors \ | ||
torchvision==${torchvision_version} \ | ||
neuronx-cc==${neuronx_cc_version} \ | ||
torch-neuronx==${torch_neuronx_version} \ | ||
torch_xla==${torch_xla_version} \ | ||
neuronx-cc-stubs==${neuronx_cc_stubs_version} \ | ||
huggingface-hub==${huggingface_hub_version} \ | ||
libneuronxla==${libneuronxla_version} \ | ||
neuronx_distributed==${neuronx_distributed_version} \ | ||
protobuf \ | ||
sentencepiece \ | ||
jinja2 \ | ||
diffusers==${diffusers_version} \ | ||
opencv-contrib-python-headless \ | ||
Pillow \ | ||
pydantic==${pydantic_version} \ | ||
optimum \ | ||
tiktoken \ | ||
blobfile && \ | ||
# Install packages with no-deps flag | ||
pip install --no-deps \ | ||
neuronx_distributed_inference==${neuronx_distributed_inference_version} \ | ||
optimum-neuron==${optimum_neuron_version} \ | ||
transformers-neuronx==${transformers_neuronx_version} \ | ||
${vllm_wheel} \ | ||
transformers==${transformers_version} && \ | ||
# Install s5cmd and patch OSS DLC | ||
scripts/install_s5cmd.sh x64 && \ | ||
scripts/patch_oss_dlc.sh python && \ | ||
# Create user and set permissions | ||
useradd -m -d /home/djl djl && \ | ||
chown -R djl:djl /opt/djl && \ | ||
rm -rf scripts && pip3 cache purge && \ | ||
apt-get clean -y && rm -rf /var/lib/apt/lists/* | ||
# Cleanup | ||
rm -rf scripts && \ | ||
pip3 cache purge && \ | ||
apt-get clean -y && \ | ||
rm -rf /var/lib/apt/lists/* | ||
|
||
LABEL maintainer="[email protected]" | ||
LABEL dlc_major_version="1" | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters