From f84ae3083bfc8e43ce590394b3959635dda49a5d Mon Sep 17 00:00:00 2001 From: Saqib Khan <11544614+saqibkh@users.noreply.github.com> Date: Mon, 9 Nov 2026 17:19:42 -0600 Subject: [PATCH] Add an optional workflow that runs the CUDA tests on a simulated H100 --- .github/workflows/gpu-sim.yml | 69 +++++++++++++++++++++++++++++++++++ 1 file changed, 69 insertions(+) create mode 100644 .github/workflows/gpu-sim.yml diff --git a/.github/workflows/gpu-sim.yml b/.github/workflows/gpu-sim.yml new file mode 100644 index 0000000..8774d2a --- /dev/null +++ b/.github/workflows/gpu-sim.yml @@ -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$'