Repository navigation
feat: environment probe, PYAUTO_SETUP at import, honour JAX_ENABLE_X64=False - #223
Merged
Merged
Conversation
…4=False (#222) 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
Phase 5A of the likelihood-lifecycle epic (part of #222). This adds the environment layer that
setup="auto"will sit on. It does three things: a hardware probe, an explicitPYAUTO_SETUPoverride honoured at import, and a fix so thatJAX_ENABLE_X64=Falseis respected. It only detects and honours; it chooses no setup. Choosing is 5B'sSetup.autoin PyAutoArray.API Changes
autonerves.environment:Environment.detect()reports GPU (present, name, memory), usable cores, RAM, numba and nufftax availability, and a site hint. It never imports JAX itself.autonerves.environment.parse_setup_intent(value)turnsPYAUTO_SETUP(auto,cpu,gpuor asetup_id) intoauto,cpuorgpu. 5B will reuse it.PYAUTO_SETUP=cpu, or a CPUsetup_idsuch asnumba_cpu_sparse_fp64, now setsJAX_PLATFORMS=cpuand the OMP/MKL/OPENBLAS/NUMBA thread counts at import. It fills in only the ones you haven't set.auto, unset andgpuchange nothing. An invalid value raises aValueErrorthat names the allowed forms.JAX_ENABLE_X64=Falseor0is now respected. Before, it was overwritten withTrue. Unset still turns x64 on.See full details below.
Test Plan
python -m pytest test_autonerves -q: 375 passed (80 of these tests are intest_environment.py/test_jax_wrapper.py)PYAUTO_SETUP(cpu, setup_id, user values kept, auto/unset/gpu, invalid) and forjax_enable_x64under False, 0, false, unset, True and 1Heart dev readiness (PyAutoNerves): GREEN. Reasons shown but not blocking: manifest drift (1 workspace checkout mismatch against repos.yaml); release validation incomplete (no rehearsal for current source).
Note: the subprocess tests run
python -Swith the parentsys.path, because the local venv's00_pyauto313.pthstartup hook forcesJAX_PLATFORMS=cpuand the thread variables to 1. Without-S, that hook would also overridePYAUTO_SETUP's thread defaults on that machine.Full API Changes (for automation & release notes)
Added
autonerves.environment.Environment(frozen dataclass:gpu,gpu_name,gpu_memory_gb,cores,ram_gb,numba,nufftax,site) andEnvironment.detect()autonerves.environment.parse_setup_intent(value) -> "auto" | "cpu" | "gpu": acceptsauto,cpu,gpuor(jax|numba|numpy)_(cpu|gpu)_<operator>_(fp64|fp32|mp)[_<transformer>]autonerves.environment.detect_cores(),detect_ram_gb(),detect_gpu(),detect_site()PYAUTO_SETUPread at import byautonerves.jax_wrapperChanged
JAX_ENABLE_X64=False|0is no longer overwritten withTrueMigration
JAX_ENABLE_X64=Falseexpecting fp64 now gets fp32; unset the variable to keep fp64.Generated by the PyAutoLabs agent workflow.
🤖 Generated with Claude Code