-
Notifications
You must be signed in to change notification settings - Fork 2
85 lines (82 loc) · 2.55 KB
/
test.yml
File metadata and controls
85 lines (82 loc) · 2.55 KB
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
name: Tests
on:
push:
pull_request:
jobs:
tests:
name: ${{ matrix.os }} cpy${{ matrix.python }} pytorch-${{ matrix.pytorch }} ${{ matrix.mpi }}
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
#os: [ "ubuntu-20.04", "ubuntu-22.04" ]
os: [ "ubuntu-20.04" ]
python: [ "3.7", "3.8", "3.9", "3.10", "3.11" ]
pytorch: [ "1.9.1", "1.10.2", "1.11.0", "1.12.1", "1.13.1", "2.0.0" ]
mpi: [ "openmpi", "mpich" ]
exclude:
- python: 3.7
pytorch: 2.0.0
- python: 3.10
pytorch: 1.8.1
- python: 3.10
pytorch: 1.9.1
- python: 3.10
pytorch: 1.10.2
- python: 3.11
pytorch: 1.8.1
- python: 3.11
pytorch: 1.9.1
- python: 3.11
pytorch: 1.10.2
- python: 3.11
pytorch: 1.11.0
- python: 3.11
pytorch: 1.12.1
steps:
- name: Checkout
uses: actions/checkout@v3
- name: Install CPython ${{ matrix.python }}
uses: actions/setup-python@v4
with:
python-version: "${{ matrix.python }}"
architecture: x64
- name: Install MPI ${{ matrix.mpi }}
run: |
if [[ "${{ matrix.mpi }}" == "openmpi" ]]; then
sudo apt install libopenmpi-dev openmpi-bin
elif [[ "${{ matrix.mpi }}" == "mpich" ]]; then
sudo apt install mpich
else
exit 1
fi
mpirun --version
- name: Setup virtual environment
run: |
python -m venv venv
- name: Install mpi4torch
run: |
. venv/bin/activate
echo "torch==${{ matrix.pytorch }}" >> constraints.txt
PIP_CONSTRAINT="constraints.txt" pip install -v . nose2 mpi4py
- name: Run Tests (np=2)
run: |
. venv/bin/activate
#mpirun -np 2 python -c 'from mpi4torch import COMM_WORLD; print("Communicator size:", COMM_WORLD.size) if COMM_WORLD.rank == 0 else exit(0)'
mpirun -np 2 nose2
- name: Run Tests (np=5)
run: |
. venv/bin/activate
if [[ "${{ matrix.mpi }}" == "openmpi" ]]; then
mpirun -np 5 --oversubscribe nose2
else
mpirun -np 5 nose2
fi
- name: Run Tests (np=7)
run: |
. venv/bin/activate
if [[ "${{ matrix.mpi }}" == "openmpi" ]]; then
mpirun -np 7 --oversubscribe nose2
else
mpirun -np 7 nose2
fi