Skip to content

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

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

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

Conversation

@saqibkh

@saqibkh saqibkh commented Nov 9, 2026

Copy link
Copy Markdown

The CI here has no job that executes the CUDA code: build.yml only builds wheels and an sdist, because the hosted runners have no GPU. This adds a separate, optional workflow .github/workflows/gpu-sim.yml that builds pytigre with CUDA 13.0 and runs the Python tests that need a GPU 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 pip install . and runs pytest under vgpu run.
  • The simulator runs PTX only, but setup.py builds -gencode=arch=compute_X,code=sm_X (SASS) for every architecture nvcc lists. The workflow therefore applies a two-line sed to setup.py on the runner (not in the repo) so it builds a single compute_90 PTX target. The extensions already link the shared libcudart, so nothing else needs to change.
  • Collects only the test_*.py modules in Python/tests and skips test_config_gen.py. algorithm_test.py, stdout_test.py and test_config_gen.py do not import (tigre.demos is not packaged in the install, and stdout_test.py imports Python 2's StringIO), so they are left out; I did not change them.
  • Triggers: workflow_dispatch and pull_request limited to Common/, Python/, setup.py, pyproject.toml and the workflow itself. A concurrency group cancels superseded runs, with permissions: contents: read.

What is left out:

  • Only one architecture (H100, PTX for compute_90) and one CUDA version (13.0) are covered.
  • The MATLAB interface and the three legacy test scripts above are not exercised.

Result on a fork: the run passed. 70 tests passed and none were skipped, including the 9 Krylov smoke tests (test_krylov_smoke.py, which run Ax and Atb on a 64^3 phantom with 50 views) and the GPU-id tests. The whole job took about 24 minutes on a cold cache, of which about 15.7 minutes was the action setting up the simulator on its first run. The build step took about 48 seconds and the tests about 7 minutes.

Run: https://github.com/saqibkh/TIGRE/actions/runs/42660482796

@AnderBiguri

Copy link
Copy Markdown
Member

Thanks @saqibkh ! I will leave this open for a bit, as I want to first to a push of making a good CI/tests for TIGRE (hopefully less computationally costly) and then see if this CI idea of simulating a GPU is worth doing for TIGRE. This is nevertheless quite interesting, so thanks.

@saqibkh

saqibkh commented Nov 10, 2026

Copy link
Copy Markdown
Author

Thanks, no rush. If it helps, I can adjust the workflow to whatever test set you settle on.

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.

2 participants