Skip to content

Add Colab notebook for real-GPU validation - #6

Merged
rasidi3112 merged 2 commits into
mainfrom
feat/colab-gpu-validation
Oct 24, 2026
Merged

rasidi3112 merged 2 commits into
mainfrom
feat/colab-gpu-validation

Conversation

@rasidi3112

Copy link
Copy Markdown
Owner

Summary

GitHub's hosted runners have no GPU, so the real-CuPy tests are always skipped in CI. This adds notebooks/gpu_validation.ipynb, which can be opened in Google Colab on a free GPU runtime. The notebook:

  1. runs the full test suite, including test_real_cupy_matches_cpu and the legacy tests/test_3d_gpu_solver.py;
  2. benchmarks CPU vs GPU on 3D rotating Gross–Pitaevskii runs (64³–160³) and reports the largest |ψ_GPU − ψ_CPU|;
  3. prints a summary for the README.

It also explains itself and skips the GPU parts when no NVIDIA driver is present, and it is safe to run more than once. The README GPU section gains an "Open in Colab" badge.

Test plan

  • Notebook validates with nbformat
  • Executed end to end locally without a GPU: GPU parts skipped with a clear message, 118 tests pass, CPU benchmark runs
  • "Run all" executed twice in the same kernel without errors
  • Run on a Colab GPU runtime (results to be added to the README)

- notebooks/gpu_validation.ipynb: runs the full test suite including the
  real-CuPy tests (skipped on GPU-less CI), the CPU vs GPU benchmark, and
  prints a summary; degrades gracefully without an NVIDIA driver and is
  safe to "Run all" repeatedly
- README: Open in Colab badge in the GPU section
Measured with notebooks/gpu_validation.ipynb on Google Colab: 130 tests
pass with none skipped (14 real-GPU tests), GPU and CPU results agree to
about 1e-15, and a 3D rotating GPE run is 7.6-12.5x faster than Colab's
2-vCPU CPU (about 3x faster than an 8-core Apple M1 at 128^3).
@rasidi3112
rasidi3112 merged commit d604bd1 into main Oct 24, 2026
6 checks passed
@rasidi3112
rasidi3112 deleted the feat/colab-gpu-validation branch October 24, 2026 07:27
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