Skip to content

Commit e0cbe0e

Browse files
committed
CI: switch M1 runner to openmp
1 parent d848426 commit e0cbe0e

File tree

4 files changed

+24
-10
lines changed

4 files changed

+24
-10
lines changed

.github/workflows/pytest-core-nompi.yml

Lines changed: 16 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@ jobs:
2222
env:
2323
DEVITO_ARCH: "${{ matrix.arch }}"
2424
DEVITO_LANGUAGE: ${{ matrix.language }}
25+
DEVITO_PLATFORM: ${{ matrix.platform }}
2526
OMP_NUM_THREADS: 2
2627

2728
strategy:
@@ -48,62 +49,71 @@ jobs:
4849
arch: "gcc-11"
4950
language: "C"
5051
sympy: "1.11"
52+
platform: "cpu64"
5153

5254
- name: pytest-ubuntu-py38-gcc12-omp
5355
python-version: '3.8'
5456
os: ubuntu-22.04
5557
arch: "gcc-12"
5658
language: "openmp"
5759
sympy: "1.10"
60+
platform: "cpu64"
5861

5962
- name: pytest-ubuntu-py38-gcc7-omp
6063
python-version: '3.8'
6164
os: ubuntu-20.04
6265
arch: "gcc-7"
6366
language: "openmp"
6467
sympy: "1.9"
68+
platform: "cpu64"
6569

6670
- name: pytest-ubuntu-py310-gcc10-noomp
6771
python-version: '3.10'
6872
os: ubuntu-20.04
6973
arch: "gcc-10"
7074
language: "C"
7175
sympy: "1.11"
76+
platform: "cpu64"
7277

7378
- name: pytest-ubuntu-py312-gcc13-omp
7479
python-version: '3.12'
7580
os: ubuntu-24.04
7681
arch: "gcc-13"
7782
language: "openmp"
7883
sympy: "1.13"
84+
platform: "cpu64"
7985

8086
- name: pytest-ubuntu-py39-gcc9-omp
8187
python-version: '3.9'
8288
os: ubuntu-20.04
8389
arch: "custom"
8490
language: "openmp"
8591
sympy: "1.9"
92+
platform: "cpu64"
8693

8794
- name: pytest-osx-py312-clang-omp
8895
python-version: '3.12'
8996
os: macos-latest
9097
arch: "clang"
91-
language: "C"
98+
language: "openmp"
9299
sympy: "1.9"
100+
platform: "m1"
93101

94102
- name: pytest-docker-py39-gcc-omp
95103
python-version: '3.9'
96104
os: ubuntu-latest
97105
arch: "gcc"
98106
language: "openmp"
99107
sympy: "1.12"
108+
platform: "cpu64"
100109

101110
- name: pytest-docker-py39-icx-omp
102111
python-version: '3.9'
103112
os: ubuntu-latest
104113
arch: "icx"
105114
language: "openmp"
106115
sympy: "1.12"
116+
platform: "intel64"
107117

108118
- set: base
109119
test-set: 'not adjoint'
@@ -147,9 +157,8 @@ jobs:
147157
- name: Set tests (reduced number for OSX)
148158
run : |
149159
if [ "${{ runner.os }}" == 'macOS' ]; then
150-
echo "TESTS=tests/test_operator.py" >> $GITHUB_ENV
151-
else
152-
echo "TESTS=tests/" >> $GITHUB_ENV
160+
brew install llvm libomp
161+
echo "/opt/homebrew/bin:/opt/homebrew/opt/llvm/bin" >> $GITHUB_PATH
153162
fi
154163
id: set-tests
155164

@@ -162,9 +171,9 @@ jobs:
162171
- name: Install dependencies
163172
if: "!contains(matrix.name, 'docker')"
164173
run: |
165-
pip install ${{ env.PIPFLAGS }} --upgrade pip
166-
pip install ${{ env.PIPFLAGS }} sympy==${{matrix.sympy}}
167-
pip install ${{ env.PIPFLAGS }} -e .[tests]
174+
python3 -m pip install ${{ env.PIPFLAGS }} --upgrade pip
175+
python3 -m pip install ${{ env.PIPFLAGS }} sympy==${{matrix.sympy}}
176+
python3 -m pip install ${{ env.PIPFLAGS }} -e .[tests,extras]
168177
169178
- name: Check configuration
170179
run: |

tests/test_buffering.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,8 @@
33

44
from conftest import skipif
55
from devito import (Constant, Grid, TimeFunction, Operator, Eq, SubDimension,
6-
SubDomain, ConditionalDimension)
6+
SubDomain, ConditionalDimension, configuration, switchconfig)
7+
from devito.arch.archinfo import AppleArm
78
from devito.ir import FindSymbols, retrieve_iteration_tree
89
from devito.exceptions import InvalidOperator
910

@@ -672,6 +673,7 @@ def test_everything():
672673

673674

674675
@pytest.mark.parametrize('subdomain', ['domain', 'interior'])
676+
@switchconfig(safe_math=True, condition=isinstance(configuration['platform'], AppleArm))
675677
def test_stencil_issue_1915(subdomain):
676678
nt = 5
677679
grid = Grid(shape=(6, 6))

tests/test_gradient.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414

1515
class TestGradient:
1616

17-
@skipif(['chkpnt', 'cpu64-icc'])
17+
@skipif(['chkpnt', 'cpu64-icc', 'cpu64-arm'])
1818
@switchconfig(safe_math=True)
1919
@pytest.mark.parametrize('dtype', [np.float32, np.float64])
2020
@pytest.mark.parametrize('opt', [('advanced', {'openmp': True}),
@@ -59,7 +59,7 @@ def test_gradient_checkpointing(self, dtype, opt, space_order, kernel, shape, sp
5959

6060
assert np.allclose(gradient.data, gradient2.data, atol=0, rtol=0)
6161

62-
@skipif('cpu64-icc')
62+
@skipif(['cpu64-icc', 'cpu64-arm'])
6363
@pytest.mark.parametrize('tn', [750.])
6464
@pytest.mark.parametrize('spacing', [(10, 10)])
6565
@pytest.mark.parametrize("dtype, tolerance", [(np.float32, 1e-4),

tests/test_roundoff.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
import pytest
22
import numpy as np
33

4+
from conftest import skipif
45
from devito import Grid, Constant, TimeFunction, Eq, Operator, switchconfig
56

67

@@ -84,6 +85,7 @@ def test_lm_backward(self, dat, dtype):
8485
@pytest.mark.parametrize('dat', [0.5, 0.624, 1.0, 1.5, 2.0, 3.0, 3.6767, 4.0])
8586
@pytest.mark.parametrize('dtype', [np.float32, np.float64])
8687
@switchconfig(log_level='DEBUG', safe_math=True)
88+
@skipif('cpu64-arm')
8789
def test_lm_fb(self, dat, dtype):
8890
"""
8991
Test logistic map with forward and backward terms that should cancel.
@@ -123,6 +125,7 @@ def test_lm_fb(self, dat, dtype):
123125
@pytest.mark.parametrize('dat', [0.5, 0.624, 1.0, 1.5, 2.0, 3.0, 3.6767, 4.0])
124126
@pytest.mark.parametrize('dtype', [np.float32, np.float64])
125127
@switchconfig(log_level='DEBUG', safe_math=True)
128+
@skipif('cpu64-arm')
126129
def test_lm_ds(self, dat, dtype):
127130
"""
128131
Test logistic map with 2nd derivative term that should cancel.

0 commit comments

Comments
 (0)