forked from pytorch/ignite
-
Notifications
You must be signed in to change notification settings - Fork 0
85 lines (73 loc) · 2.38 KB
/
hvd-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
name: Run Horovod tests
on:
push:
paths:
- "ignite/**"
- "tests/ignite/**"
- "tests/run_cpu_tests.sh"
- ".github/workflows/hvd-tests.yml"
pull_request:
paths:
- "ignite/**"
- "tests/ignite/**"
- "tests/run_cpu_tests.sh"
- ".github/workflows/hvd-tests.yml"
concurrency:
# <workflow_name>-<branch_name>-<true || commit_sha (if branch is protected)>
group: hvd-tests-${{ github.ref_name }}-${{ !(github.ref_protected) || github.sha }}
cancel-in-progress: true
jobs:
horovod-tests:
runs-on: ubuntu-latest
strategy:
matrix:
python-version: [3.8]
pytorch-channel: [pytorch]
steps:
- uses: actions/checkout@v2
- name: Get year & week number
id: get-date
run: echo "::set-output name=date::$(/bin/date "+%Y-%U")"
shell: bash -l {0}
- name: Get pip cache dir
id: pip-cache
run: |
python3 -m pip install -U pip
echo "::set-output name=dir::$(python3 -m pip cache dir)"
shell: bash -l {0}
- uses: actions/cache@v2
with:
path: |
~/conda_pkgs_dir
${{ steps.pip-cache.outputs.dir }}
key: ${{ steps.get-date.outputs.date }}-horovod-${{ hashFiles('requirements-dev.txt') }}
- 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}
run: |
#install other dependencies
conda install pytorch torchvision cpuonly -c ${{ matrix.pytorch-channel }}
pip install -r requirements-dev.txt
pip install horovod
python setup.py install
# Download MNIST: https://github.com/pytorch/ignite/issues/1737
# to "/tmp" for cpu tests
- 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
- name: Upload coverage to Codecov
uses: codecov/codecov-action@v1
with:
file: ./coverage.xml
flags: hvd-cpu
fail_ci_if_error: false