Repository navigation
Conversation
…nay_mge interferometer/jax_likelihood/delaunay_mge.py is the slowest entry in this workspace on the board (32.2s py3.13 / 31.8s py3.12). It compiles 507 distinct XLA executables and exactly one -- the vmapped likelihood, 2.54s -- clears JAX's default jax_persistent_cache_min_compile_time_secs of 1.0s. The other 506 compile in ~12.9s and are never written to JAX_COMPILATION_CACHE_DIR, so CI re-pays them every run. The board's cache_jax: HIT is a hit on a one-entry cache. Setting the threshold to 0 for this script lets them be persisted and reloaded. Measured locally, smoke profile, numba installed, cache built and read under each regime: threshold 1.0 (CI today) 30.5 / 31.3s cache 1 entry, 324K threshold 0 (this) 18.1 / 18.3 / 18.4s cache ~490-729 entries first run against an empty cache 34.0s (+1.2s one-off to write the entries) The CI regime reproduces the board closely (30.5-31.3s local vs 32.2s), so the ~12.5s saving is real rather than a local artefact. The script is not touched, so the release profile is unaffected and every assertion is untouched: this changes which XLA executables are persisted, not the graph, dtypes, backend or arithmetic. Output byte-identical either side (NumPy -3320.1587601763285, JIT -3320.158760510604), RC=0 throughout, and RC=0 under PROFILE=release. Verified with PyAutoHands' own tooling: env_config.build_env_for_script resolves the override for this script alone (multi_dataset/ and imaging/visualization/ correctly do not match), and validate_env_profiles reports 0 errors, including under --strict-declarations. Note: measuring this script at all requires numba; without it autoarray/numba_util.py falls back to pure Python and the script takes 96.8s instead of 18.3s, 76s of it interpreting cholesky_funcs._solve_upper_transposed_buffer. The same tax is paid by every jax_likelihood/jax_grad script in the leg, so the general fix is one line in defaults: or in PyAutoHeart's smoke-tests.yml beside the cache step; that is left as a human's call. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01ARBtVPNAVEZmdG2iDTqfMk
Replaces a drafting header ("A2 — scripts/interferometer/...") with a plain
description of what the override does. Comment only -- the pattern, key and
value are unchanged.
Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01ARBtVPNAVEZmdG2iDTqfMk
Collaborator
Author
|
Superseded by PyAutoLabs/PyAutoHeart#222 (merged 2026-09-10): Generated by Claude Code |
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.
Found by
/ci_speedupauditing the five slowest entries on the CI smoke gate.This is rank #2 across all of CI (32.2s on py3.13, 6% of that leg).
What changes
config/build/profile_smoke.yamlonly — oneset:override:The script is not touched. No assertion, tolerance, dataset size or sizing
knob changes. Nothing is skipped, disabled or quarantined.
Why
The script compiles 507 distinct XLA executables. Exactly one —
jit(call),the vmapped likelihood at 2.54s — clears JAX's default
jax_persistent_cache_min_compile_time_secsof 1.0s, which is also whatautonerves/jax_wrapper.pyos.environ.setdefault()s, so CI inherits it. Theother 506 compile in 12.9s and are never written to the persistent cache
that PyAutoHeart's
smoke-tests.ymlrestores and saves. So CI re-pays that 12.9son every run, which is why the board shows
cache_jax: HITbeside acold-looking number.
Why the assertions survive
The persistent cache is a memo of XLA compilation keyed on the lowered HLO — a
hit returns the same executable the compiler would otherwise have built, so no
computation changes. Printed output is byte-identical across both regimes and
the script exits RC=0 under the smoke profile.
profile_smoke.yamlissmoke-only, so the release profile is untouched.
Note for review
The general fix is one line in PyAutoHeart's
smoke-tests.ymlbesideJAX_COMPILATION_CACHE_DIR— every JAX smoke script pays this same tax and noneof them sets the threshold. That is a wider trade (it grows the cached artefact
by roughly 500 entries per script across two workspaces and both python legs),
so it is filed for a human as
draft/refactor/pyautoheart/smoke_jax_cache_threshold.mdrather than takenhere. This per-script override does not preclude it.
Two sibling findings from the same audit were filed rather than acted on,
because each would change what a script asserts or costs more than an agent
should price:
draft/refactor/autofit/parameterization_prior_count_blowup.md(
AbstractPriorModel.parameterizationis O(N·depth) — 7.25s of a 19.4s warm runon
multi_dataset/jax_likelihood/mge_group.py, and 25 of this workspace's 39smoke entries print a
.info) anddraft/refactor/autonerves/config_yaml_parse_cache.md.🤖 Generated with Claude Code
https://claude.ai/code/session_01ARBtVPNAVEZmdG2iDTqfMk
Generated by Claude Code