Skip to content

Add an optional workflow that runs the CUDA backend tests on a simulated H100 - #489

Open
saqibkh wants to merge 1 commit into
stotko:masterfrom
saqibkh:add-gpu-sim-ci
Open

saqibkh wants to merge 1 commit into
stotko:masterfrom
saqibkh:add-gpu-sim-ci

Conversation

@saqibkh

@saqibkh saqibkh commented Nov 7, 2026

Copy link
Copy Markdown

The CI here has no job for the CUDA backend: tests.yml only builds and runs OpenMP, because the hosted runners have no GPU. This adds a separate, optional workflow .github/workflows/gpu-sim.yml that builds stdgpu with the CUDA backend and runs the unit tests on a simulated NVIDIA H100, using PantheonSim (via the pantheongpu/setup-pantheonsim action, pinned by SHA). I am the author of PantheonSim, so please weigh this accordingly.

It does not touch the existing workflows and is not meant to be a required check. A simulator cannot reproduce hardware-specific behavior or timing, so it complements real-GPU testing and does not replace it.

What it does:

  • Installs CUDA 13.0 and the simulated H100, then configures with STDGPU_BACKEND_CUDA, STDGPU_BUILD_SHARED_LIBS=ON, CMAKE_CUDA_ARCHITECTURES=90-virtual and builds with ccache.
  • Runs teststdgpu through vgpu run ctest (all gtest cases, CUDA tests included), then runs the 12 example programs under vgpu run.
  • The simulator needs a shared CUDA runtime and PTX-only device code. stdgpu links cudart_static when built as a static library, so the workflow builds the shared library, which links cudart; 90-virtual gives PTX only. No change to the project is needed.
  • Triggers: workflow_dispatch and pull_request limited to src/, tests/, examples/, cmake/, CMakeLists.txt and the workflow itself. A concurrency group cancels superseded runs, with permissions: contents: read.

What is left out:

  • The benchmarks are not built, since they do not test anything.
  • Only one architecture (H100) and one CUDA version (13.0) are covered, and only a Release build with a shared library.
  • Nothing is excluded from the test run: all 702 test cases pass.

Result on a fork: the run passed (100% tests passed, 0 tests failed out of 1, which is the single teststdgpu ctest entry with 702 gtest cases, and all 12 examples exit 0). The whole job took about 22.5 minutes on a cold cache, of which about 16.5 minutes was the action setting up the simulator on its first run. The build took about 3 minutes and the unit tests about 3 minutes.

Run: https://github.com/saqibkh/stdgpu/actions/runs/42290609398

Build the CUDA backend and run the unit tests and examples on a simulated NVIDIA H100 (PantheonSim), since the hosted runners have no GPU.

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant