|
|
|
FROM nvcr.io/nvidia/pytorch:22.08-py3 |
|
LABEL maintainer="Hugging Face" |
|
|
|
ARG DEBIAN_FRONTEND=noninteractive |
|
|
|
ARG PYTORCH='2.0.0' |
|
|
|
ARG CUDA='cu117' |
|
|
|
RUN apt -y update |
|
RUN apt install -y libaio-dev |
|
RUN python3 -m pip install --no-cache-dir --upgrade pip |
|
|
|
ARG REF=main |
|
RUN git clone https://github.com/huggingface/transformers && cd transformers && git checkout $REF |
|
|
|
|
|
|
|
|
|
RUN python3 -m pip install --no-cache-dir -U torch==$PYTORCH torchvision torchaudio --extra-index-url https://download.pytorch.org/whl/$CUDA |
|
|
|
RUN python3 -m pip install --no-cache-dir ./transformers[deepspeed-testing] |
|
|
|
|
|
RUN python3 -m pip uninstall -y torch-tensorrt |
|
|
|
|
|
RUN python3 -m pip uninstall -y apex |
|
RUN git clone https://github.com/NVIDIA/apex |
|
|
|
RUN cd apex && MAX_JOBS=1 python3 -m pip install --global-option="--cpp_ext" --global-option="--cuda_ext" --no-cache -v --disable-pip-version-check . |
|
|
|
|
|
RUN python3 -m pip uninstall -y deepspeed |
|
|
|
|
|
|
|
RUN DS_BUILD_CPU_ADAM=1 DS_BUILD_FUSED_ADAM=1 DS_BUILD_AIO=1 DS_BUILD_UTILS=1 python3 -m pip install deepspeed --global-option="build_ext" --global-option="-j8" --no-cache -v --disable-pip-version-check 2>&1 |
|
|
|
|
|
|
|
RUN cd transformers && python3 setup.py develop |
|
|
|
|
|
RUN python3 -m pip install -U --no-cache-dir pydantic |
|
RUN python3 -c "from deepspeed.launcher.runner import main" |
|
|