Skip to content

Commit dfa8dd2

Browse files
committed
adds AMD/HIP autotesting via AT2
1 parent 61efe1d commit dfa8dd2

File tree

3 files changed

+136
-1
lines changed

3 files changed

+136
-1
lines changed

.github/workflows/README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ To do this, testing is initialized via the top-level workflow, `MAM4xx Autoteste
1212

1313
#### GPU-based Testing
1414

15-
| Test Name | GPU Brand | GPU Type | Micoarchitecture | Compute Capability | Machine | Compilers |
15+
| Test Name | GPU Brand | GPU Type | Microarchitecture | Compute Capability | Machine | Compilers |
1616
| --------------------------------- | --------- | -------- | ---------------- | ------------------ | ------- | ---------------------------- |
1717
| GPU AT2 gcc 12.3 cuda 12.1 | NVIDIA | H100 | Hopper | 9.0 | blake | `gcc` 12.3.0/`nvcc` 12.1.105 |
1818

.github/workflows/at2_gcc-hip.yml

Lines changed: 122 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,122 @@
1+
name: "GPU AT2 gcc 13.3 hip 6.2"
2+
3+
on:
4+
workflow_call:
5+
inputs:
6+
precision:
7+
required: false
8+
type: string
9+
build_type:
10+
required: false
11+
type: string
12+
13+
jobs:
14+
# this is more work than I'd expect, but this is how you pass info after
15+
# operating on it in a job/step
16+
# TODO: factor this out into an action?
17+
# parse the inputs from the workflow call that'll be used by strategy.matrix
18+
define_matrix:
19+
runs-on: ubuntu-22.04
20+
# define the outputs that will come from the steps below
21+
outputs:
22+
build_type: ${{ steps.build_type.outputs.build_type }}
23+
precision: ${{ steps.precision.outputs.precision }}
24+
steps:
25+
- name: Define build_type
26+
id: build_type
27+
env:
28+
# if empty (i.e., triggered by PR) make ALL default
29+
btype: ${{ inputs.build_type || 'ALL' }}
30+
# this is a little over-cautious, since the 'else' should never happen
31+
run: |
32+
case ${{ env.btype }} in
33+
"Debug")
34+
echo 'build_type=["Debug"]' >> "$GITHUB_OUTPUT" ;;
35+
"Release")
36+
echo 'build_type=["Release"]' >> "$GITHUB_OUTPUT" ;;
37+
"ALL")
38+
echo 'build_type=["Debug", "Release"]' >> "$GITHUB_OUTPUT" ;;
39+
*)
40+
echo 'build_type=["Debug", "Release"]' >> "$GITHUB_OUTPUT" ;;
41+
esac
42+
- name: Define precision
43+
id: precision
44+
env:
45+
prec: ${{ inputs.precision || 'ALL' }}
46+
run: |
47+
case ${{ env.prec }} in
48+
"Debug")
49+
echo 'precision=["single"]' >> "$GITHUB_OUTPUT" ;;
50+
"Release")
51+
echo 'precision=["double"]' >> "$GITHUB_OUTPUT" ;;
52+
"ALL")
53+
echo 'precision=["single", "double"]' >> "$GITHUB_OUTPUT" ;;
54+
*)
55+
echo 'precision=["single", "double"]' >> "$GITHUB_OUTPUT" ;;
56+
esac
57+
gcc-cuda:
58+
runs-on: [self-hosted, m4xci-snl-hip, hip, gcc]
59+
# will run other tests in the matrix even if one fails
60+
# NOTE: prioritizes extra info over speed, so consider whether this makes sense
61+
continue-on-error: false
62+
needs: define_matrix
63+
# A build matrix storing all desired configurations.
64+
strategy:
65+
fail-fast: true
66+
matrix:
67+
# to get the array instead of a string, need the fromJSON()
68+
build-type: ${{ fromJSON(needs.define_matrix.outputs.build_type) }}
69+
fp-precision: ${{ fromJSON(needs.define_matrix.outputs.precision) }}
70+
name: gcc-hip / ${{ matrix.build-type }} - ${{ matrix.fp-precision }}
71+
steps:
72+
- name: Check out the repository
73+
uses: actions/checkout@v4
74+
with:
75+
persist-credentials: false
76+
show-progress: false
77+
submodules: recursive
78+
- name: Cloning Haero
79+
uses: actions/checkout@v4
80+
with:
81+
repository: eagles-project/haero
82+
submodules: recursive
83+
path: haero_src
84+
- name: Show action trigger
85+
uses: ./.github/actions/show-workflow-trigger
86+
- name: Building Haero (${{ matrix.build-type }}, ${{ matrix.fp-precision }} precision)
87+
run: |
88+
cmake -S haero_src -B haero_build \
89+
-DCMAKE_BUILD_TYPE=${{ matrix.build-type }} \
90+
-DCMAKE_INSTALL_PREFIX="haero_install" \
91+
-DCMAKE_C_COMPILER=gcc \
92+
-DCMAKE_CXX_COMPILER=hipcc \
93+
-DHAERO_SKIP_FIND_YAML_CPP=ON \
94+
-DHAERO_ENABLE_MPI=OFF \
95+
-DHAERO_ENABLE_GPU=ON \
96+
-DHAERO_PRECISION=${{ matrix.fp-precision }} \
97+
-DKokkos_ARCH_AMD_GFX90A=ON \
98+
-DHAERO_DEVICE_ARCH=AMD_GFX90A
99+
cd haero_build
100+
make -j
101+
make install
102+
- name: Configuring MAM4xx (${{ matrix.build-type }}, ${{ matrix.fp-precision }} precision)
103+
run: |
104+
cmake -S . -B build \
105+
-DCMAKE_CXX_COMPILER=hipcc \
106+
-DCMAKE_C_COMPILER=gcc \
107+
-DCMAKE_INSTALL_PREFIX=$(pwd)/install \
108+
-DCMAKE_BUILD_TYPE=${{ matrix.build-type }} \
109+
-DMAM4XX_HAERO_DIR=$(pwd)/haero_install \
110+
-DNUM_VERTICAL_LEVELS=72 \
111+
-DENABLE_COVERAGE=OFF \
112+
-DENABLE_SKYWALKER=ON \
113+
-DCMAKE_CUDA_ARCHITECTURES=AMD_GFX90A \
114+
-G "Unix Makefiles"
115+
- name: Building MAM4xx (${{ matrix.build-type }}, ${{ matrix.fp-precision }} precision)
116+
run: |
117+
cd build
118+
make -j
119+
- name: Running tests (${{ matrix.build-type }}, ${{ matrix.fp-precision }} precision)
120+
run: |
121+
cd build
122+
ctest -V --output-on-failure

.github/workflows/m4x_autotester_main.yml

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,7 @@ on:
3131
default: 'GPU-NVIDIA_H100'
3232
options:
3333
- GPU-NVIDIA_H100
34+
- GPU-AMD_MI200-series
3435
- CPU-Ubuntu_22-04
3536
- ALL
3637
precision:
@@ -71,6 +72,10 @@ jobs:
7172
if: ${{ github.event.pull_request || github.event.schedule }}
7273
uses:
7374
./.github/workflows/at2_gcc-cuda.yml
75+
gcc-hip:
76+
if: ${{ github.event.pull_request || github.event.schedule }}
77+
uses:
78+
./.github/workflows/at2_gcc-hip.yml
7479
gcc-cpu_gh:
7580
if: ${{ github.event.pull_request || github.event.schedule }}
7681
secrets:
@@ -89,6 +94,14 @@ jobs:
8994
build_type: ${{ github.event.inputs.build_type }}
9095
uses:
9196
"./.github/workflows/at2_gcc-cuda.yml"
97+
manual-gpu_hip:
98+
if: ${{ contains(github.event.inputs.architecture, 'GPU-AMD_MI200-series') ||
99+
contains(github.event.inputs.architecture, 'ALL') }}
100+
with:
101+
precision: ${{ github.event.inputs.precision }}
102+
build_type: ${{ github.event.inputs.build_type }}
103+
uses:
104+
"./.github/workflows/at2_gcc-hip.yml"
92105
manual-cpu_gh:
93106
if: ${{ contains(github.event.inputs.architecture, 'CPU-Ubuntu_22-04') ||
94107
contains(github.event.inputs.architecture, 'ALL') }}

0 commit comments

Comments
 (0)