forked from pytorch/ignite
-
Notifications
You must be signed in to change notification settings - Fork 0
130 lines (111 loc) · 4.36 KB
/
pytorch-version-tests.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
name: PyTorch version tests
on:
# https://docs.github.com/en/free-pro-team@latest/actions/reference/workflow-syntax-for-github-actions#onschedule
schedule:
# Run at 00:00 UTC Every Day
- cron: "0 0 * * *"
workflow_dispatch:
jobs:
build:
runs-on: ubuntu-latest
timeout-minutes: 45
strategy:
max-parallel: 10
fail-fast: false
matrix:
python-version: [3.8, 3.9, "3.10"]
pytorch-version:
[1.13.1, 1.12.1, 1.11.0, 1.10.0, 1.9.1, 1.8.1, 1.7.1, 1.6.0, 1.5.1, 1.4.0]
exclude:
- pytorch-version: 1.4.0
python-version: 3.9
- pytorch-version: 1.4.0
python-version: 3.10
- pytorch-version: 1.5.1
python-version: 3.9
- pytorch-version: 1.5.1
python-version: 3.10
- pytorch-version: 1.6.0
python-version: 3.9
- pytorch-version: 1.6.0
python-version: 3.10
# disabling python 3.9 support with PyTorch 1.7.1 and 1.8.1, to stop repeated pytorch-version test fail.
# https://github.com/pytorch/ignite/issues/2383
- pytorch-version: 1.7.1
python-version: 3.9
- pytorch-version: 1.7.1
python-version: 3.10
- pytorch-version: 1.8.1
python-version: 3.9
- pytorch-version: 1.8.1
python-version: 3.10
- pytorch-version: 1.9.1
python-version: 3.10
- pytorch-version: 1.10.0
python-version: 3.10
- pytorch-version: 1.11.0
python-version: 3.10
steps:
- uses: actions/checkout@v3
- name: Get year & week number
id: get-date
run: echo "date=$(/bin/date "+%Y-%U")" >> $GITHUB_OUTPUT
shell: bash -l {0}
- name: Get pip cache dir
id: pip-cache
run: |
python3 -m pip install -U pip
echo "pip_cache=$(python3 -m pip cache dir)" >> $GITHUB_OUTPUT
shell: bash -l {0}
- uses: actions/cache@v3
with:
path: |
~/conda_pkgs_dir
${{ steps.pip-cache.outputs.pip_cache }}
key: ${{ steps.get-date.outputs.date }}-pytorch-${{ runner.os }}-${{ matrix.python-version }}-${{ matrix.pytorch-version }}-${{ hashFiles('requirements-dev.txt') }}
restore-keys: |
${{ steps.get-date.outputs.date }}-pytorch-${{ runner.os }}-${{ matrix.python-version }}-${{ matrix.pytorch-version }}-
- name: Setup Miniconda
uses: conda-incubator/setup-miniconda@v2
with:
miniconda-version: "latest"
python-version: ${{ matrix.python-version }}
use-only-tar-bz2: true # IMPORTANT: This needs to be set for caching to work properly!
- name: Install dependencies
shell: bash -l {0}
if: ${{ matrix.pytorch-version != '1.4.0' }}
run: |
conda install pytorch=${{ matrix.pytorch-version }} torchvision cpuonly python=${{ matrix.python-version }} -c pytorch
pip install -r requirements-dev.txt
python setup.py install
# There is no more torchvision 0.5.0 binaries in anaconda pytorch channel:
# https://anaconda.org/pytorch/torchvision/files
- name: Install appropriate dependencies for PyTorch 1.4.0
shell: bash -l {0}
if: ${{ matrix.pytorch-version == '1.4.0' }}
run: |
conda install pytorch=${{ matrix.pytorch-version }} cpuonly python=${{ matrix.python-version }} -c pytorch
pip install torchvision==0.5.0
pip install -r requirements-dev.txt
python setup.py install
- name: Download MNIST
uses: pytorch-ignite/download-mnist-github-action@master
with:
target_dir: /tmp
- name: Run Tests
shell: bash -l {0}
run: |
bash tests/run_cpu_tests.sh "not test_time_profilers"
create-issue:
runs-on: ubuntu-latest
# https://docs.github.com/en/actions/reference/context-and-expression-syntax-for-github-actions#needs-context
needs: build
if: always() && needs.build.result == 'failure'
steps:
- uses: actions/checkout@v3
- uses: JasonEtco/create-an-issue@v2
name: Create issue if pytorch version tests failed
with:
filename: .github/failed_schedule_issue_template.md
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}