Skip to content

Commit 9eb45d8

Browse files
committed
Add an optional workflow that runs the GPU tests on a simulated H100
1 parent 67c6589 commit 9eb45d8

1 file changed

Lines changed: 78 additions & 0 deletions

File tree

‎.github/workflows/gpu-sim.yml‎

Lines changed: 78 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,78 @@
1+
name: CUDA tests (simulated H100)
2+
3+
# Optional, non-required check. The hosted runners have no GPU, so this builds
4+
# the test suite and runs the GPU-tagged tests on a simulated NVIDIA H100
5+
# (https://github.com/pantheongpu/pantheonsim). A simulator cannot reproduce
6+
# hardware-specific behavior or timing, so it complements real-GPU testing and
7+
# does not replace it.
8+
9+
on:
10+
workflow_dispatch:
11+
pull_request:
12+
branches: ["main"]
13+
paths:
14+
- "include/**"
15+
- "tests/**"
16+
- "examples/**"
17+
- "CMakeLists.txt"
18+
- ".github/workflows/gpu-sim.yml"
19+
20+
concurrency:
21+
group: ${{ github.workflow }}-${{ github.ref }}
22+
cancel-in-progress: true
23+
24+
permissions:
25+
contents: read
26+
27+
jobs:
28+
cuda-sim:
29+
name: CUDA 13.0, simulated H100
30+
runs-on: ubuntu-24.04
31+
timeout-minutes: 120
32+
33+
steps:
34+
- uses: actions/checkout@v4
35+
with:
36+
submodules: true
37+
persist-credentials: false
38+
39+
- name: Set up the simulated GPU and CUDA toolkit
40+
uses: pantheongpu/setup-pantheonsim@ca87fe3143b29166822b923d6050945c5179408c # v0.1.5
41+
with:
42+
gpu: nvidia/h100
43+
cuda-toolkit: "13.0"
44+
45+
# The simulator runs PTX only (90-virtual) and needs a shared CUDA runtime.
46+
- name: Configure CMake
47+
run: |
48+
cmake -B build -S . \
49+
-DCMAKE_BUILD_TYPE=Release \
50+
-DCMAKE_CUDA_COMPILER=/usr/local/cuda-13.0/bin/nvcc \
51+
-DCMAKE_CUDA_ARCHITECTURES=90-virtual \
52+
-DCMAKE_CUDA_RUNTIME_LIBRARY=Shared \
53+
-DKERNEL_FLOAT_BUILD_TEST=1 \
54+
-DKERNEL_FLOAT_BUILD_EXAMPLE=1
55+
56+
- name: Build
57+
run: cmake --build build -j3
58+
59+
# Four test cases are skipped (see the filter below):
60+
# - binary operators and constant eq tests for __nv_bfloat16: the
61+
# simulator compares .bf16 values by raw bits in setp
62+
# (pantheongpu/pantheonsim#502).
63+
# - ternary operators for __half: the reference expression x * y + z
64+
# compiles to mul.f16 and add.f16 without a rounding modifier. Hardware
65+
# fuses them into an fma, the simulator rounds twice, so the last bit
66+
# can differ.
67+
# - ternary operators for __nv_bfloat16: also fails on an RTX 3060 (sm_86).
68+
- name: Run tests
69+
working-directory: build
70+
run: |
71+
vgpu run ./tests/kernel_float_tests --durations=yes \
72+
'~"binary operators - GPU - __nv_bfloat16" ~"constant eq tests - GPU - __nv_bfloat16" ~"ternary operators - GPU - __half" ~"ternary operators - GPU - __nv_bfloat16"'
73+
74+
# vector_add and vector_add_tiling are not run: they index empty
75+
# std::vectors and crash on real hardware as well.
76+
- name: Run example
77+
working-directory: build/examples
78+
run: vgpu run ./pi/kernel_float_pi

0 commit comments

Comments
 (0)