Update docker files to use official torch 2.0.0 (#22357)
* update docker files to use official torch 2.0.0 --------- Co-authored-by: ydshieh <ydshieh@users.noreply.github.com>
This commit is contained in:
@@ -24,15 +24,13 @@ ARG REF=main
|
|||||||
RUN git clone https://github.com/huggingface/transformers && cd transformers && git checkout $REF
|
RUN git clone https://github.com/huggingface/transformers && cd transformers && git checkout $REF
|
||||||
RUN python3 -m pip install --no-cache-dir -e ./transformers[dev,onnxruntime]
|
RUN python3 -m pip install --no-cache-dir -e ./transformers[dev,onnxruntime]
|
||||||
|
|
||||||
## TODO: Handle these in a python utility script
|
# TODO: Handle these in a python utility script
|
||||||
#RUN [ ${#PYTORCH} -gt 0 -a "$PYTORCH" != "pre" ] && VERSION='torch=='$PYTORCH'.*' || VERSION='torch'; echo "export VERSION='$VERSION'" >> ~/.profile
|
RUN [ ${#PYTORCH} -gt 0 -a "$PYTORCH" != "pre" ] && VERSION='torch=='$PYTORCH'.*' || VERSION='torch'; echo "export VERSION='$VERSION'" >> ~/.profile
|
||||||
#RUN echo torch=$VERSION
|
RUN echo torch=$VERSION
|
||||||
## `torchvision` and `torchaudio` should be installed along with `torch`, especially for nightly build.
|
# `torchvision` and `torchaudio` should be installed along with `torch`, especially for nightly build.
|
||||||
## Currently, let's just use their latest releases (when `torch` is installed with a release version)
|
# Currently, let's just use their latest releases (when `torch` is installed with a release version)
|
||||||
## TODO: We might need to specify proper versions that work with a specific torch version (especially for past CI).
|
# TODO: We might need to specify proper versions that work with a specific torch version (especially for past CI).
|
||||||
#RUN [ "$PYTORCH" != "pre" ] && python3 -m pip install --no-cache-dir -U $VERSION torchvision torchaudio --extra-index-url https://download.pytorch.org/whl/$CUDA || python3 -m pip install --no-cache-dir -U --pre torch torchvision torchaudio --extra-index-url https://download.pytorch.org/whl/nightly/$CUDA
|
RUN [ "$PYTORCH" != "pre" ] && python3 -m pip install --no-cache-dir -U $VERSION torchvision torchaudio --extra-index-url https://download.pytorch.org/whl/$CUDA || python3 -m pip install --no-cache-dir -U --pre torch torchvision torchaudio --extra-index-url https://download.pytorch.org/whl/nightly/$CUDA
|
||||||
|
|
||||||
RUN python3 -m pip install --no-cache-dir -U torch torchvision torchaudio --index-url https://download.pytorch.org/whl/test/cu117
|
|
||||||
|
|
||||||
RUN python3 -m pip install --no-cache-dir -U tensorflow==2.11
|
RUN python3 -m pip install --no-cache-dir -U tensorflow==2.11
|
||||||
RUN python3 -m pip install --no-cache-dir -U tensorflow_probability
|
RUN python3 -m pip install --no-cache-dir -U tensorflow_probability
|
||||||
@@ -56,8 +54,8 @@ RUN python3 -m pip install --no-cache-dir bitsandbytes
|
|||||||
# For video model testing
|
# For video model testing
|
||||||
RUN python3 -m pip install --no-cache-dir decord av==9.2.0
|
RUN python3 -m pip install --no-cache-dir decord av==9.2.0
|
||||||
|
|
||||||
## For `dinat` model
|
# For `dinat` model
|
||||||
#RUN python3 -m pip install --no-cache-dir natten -f https://shi-labs.com/natten/wheels/$CUDA/
|
RUN python3 -m pip install --no-cache-dir natten -f https://shi-labs.com/natten/wheels/$CUDA/
|
||||||
|
|
||||||
# When installing in editable mode, `transformers` is not recognized as a package.
|
# When installing in editable mode, `transformers` is not recognized as a package.
|
||||||
# this line must be added in order for python to be aware of transformers.
|
# this line must be added in order for python to be aware of transformers.
|
||||||
|
|||||||
@@ -4,7 +4,7 @@ LABEL maintainer="Hugging Face"
|
|||||||
|
|
||||||
ARG DEBIAN_FRONTEND=noninteractive
|
ARG DEBIAN_FRONTEND=noninteractive
|
||||||
|
|
||||||
ARG PYTORCH='1.13.1'
|
ARG PYTORCH='2.0.0'
|
||||||
# Example: `cu102`, `cu113`, etc.
|
# Example: `cu102`, `cu113`, etc.
|
||||||
ARG CUDA='cu117'
|
ARG CUDA='cu117'
|
||||||
|
|
||||||
@@ -18,9 +18,7 @@ RUN git clone https://github.com/huggingface/transformers && cd transformers &&
|
|||||||
# Install latest release PyTorch
|
# Install latest release PyTorch
|
||||||
# (PyTorch must be installed before pre-compiling any DeepSpeed c++/cuda ops.)
|
# (PyTorch must be installed before pre-compiling any DeepSpeed c++/cuda ops.)
|
||||||
# (https://www.deepspeed.ai/tutorials/advanced-install/#pre-install-deepspeed-ops)
|
# (https://www.deepspeed.ai/tutorials/advanced-install/#pre-install-deepspeed-ops)
|
||||||
#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 -U torch==$PYTORCH torchvision torchaudio --extra-index-url https://download.pytorch.org/whl/$CUDA
|
||||||
RUN python3 -m pip install --no-cache-dir -U torch torchvision torchaudio --index-url https://download.pytorch.org/whl/test/cu117
|
|
||||||
|
|
||||||
|
|
||||||
RUN python3 -m pip install --no-cache-dir ./transformers[deepspeed-testing]
|
RUN python3 -m pip install --no-cache-dir ./transformers[deepspeed-testing]
|
||||||
|
|
||||||
|
|||||||
@@ -18,11 +18,9 @@ ARG TORCH_AUDIO=''
|
|||||||
# Example: `cu102`, `cu113`, etc.
|
# Example: `cu102`, `cu113`, etc.
|
||||||
ARG CUDA='cu117'
|
ARG CUDA='cu117'
|
||||||
|
|
||||||
#RUN [ ${#PYTORCH} -gt 0 ] && VERSION='torch=='$PYTORCH'.*' || VERSION='torch'; python3 -m pip install --no-cache-dir -U $VERSION --extra-index-url https://download.pytorch.org/whl/$CUDA
|
RUN [ ${#PYTORCH} -gt 0 ] && VERSION='torch=='$PYTORCH'.*' || VERSION='torch'; python3 -m pip install --no-cache-dir -U $VERSION --extra-index-url https://download.pytorch.org/whl/$CUDA
|
||||||
#RUN [ ${#TORCH_VISION} -gt 0 ] && VERSION='torchvision=='TORCH_VISION'.*' || VERSION='torchvision'; python3 -m pip install --no-cache-dir -U $VERSION --extra-index-url https://download.pytorch.org/whl/$CUDA
|
RUN [ ${#TORCH_VISION} -gt 0 ] && VERSION='torchvision=='TORCH_VISION'.*' || VERSION='torchvision'; python3 -m pip install --no-cache-dir -U $VERSION --extra-index-url https://download.pytorch.org/whl/$CUDA
|
||||||
#RUN [ ${#TORCH_AUDIO} -gt 0 ] && VERSION='torchaudio=='TORCH_AUDIO'.*' || VERSION='torchaudio'; python3 -m pip install --no-cache-dir -U $VERSION --extra-index-url https://download.pytorch.org/whl/$CUDA
|
RUN [ ${#TORCH_AUDIO} -gt 0 ] && VERSION='torchaudio=='TORCH_AUDIO'.*' || VERSION='torchaudio'; python3 -m pip install --no-cache-dir -U $VERSION --extra-index-url https://download.pytorch.org/whl/$CUDA
|
||||||
|
|
||||||
RUN python3 -m pip install --no-cache-dir -U torch torchvision torchaudio --index-url https://download.pytorch.org/whl/test/cu117
|
|
||||||
|
|
||||||
RUN python3 -m pip uninstall -y tensorflow flax
|
RUN python3 -m pip uninstall -y tensorflow flax
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user