Repository navigation
fix: detect no GPU when JAX_PLATFORMS excludes GPU platforms - #224
Merged
Merged
Conversation
Part of the concise automatic compute-setup banner (PyAutoLabs/PyAutoGalaxy#754): one header line stating the automatic CPU/GPU choice, aligned Setup / Parallel / Estimate lines printed together, and notices when the setup acts outside modeling. Shares branch feature/auto-setup-banner across PyAutoNerves, PyAutoArray, PyAutoFit, PyAutoGalaxy and PyAutoLens. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
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.
Summary
detect_gpureports no GPU whenJAX_PLATFORMS(or the olderJAX_PLATFORM_NAME) is set and names no GPU platform (cuda,rocm,gpu), without runningnvidia-smi. JAX won't use an installed GPU then, sosetup="auto"must not choose a GPU setup. Previously this was only right when JAX happened to be imported before detection, which PyAutoFit's old fit-start line did; the banner change removed that line and exposed the bug.Test Plan
pytest test_autonerves: 384 passed (new: 4 restricted-to-CPU cases skip nvidia-smi; 5 GPU or empty cases still query it; theno_jaxfixture clearsJAX_PLATFORMS/JAX_PLATFORM_NAME)pyauto-heart smoke --affected-by PyAutoNerves --jobs 3over the task root (all five branches): 8/8 workspaces PASSThe terminal output now (real test-mode run from autolens_workspace)
A rectangular pixelization fit with
setup="auto"andaf.Nautilus(number_of_cores="auto"), on a laptop (8 cores, RTX 2060, JAX pinned to CPU byJAX_PLATFORMS=cpu), with timestamps trimmed:Outside modeling, a plain
al.FitImaging(dataset, tracer, settings=aa.Settings(lazy_sparse_operator="auto"))prints once, and the second fit reuses the cache silently:Before this change the same run printed a stale
Starting non-linear search with JAX (CPU: cpu).before setup resolution, a verbose Setup line, and warnings between the lines. After the old JAX line was removed, the run also pickedJAX · GPU · dense(detected vianvidia-smi) while JAX ran on the CPU. The PyAutoNerves PR fixes that.All five PRs share the branch name
feature/auto-setup-banner, so each repo's CI tests them together. Merge order: PyAutoNerves → PyAutoArray → PyAutoFit → PyAutoGalaxy → PyAutoLens.Part of PyAutoLabs/PyAutoGalaxy#754 (format approved by the human on 2026-11-25).
Generated by the PyAutoLabs agent workflow.
🤖 Generated with Claude Code