Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
chenpangpang
transformers
Commits
ba9e0191
Unverified
Commit
ba9e0191
authored
Mar 13, 2023
by
Yih-Dar
Committed by
GitHub
Mar 13, 2023
Browse files
Prepare daily CI for torch 2.0.0 (#22135)
Co-authored-by:
ydshieh
<
ydshieh@users.noreply.github.com
>
parent
f780557a
Changes
4
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
41 additions
and
23 deletions
+41
-23
.github/workflows/build-docker-images.yml
.github/workflows/build-docker-images.yml
+10
-0
docker/transformers-all-latest-gpu/Dockerfile
docker/transformers-all-latest-gpu/Dockerfile
+14
-12
docker/transformers-pytorch-deepspeed-latest-gpu/Dockerfile
docker/transformers-pytorch-deepspeed-latest-gpu/Dockerfile
+9
-5
docker/transformers-pytorch-gpu/Dockerfile
docker/transformers-pytorch-gpu/Dockerfile
+8
-6
No files found.
.github/workflows/build-docker-images.yml
View file @
ba9e0191
...
...
@@ -22,6 +22,16 @@ jobs:
name
:
"
Latest
PyTorch
+
TensorFlow
[dev]"
runs-on
:
ubuntu-latest
steps
:
-
name
:
Cleanup disk
run
:
|
sudo ls -l /usr/local/lib/
sudo ls -l /usr/share/
sudo du -sh /usr/local/lib/
sudo du -sh /usr/share/
sudo rm -rf /usr/local/lib/android
sudo rm -rf /usr/share/dotnet
sudo du -sh /usr/local/lib/
sudo du -sh /usr/share/
-
name
:
Set up Docker Buildx
uses
:
docker/setup-buildx-action@v2
...
...
docker/transformers-all-latest-gpu/Dockerfile
View file @
ba9e0191
FROM
nvidia/cuda:11.
6.2
-cudnn8-devel-ubuntu20.04
FROM
nvidia/cuda:11.
7.1
-cudnn8-devel-ubuntu20.04
LABEL
maintainer="Hugging Face"
ARG
DEBIAN_FRONTEND=noninteractive
...
...
@@ -9,11 +9,11 @@ SHELL ["sh", "-lc"]
# The following `ARG` are mainly used to specify the versions explicitly & directly in this docker file, and not meant
# to be used as arguments for docker build (so far).
ARG
PYTORCH='
1.13.1
'
ARG
PYTORCH='
2.0.0
'
# (not always a valid torch version)
ARG
INTEL_TORCH_EXT='1.11.0'
# Example: `cu102`, `cu113`, etc.
ARG
CUDA='cu11
6
'
ARG
CUDA='cu11
7
'
RUN
apt update
RUN
apt
install
-y
git libsndfile1-dev tesseract-ocr espeak-ng python3 python3-pip ffmpeg git-lfs
...
...
@@ -24,13 +24,15 @@ ARG REF=main
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]
# 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
echo
torch
=
$VERSION
# `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)
# 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
## 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 echo torch=$VERSION
## `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)
## 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
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_probability
...
...
@@ -54,8 +56,8 @@ RUN python3 -m pip install --no-cache-dir bitsandbytes
# For video model testing
RUN
python3
-m
pip
install
--no-cache-dir
decord
av
==
9.2.0
# For `dinat` model
RUN
python3
-m
pip
install
--no-cache-dir
natten
-f
https://shi-labs.com/natten/wheels/
$CUDA
/
#
# For `dinat` model
#
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.
# this line must be added in order for python to be aware of transformers.
...
...
docker/transformers-pytorch-deepspeed-latest-gpu/Dockerfile
View file @
ba9e0191
# https://docs.nvidia.com/deeplearning/frameworks/pytorch-release-notes/rel_22-0
4
.html#rel_22-0
4
FROM
nvcr.io/nvidia/pytorch:22.0
4
-py3
# https://docs.nvidia.com/deeplearning/frameworks/pytorch-release-notes/rel_22-0
8
.html#rel_22-0
8
FROM
nvcr.io/nvidia/pytorch:22.0
8
-py3
LABEL
maintainer="Hugging Face"
ARG
DEBIAN_FRONTEND=noninteractive
ARG
PYTORCH='1.13.1'
# Example: `cu102`, `cu113`, etc.
ARG
CUDA='cu11
6
'
ARG
CUDA='cu11
7
'
RUN
apt
-y
update
RUN
apt
install
-y
libaio-dev
...
...
@@ -18,11 +18,15 @@ RUN git clone https://github.com/huggingface/transformers && cd transformers &&
# Install latest release PyTorch
# (PyTorch must be installed before pre-compiling any DeepSpeed c++/cuda 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
torch-tensorrt
==
1.3.0
--find-links
https://github.com/pytorch/TensorRT/releases/expanded_assets/v1.3.0
# This will uninstall torch 2.0.0
# TODO: uncomment the following line once `torch-tensorrt` is ready for `torch 2.0.0`
# RUN python3 -m pip install torch-tensorrt==1.3.0 --find-links https://github.com/pytorch/TensorRT/releases/expanded_assets/v1.3.0
# recompile apex
RUN
python3
-m
pip uninstall
-y
apex
...
...
docker/transformers-pytorch-gpu/Dockerfile
View file @
ba9e0191
FROM
nvidia/cuda:11.
6.2
-cudnn8-devel-ubuntu20.04
FROM
nvidia/cuda:11.
7.1
-cudnn8-devel-ubuntu20.04
LABEL
maintainer="Hugging Face"
ARG
DEBIAN_FRONTEND=noninteractive
...
...
@@ -12,15 +12,17 @@ RUN git clone https://github.com/huggingface/transformers && cd transformers &&
RUN
python3
-m
pip
install
--no-cache-dir
-e
./transformers[dev-torch,testing,video]
# If set to nothing, will install the latest version
ARG
PYTORCH='
1.13.1
'
ARG
PYTORCH='
2.0.0
'
ARG
TORCH_VISION=''
ARG
TORCH_AUDIO=''
# Example: `cu102`, `cu113`, etc.
ARG
CUDA='cu11
6
'
ARG
CUDA='cu11
7
'
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_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 [ ${#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_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
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment