Skip to content

Add an optional workflow that runs the tests on a simulated H100 - #205

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

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

Conversation

@saqibkh

@saqibkh saqibkh commented Nov 9, 2026

Copy link
Copy Markdown

The hosted runners have no GPU, so test_gpu_matches_cpu is always skipped (cuda_available() is False) and the Mandelbrot kernel is only compiled, never run. This adds a separate, optional workflow .github/workflows/gpu-sim.yml that builds the extension and runs the tests on a simulated NVIDIA H100 using PantheonSim (no GPU needed). 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 the CUDA 13.0 toolkit and the simulated H100
  • builds with pip install . --group test, passing CMAKE_CUDA_ARCHITECTURES=90-virtual (the simulator runs the embedded PTX)
  • the simulator needs a shared CUDA runtime, and CMakeLists.txt sets CUDA_RUNTIME_LIBRARY Static on the target, so the job changes that one word with sed in its own checkout; the repository files are not modified
  • runs pytest -rs tests under vgpu run
  • runs on manual dispatch and on pull requests to master that touch src/, tests/, CMakeLists.txt or pyproject.toml, with a concurrency group that cancels superseded runs

Notes:

  • Run on my fork: https://github.com/saqibkh/cuda_example/actions/runs/42658608952 . All 3 tests passed with none skipped, including test_gpu_matches_cpu, which compares the GPU image with the CPU image.
  • That run took 15m42s: about 15 minutes for the simulator and toolkit setup, 15 seconds for the build and install, and about 1 second for the tests.

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