Skip to content

CI: run cust's tests on a simulated GPU - #415

Open
saqibkh wants to merge 1 commit into
Rust-GPU:mainfrom
saqibkh:ci-simulated-gpu
Open

saqibkh wants to merge 1 commit into
Rust-GPU:mainfrom
saqibkh:ci-simulated-gpu

Conversation

@saqibkh

@saqibkh saqibkh commented Oct 2, 2026

Copy link
Copy Markdown

The Linux CI runs cargo test --workspace --exclude blastoff --exclude cudnn --exclude cust, because cust's tests need an NVIDIA GPU. This adds a job that runs them on a simulated one: cargo test -p cust, unit tests and doc tests.

How: PantheonSim, via pantheongpu/setup-pantheonsim, installs the CUDA toolkit and puts a simulated GPU behind libcuda on the runner's CPU. cust's calls go through the simulator's driver API (contexts, streams, events, device and unified memory, CUDA arrays, modules, launches), so the results are real. There is no timing model, so this checks correctness, not performance.

Changes: one new job at the end of ci_linux.yml, test-cust-simulated-gpu, on a plain ubuntu-24.04 runner rather than the build containers:

  • set up CUDA 12.8 and a simulated T4;
  • install libclang-dev for bindgen;
  • cargo test -p cust, with CUDA_PATH pointing at the toolkit.

It uses the repo's pinned nightly from rust-toolchain.toml. The existing jobs are unchanged.

What it can touch: the action is pinned by commit (v0.1.2), not by a tag, and it pins the simulator it builds by commit too, so nothing in the job changes until you move the pin. The new job's token is read-only (permissions: contents: read), and the action uses no token or secrets; it installs packages only from Ubuntu's and NVIDIA's repositories. The job isn't a required check, so a red run never blocks a merge unless you decide it should.

What it gives, from a run on my fork:

  • All 76 cust unit tests and all 145 doc tests pass (2 are ignored in the source), in about 5 seconds.
  • The job takes about 3 minutes. The action caches the simulator it builds, per pinned version, so only the first run in the repository builds it (about 18 minutes that time).

Disclosure: I maintain PantheonSim. Running cust's tests found several gaps in its driver API that are now fixed: CUDA arrays, cuMemcpy2D/3D, pitched and stream-ordered allocation, cuModuleGetGlobal, the context cache and shared-memory configuration, stream callbacks, and cuEventElapsedTime's refusals. If the job is ever flaky or wrong, please open an issue at pantheongpu/pantheonsim and I'll fix it on our side.

🤖 Generated with Claude Code

The Linux jobs exclude cust from cargo test because its tests need an
NVIDIA GPU. PantheonSim simulates one on the runner's CPU; this job
runs cust's unit and doc tests there.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

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