phase 2: build_info() surface + scaling-validation harness (#256)#258
Merged
jameslehoux merged 2 commits intomasterfrom Apr 21, 2026
Merged
phase 2: build_info() surface + scaling-validation harness (#256)#258jameslehoux merged 2 commits intomasterfrom
jameslehoux merged 2 commits intomasterfrom
Conversation
added 2 commits
April 21, 2026 06:55
Re-wraps lines flagged by the clang-format CI check in the preconditioner and MLMG-knobs plumbing. No behavior change. https://claude.ai/code/session_011dJ5Bwq4Tnr8wxH597XJFf
Colab users can't currently tell whether they installed the CPU wheel
(``openimpala``) or the GPU wheel (``openimpala-cuda``) — the only way to
probe was to grep for "CUDA" in a subprocess init banner. That hack is now
replaced with a proper API.
New: openimpala.build_info()
Returns a dict with compile-time flags (cuda/hip/openmp/mpi/tiny_profile,
hypre_cuda/hypre_hip) plus a runtime ``gpu_device_count``. Exposes
OPENIMPALA_USE_CUDA / HYPRE_USING_CUDA / _OPENMP via #ifdef and wraps
them in a py::dict. Pure-Python fallback reports "pure-python" backend
and probes cupy availability.
The backend string — "cpp-cuda" / "cpp-hip" / "cpp-cpu" / "pure-python" —
is the single-shot answer Colab users need.
Notebook §1a
Rewritten to consume oi.build_info() directly (with a subprocess-banner
fallback for pre-4.0.2 wheels). When a GPU is present but the build is
cpp-cpu, prints the exact two-line fix:
!pip uninstall -y openimpala
!pip install openimpala-cuda
Notebook §9b — scaling validation harness
New section fits t(N) = a·N^p across 32³ / 64³ / 96³ / 128³ for three
representative solver choices: plain PCG, PCG+PFMG, MLMG. Prints the
fitted exponent and reports pass/fail against the issue #256 acceptance
target (p < 1.2). Plots wall time on a log-log axis with O(N) and
O(N^1.76) reference lines — the latter being the baseline from §3b.
This is the regression harness for workstream B: every future change to
the Krylov / multigrid path can be checked against the same notebook
section with no human interpretation.
https://claude.ai/code/session_011dJ5Bwq4Tnr8wxH597XJFf
Performance Benchmark Results
Fastest solver: bicgstab at 64³ (0.3734s) Benchmark: uniform block (analytical τ = (N-1)/N) |
Code Coverage ReportGenerated by CI — coverage data from gcovr |
Codecov Report❌ Patch coverage is
📢 Thoughts on this report? Let us know! |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Colab users can't currently tell whether they installed the CPU wheel
(
openimpala) or the GPU wheel (openimpala-cuda) — the only way toprobe was to grep for "CUDA" in a subprocess init banner. That hack is now
replaced with a proper API.
New: openimpala.build_info()
Returns a dict with compile-time flags (cuda/hip/openmp/mpi/tiny_profile,
hypre_cuda/hypre_hip) plus a runtime
gpu_device_count. ExposesOPENIMPALA_USE_CUDA / HYPRE_USING_CUDA / _OPENMP via #ifdef and wraps
them in a py::dict. Pure-Python fallback reports "pure-python" backend
and probes cupy availability.
The backend string — "cpp-cuda" / "cpp-hip" / "cpp-cpu" / "pure-python" —
is the single-shot answer Colab users need.
Notebook §1a
Rewritten to consume oi.build_info() directly (with a subprocess-banner
fallback for pre-4.0.2 wheels). When a GPU is present but the build is
cpp-cpu, prints the exact two-line fix:
Notebook §9b — scaling validation harness
New section fits t(N) = a·N^p across 32³ / 64³ / 96³ / 128³ for three
representative solver choices: plain PCG, PCG+PFMG, MLMG. Prints the
fitted exponent and reports pass/fail against the issue #256 acceptance
target (p < 1.2). Plots wall time on a log-log axis with O(N) and
O(N^1.76) reference lines — the latter being the baseline from §3b.
This is the regression harness for workstream B: every future change to
the Krylov / multigrid path can be checked against the same notebook
section with no human interpretation.