Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
69 changes: 69 additions & 0 deletions .github/workflows/gpu-sim.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,69 @@
name: GPU Simulator

# Optional, non-required check. The hosted runners have no GPU, so the CUDA
# backend is never run in the existing workflows (both configure with
# THERMOGPU_ENABLE_CUDA=OFF). This builds it and runs the tests, including
# pr_cuda_batch and pr_cuda_differential, on a simulated NVIDIA H100
# (https://github.com/pantheongpu/pantheonsim). A simulator cannot reproduce
# hardware-specific behavior or timing, so it complements real-GPU testing and
# does not replace it.

on:
workflow_dispatch:
pull_request:
branches: [ main ]
paths:
- "src/**"
- "include/**"
- "tests/**"
- "apps/**"
- "cmake/**"
- "CMakeLists.txt"
- ".github/workflows/gpu-sim.yml"

concurrency:
group: gpu-sim-${{ github.ref }}
cancel-in-progress: true

permissions:
contents: read

jobs:
tests:
name: CUDA tests (CUDA 13.0, simulated H100)
runs-on: ubuntu-24.04
timeout-minutes: 90

steps:
- uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 # v7.0.0
with:
persist-credentials: false

- name: Set up the simulated GPU and CUDA toolkit
uses: pantheongpu/setup-pantheonsim@ca87fe3143b29166822b923d6050945c5179408c # v0.1.5
with:
gpu: nvidia/h100
cuda-toolkit: "13.0"

# CMakeLists.txt sets no CUDA architecture. 90-virtual embeds PTX only,
# which is what the simulator runs, and the simulator needs a shared
# CUDA runtime.
- name: Configure
run: |
cmake -S . -B build \
-DCMAKE_BUILD_TYPE=Release \
-DTHERMOGPU_ENABLE_OPENMP=ON \
-DTHERMOGPU_ENABLE_CUDA=ON \
-DCMAKE_CUDA_ARCHITECTURES=90-virtual \
-DCMAKE_CUDA_RUNTIME_LIBRARY=Shared

- name: Build
run: cmake --build build -j3

# thermomodel_pr_tp_cuda_parity is left out: its tolerance is 1e-12 and
# the simulated H100 gives 1.04e-12 at 3 of 4.8 million comparisons
# (the same PTX gives 9.1e-13 at most on an RTX 3060). The kernel
# computes reciprocals from rcp.approx.ftz.f64 plus Newton steps, and
# the low bits of rcp.approx are not specified.
- name: Test
run: vgpu run ctest --test-dir build --output-on-failure -E '^thermomodel_pr_tp_cuda_parity$'