-
Notifications
You must be signed in to change notification settings - Fork 231
119 lines (102 loc) · 3.55 KB
/
pytest-gpu.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
# Runner information:
# OpenACC on NVidia runs on `sarlaac`
# OpenMP on NVidia runs on `kimogila`
# OpenMP on AMD runs on `wampa`
name: CI-gpu
env:
OUTPUT_PATH: ${{ github.workspace }}
RESOURCE_GROUP: CI-gpu
on:
# Trigger the workflow on push or pull request,
# but only for the master branch
push:
branches:
- master
pull_request:
branches:
- master
# Push-button activation
workflow_dispatch:
inputs:
tags:
description: 'Run GPU tests'
jobs:
build:
name: ${{ matrix.name }}
runs-on: ${{ matrix.tags }}
env:
DEVITO_ARCH: ${{ matrix.arch }}
DEVITO_PLATFORM: ${{ matrix.platform }}
DEVITO_LANGUAGE: ${{ matrix.language }}
OMPI_CC: ${{ matrix.arch }}
strategy:
# Prevent all builds from terminating if one fails
fail-fast: false
matrix:
name: [
pytest-gpu-omp-nvidia,
pytest-gpu-acc-nvidia,
pytest-gpu-omp-amd
]
include:
- name: pytest-gpu-omp-nvidia
test_file: "tests/test_gpu_openmp.py"
env_file: "devito-ci-nvidia-openmp.env"
test_drive_cmd: "nvidia-smi"
arch: "clang"
platform: "nvidiaX"
language: "openmp"
tags: ["self-hosted", "gpu", "openmp", "clang"]
- name: pytest-gpu-acc-nvidia
test_file: "tests/test_gpu_openacc.py"
env_file: "devito-ci-nvidia-openacc.env"
test_drive_cmd: "nvidia-smi"
arch: "nvc"
platform: "nvidiaX"
language: "openacc"
tags: ["self-hosted", "gpu", "openacc"]
- name: pytest-gpu-omp-amd
test_file: "tests/test_gpu_openmp.py"
env_file: "devito-ci-amd-openmp.env"
test_drive_cmd: "rocm-smi"
arch: "aomp"
platform: "amdgpuX"
language: "openmp"
tags: ["self-hosted", "gpu", "openmp", "aomp"]
steps:
- name: Checkout devito
uses: actions/checkout@v1
- name: Set environment
run: |
source $HOME/${{ matrix.env_file }}
echo "PATH=$PATH" >> $GITHUB_ENV
echo "LD_LIBRARY_PATH=$LD_LIBRARY_PATH" >> $GITHUB_ENV
- name: Install dependencies
run: |
pip3 install --upgrade pip
pip3 install -e .[extras]
- name: Test with pytest
run: |
${{ matrix.test_drive_cmd }}
pytest --cov --cov-config=.coveragerc --cov-report=xml tests/test_adjoint.py tests/test_gpu_common.py
pytest --cov --cov-config=.coveragerc --cov-report=xml ${{ matrix.test_file }}
- name: Test examples
run: |
pytest examples/seismic/acoustic/acoustic_example.py
pytest examples/seismic/elastic/elastic_example.py
pytest examples/seismic/tti/tti_example.py
pytest examples/seismic/viscoacoustic/viscoacoustic_example.py
pytest examples/seismic/viscoelastic/viscoelastic_example.py
- name: Test examples with MPI
if: matrix.name != 'pytest-gpu-omp-amd'
run: |
DEVITO_MPI=1 mpirun -n 2 pytest examples/seismic/acoustic/acoustic_example.py
DEVITO_MPI=1 mpirun -n 2 pytest examples/seismic/elastic/elastic_example.py
DEVITO_MPI=1 mpirun -n 2 pytest examples/seismic/tti/tti_example.py
DEVITO_MPI=1 mpirun -n 2 pytest examples/seismic/viscoacoustic/viscoacoustic_example.py
DEVITO_MPI=1 mpirun -n 2 pytest examples/seismic/viscoelastic/viscoelastic_example.py
- name: Upload coverage to Codecov
uses: codecov/codecov-action@v2
with:
token: ${{ secrets.CODECOV_TOKEN }}
name: ${{ matrix.name }}