From 2e84730a924195ed07eb3cfa3fc30454a056c864 Mon Sep 17 00:00:00 2001 From: Saqib Khan <11544614+saqibkh@users.noreply.github.com> Date: Mon, 9 Nov 2026 10:49:14 -0600 Subject: [PATCH] Add optional workflow that runs the tests on a simulated H100 --- .github/workflows/gpu-sim.yml | 58 +++++++++++++++++++++++++++++++++++ 1 file changed, 58 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..9dd5710 --- /dev/null +++ b/.github/workflows/gpu-sim.yml @@ -0,0 +1,58 @@ +name: GPU Simulator + +# Optional, non-required check. The hosted runners have no GPU, so this builds +# the CUDA extension and runs the tests, including the GPU Mandelbrot test that +# is skipped elsewhere, 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: [ master ] + paths: + - "src/**" + - "tests/**" + - "CMakeLists.txt" + - "pyproject.toml" + - ".github/workflows/gpu-sim.yml" + +concurrency: + group: ${{ github.workflow }}-${{ github.ref }} + cancel-in-progress: true + +permissions: + contents: read + +jobs: + tests: + name: Tests (CUDA 13.0, simulated H100) + runs-on: ubuntu-24.04 + timeout-minutes: 60 + + steps: + - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 + 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" + + # The simulator needs a shared CUDA runtime, but CMakeLists.txt links it + # statically, so switch that one line for this job. The simulator runs + # the PTX embedded by architecture 90-virtual. + - name: Build and install + run: | + sed -i 's/CUDA_RUNTIME_LIBRARY Static/CUDA_RUNTIME_LIBRARY Shared/' CMakeLists.txt + python3 -m venv /tmp/venv + /tmp/venv/bin/pip install --upgrade pip + /tmp/venv/bin/pip install --verbose . --group test \ + --config-settings=cmake.define.CMAKE_CUDA_ARCHITECTURES=90-virtual + + # -rs lists skipped tests; the GPU test must not be skipped. + - name: Test + run: vgpu run /tmp/venv/bin/pytest -rs tests