Skip to content

Commit

Permalink
CI: switch M1 runner to openmp
Browse files Browse the repository at this point in the history
  • Loading branch information
mloubout committed Jul 24, 2024
1 parent 772f130 commit ffe4226
Show file tree
Hide file tree
Showing 4 changed files with 24 additions and 10 deletions.
23 changes: 16 additions & 7 deletions .github/workflows/pytest-core-nompi.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ jobs:
env:
DEVITO_ARCH: "${{ matrix.arch }}"
DEVITO_LANGUAGE: ${{ matrix.language }}
DEVITO_PLATFORM: ${{ matrix.platform }}
OMP_NUM_THREADS: 2

strategy:
Expand All @@ -48,62 +49,71 @@ jobs:
arch: "gcc-11"
language: "C"
sympy: "1.11"
platform: "cpu64"

- name: pytest-ubuntu-py38-gcc12-omp
python-version: '3.8'
os: ubuntu-22.04
arch: "gcc-12"
language: "openmp"
sympy: "1.10"
platform: "cpu64"

- name: pytest-ubuntu-py38-gcc7-omp
python-version: '3.8'
os: ubuntu-20.04
arch: "gcc-7"
language: "openmp"
sympy: "1.9"
platform: "cpu64"

- name: pytest-ubuntu-py310-gcc10-noomp
python-version: '3.10'
os: ubuntu-20.04
arch: "gcc-10"
language: "C"
sympy: "1.11"
platform: "cpu64"

- name: pytest-ubuntu-py312-gcc13-omp
python-version: '3.12'
os: ubuntu-24.04
arch: "gcc-13"
language: "openmp"
sympy: "1.13"
platform: "cpu64"

- name: pytest-ubuntu-py39-gcc9-omp
python-version: '3.9'
os: ubuntu-20.04
arch: "custom"
language: "openmp"
sympy: "1.9"
platform: "cpu64"

- name: pytest-osx-py312-clang-omp
python-version: '3.12'
os: macos-latest
arch: "clang"
language: "C"
language: "openmp"
sympy: "1.9"
platform: "m1"

- name: pytest-docker-py39-gcc-omp
python-version: '3.9'
os: ubuntu-latest
arch: "gcc"
language: "openmp"
sympy: "1.12"
platform: "cpu64"

- name: pytest-docker-py39-icx-omp
python-version: '3.9'
os: ubuntu-latest
arch: "icx"
language: "openmp"
sympy: "1.12"
platform: "intel64"

- set: base
test-set: 'not adjoint'
Expand Down Expand Up @@ -147,9 +157,8 @@ jobs:
- name: Set tests (reduced number for OSX)
run : |
if [ "${{ runner.os }}" == 'macOS' ]; then
echo "TESTS=tests/test_operator.py" >> $GITHUB_ENV
else
echo "TESTS=tests/" >> $GITHUB_ENV
brew install llvm libomp
echo "/opt/homebrew/bin:/opt/homebrew/opt/llvm/bin" >> $GITHUB_PATH
fi
id: set-tests

Expand All @@ -162,9 +171,9 @@ jobs:
- name: Install dependencies
if: "!contains(matrix.name, 'docker')"
run: |
pip install ${{ env.PIPFLAGS }} --upgrade pip
pip install ${{ env.PIPFLAGS }} sympy==${{matrix.sympy}}
pip install ${{ env.PIPFLAGS }} -e .[tests]
python3 -m pip install ${{ env.PIPFLAGS }} --upgrade pip
python3 -m pip install ${{ env.PIPFLAGS }} sympy==${{matrix.sympy}}
python3 -m pip install ${{ env.PIPFLAGS }} -e .[tests,extras]
- name: Check configuration
run: |
Expand Down
4 changes: 3 additions & 1 deletion tests/test_buffering.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,8 @@

from conftest import skipif
from devito import (Constant, Grid, TimeFunction, Operator, Eq, SubDimension,
SubDomain, ConditionalDimension)
SubDomain, ConditionalDimension, configuration, switchconfig)
from devito.arch.archinfo import AppleArm
from devito.ir import FindSymbols, retrieve_iteration_tree
from devito.exceptions import InvalidOperator

Expand Down Expand Up @@ -672,6 +673,7 @@ def test_everything():


@pytest.mark.parametrize('subdomain', ['domain', 'interior'])
@switchconfig(safe_math=True, condition=isinstance(configuration['platform'], AppleArm))
def test_stencil_issue_1915(subdomain):
nt = 5
grid = Grid(shape=(6, 6))
Expand Down
4 changes: 2 additions & 2 deletions tests/test_gradient.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@

class TestGradient:

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

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

@skipif('cpu64-icc')
@skipif(['cpu64-icc', 'cpu64-arm'])
@pytest.mark.parametrize('tn', [750.])
@pytest.mark.parametrize('spacing', [(10, 10)])
@pytest.mark.parametrize("dtype, tolerance", [(np.float32, 1e-4),
Expand Down
3 changes: 3 additions & 0 deletions tests/test_roundoff.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import pytest
import numpy as np

from conftest import skipif
from devito import Grid, Constant, TimeFunction, Eq, Operator, switchconfig


Expand Down Expand Up @@ -84,6 +85,7 @@ def test_lm_backward(self, dat, dtype):
@pytest.mark.parametrize('dat', [0.5, 0.624, 1.0, 1.5, 2.0, 3.0, 3.6767, 4.0])
@pytest.mark.parametrize('dtype', [np.float32, np.float64])
@switchconfig(log_level='DEBUG', safe_math=True)
@skipif('cpu64-arm')
def test_lm_fb(self, dat, dtype):
"""
Test logistic map with forward and backward terms that should cancel.
Expand Down Expand Up @@ -123,6 +125,7 @@ def test_lm_fb(self, dat, dtype):
@pytest.mark.parametrize('dat', [0.5, 0.624, 1.0, 1.5, 2.0, 3.0, 3.6767, 4.0])
@pytest.mark.parametrize('dtype', [np.float32, np.float64])
@switchconfig(log_level='DEBUG', safe_math=True)
@skipif('cpu64-arm')
def test_lm_ds(self, dat, dtype):
"""
Test logistic map with 2nd derivative term that should cancel.
Expand Down

0 comments on commit ffe4226

Please sign in to comment.