Skip to content

Commit 0b54a58

Browse files
Bordacarmoccaakihironitta
committed
CI: enable testing for PT 1.11 (#11792)
* enable PT 1.11 * horovod * Apply suggestions from code review Co-authored-by: Carlos Mocholí <carlossmocholi@gmail.com> Co-authored-by: Aki Nitta <nitta@akihironitta.com>
1 parent 8c21ad6 commit 0b54a58

File tree

4 files changed

+35
-27
lines changed

4 files changed

+35
-27
lines changed

.github/workflows/ci_test-conda.yml

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,10 @@ jobs:
2323
fail-fast: false
2424
matrix:
2525
python-version: ["3.8"] # previous to last Python version as that one is already used in test-full
26-
pytorch-version: ["1.8", "1.9", "1.10"] # nightly: add when there's a release candidate
26+
pytorch-version: ["1.8", "1.9", "1.10"]
27+
# nightly: add when there's a release candidate
28+
include:
29+
- {python-version: "3.9", pytorch-version: "1.11"}
2730

2831
timeout-minutes: 30
2932
steps:
@@ -36,7 +39,7 @@ jobs:
3639
# adjust versions according installed Torch version
3740
python ./requirements/adjust-versions.py requirements/extra.txt
3841
python ./requirements/adjust-versions.py requirements/examples.txt
39-
pip install --requirement requirements/devel.txt --find-links https://download.pytorch.org/whl/nightly/torch_nightly.html
42+
pip install --requirement requirements/devel.txt --find-links https://download.pytorch.org/whl/test/torch_test.html
4043
# set a per-test timeout of 2.5 minutes to fail sooner. this aids with hanging tests
4144
pip install pytest-timeout
4245
pip list

.github/workflows/ci_test-full.yml

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -24,9 +24,12 @@ jobs:
2424
python-version: ["3.7", "3.9"] # minimum, maximum
2525
requires: ["oldest", "latest"]
2626
release: ["stable"]
27-
#include:
28-
# nightly: add when there's a release candidate
29-
#- {os: ubuntu-20.04, python-version: "3.10", requires: "latest", release: "pre"}
27+
exclude:
28+
# Skip if torch<1.8 and py3.9 on Linux: https://github.com/pytorch/pytorch/issues/50014
29+
- {os: ubuntu-20.04, python-version: "3.9", requires: "oldest"}
30+
# TODO: re-enable RC testing
31+
# include:
32+
# - {os: ubuntu-20.04, python-version: "3.10", requires: "latest", release: "pre"}
3033

3134
timeout-minutes: 40
3235

@@ -83,7 +86,8 @@ jobs:
8386
- name: Install dependencies
8487
run: |
8588
flag=$(python -c "print('--pre' if '${{matrix.release}}' == 'pre' else '')" 2>&1)
86-
pip install --requirement requirements.txt --find-links https://download.pytorch.org/whl/cpu/torch_stable.html --upgrade $flag
89+
url=$(python -c "print('test/cpu/torch_test.html' if '${{matrix.release}}' == 'pre' else 'cpu/torch_stable.html')" 2>&1)
90+
pip install --requirement requirements.txt --upgrade $flag --find-links "https://download.pytorch.org/whl/${url}"
8791
# adjust versions according installed Torch version
8892
python ./requirements/adjust-versions.py requirements/examples.txt
8993
pip install --requirement requirements/examples.txt --find-links https://download.pytorch.org/whl/cpu/torch_stable.html --upgrade

.github/workflows/events-nightly.yml

Lines changed: 9 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -123,9 +123,14 @@ jobs:
123123
strategy:
124124
fail-fast: false
125125
matrix:
126-
# the config used in '.github/workflows/ci_test-conda.yml'
127-
python_version: ["3.8"]
128-
pytorch_version: ["1.8", "1.9", "1.10"]
126+
include:
127+
# see: https://pytorch.org/get-started/previous-versions/
128+
- {python_version: "3.8", pytorch_version: "1.8", cuda_version: "11.1"}
129+
- {python_version: "3.8", pytorch_version: "1.9", cuda_version: "11.1"}
130+
- {python_version: "3.8", pytorch_version: "1.10", cuda_version: "11.1"}
131+
- {python_version: "3.9", pytorch_version: "1.11", cuda_version: "11.3.1"}
132+
# nightly: add when there's a release candidate
133+
# - {python_version: "3.9", pytorch_version: "1.12"}
129134

130135
steps:
131136
- name: Checkout
@@ -138,20 +143,14 @@ jobs:
138143
username: ${{ secrets.DOCKER_USERNAME }}
139144
password: ${{ secrets.DOCKER_PASSWORD }}
140145

141-
# see: https://pytorch.org/get-started/previous-versions/
142-
- run: |
143-
cuda=$(python -c "from distutils.version import LooseVersion as LVer ; print(11.1 if LVer('${{matrix.pytorch_version}}') > LVer('1.7') else 10.2)" 2>&1)
144-
echo "::set-output name=CUDA::$cuda"
145-
id: extend
146-
147146
- name: Publish Conda to Docker Hub
148147
# publish master/release
149148
uses: docker/build-push-action@v2
150149
with:
151150
build-args: |
152151
PYTHON_VERSION=${{ matrix.python_version }}
153152
PYTORCH_VERSION=${{ matrix.pytorch_version }}
154-
CUDA_VERSION=${{ steps.extend.outputs.CUDA }}
153+
CUDA_VERSION=${{ matrix.cuda_version }}
155154
file: dockers/base-conda/Dockerfile
156155
push: ${{ env.PUSH_TO_HUB }}
157156
tags: pytorchlightning/pytorch_lightning:base-conda-py${{ matrix.python_version }}-torch${{ matrix.pytorch_version }}

dockers/base-conda/Dockerfile

Lines changed: 13 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -12,13 +12,13 @@
1212
# See the License for the specific language governing permissions and
1313
# limitations under the License.
1414

15-
ARG CUDA_VERSION=11.1
15+
ARG CUDA_VERSION=11.3.1
1616

1717
FROM nvidia/cuda:${CUDA_VERSION}-devel-ubuntu18.04
1818

19-
ARG PYTHON_VERSION=3.8
20-
ARG PYTORCH_VERSION=1.6
21-
ARG CONDA_VERSION=4.9.2
19+
ARG PYTHON_VERSION=3.9
20+
ARG PYTORCH_VERSION=1.8
21+
ARG CONDA_VERSION=4.11.0
2222

2323
SHELL ["/bin/bash", "-c"]
2424
# https://techoverflow.net/2019/05/18/how-to-fix-configuring-tzdata-interactive-input-when-building-docker-images/
@@ -68,14 +68,16 @@ COPY environment.yml environment.yml
6868

6969
# conda init
7070
RUN conda update -n base -c defaults conda && \
71-
conda create -y --name $CONDA_ENV python=${PYTHON_VERSION} pytorch=${PYTORCH_VERSION} cudatoolkit=${CUDA_VERSION} -c nvidia -c pytorch -c pytorch-test -c pytorch-nightly && \
71+
conda install mamba -n base -c conda-forge && \
72+
mamba create -y --name $CONDA_ENV python=${PYTHON_VERSION} pytorch=${PYTORCH_VERSION} torchvision torchtext cudatoolkit=${CUDA_VERSION} -c nvidia -c pytorch -c pytorch-test -c pytorch-nightly && \
7273
conda init bash && \
73-
# NOTE: this requires that the channel is presented in the yaml before packages
74-
python -c "import re ; fname = 'environment.yml' ; req = re.sub(r'- python[>=]+[\d\.]+', '# - python=${PYTHON_VERSION}', open(fname).read()) ; open(fname, 'w').write(req)" && \
75-
python -c "import re ; fname = 'environment.yml' ; req = re.sub(r'- pytorch[>=]+[\d\.]+', '# - pytorch=${PYTORCH_VERSION}', open(fname).read()) ; open(fname, 'w').write(req)" && \
74+
# NOTE: this requires that the channel is presented in the yaml before packages \
75+
printf "import re;\nfname = 'environment.yml';\nreq = open(fname).read();\nfor n in ['python', 'pytorch', 'torchtext', 'torchvision']:\n req = re.sub(rf'- {n}[>=]+', f'# - {n}=', req);\nopen(fname, 'w').write(req)" > prune.py && \
76+
python prune.py && \
77+
rm prune.py && \
7678
cat environment.yml && \
77-
conda env update --name $CONDA_ENV --file environment.yml && \
78-
conda clean -ya && \
79+
mamba env update --name $CONDA_ENV --file environment.yml && \
80+
mamba clean -ya && \
7981
rm environment.yml
8082

8183
ENV \
@@ -96,7 +98,7 @@ RUN \
9698
python requirements_prune_packages.py requirements-extra.txt "horovod" && \
9799
python requirements_adjust_versions.py requirements-examples.txt && \
98100
# Install remaining requirements
99-
pip install -r requirements-extra.txt --no-cache-dir && \
101+
pip install -r requirements-extra.txt --no-cache-dir --find-links https://download.pytorch.org/whl/test/torch_test.html && \
100102
pip install -r requirements-examples.txt --no-cache-dir --find-links https://download.pytorch.org/whl/test/torch_test.html && \
101103
pip install -r requirements-test.txt --no-cache-dir
102104

0 commit comments

Comments
 (0)