Repository navigation
Conversation
…scripts
The board's two slowest entries in this workspace are dominated by XLA
compiles that the persistent cache never stores. JAX's default
jax_persistent_cache_min_compile_time_secs is 1.0s and PyAutoHeart's
smoke-tests.yml sets no threshold, so only executables taking >1s are written
to JAX_COMPILATION_CACHE_DIR. Both scripts compile hundreds of small ones:
imaging/jax_likelihood/delaunay.py 504 executables, 471 compiled cold
misc/jax_assertions/delaunay_nn.py 312 executables, 308 of them under 1s
CI therefore re-pays them on every run, which is why the board reports
cache_jax: HIT beside a number that matches a cold run -- the cache it hit
holds 2-4 entries.
Setting the threshold to 0 for these two scripts lets those executables be
persisted and reloaded. Measured locally, smoke profile, cache built and read
under each regime (timings serialised, n=3):
imaging/jax_likelihood/delaunay.py
threshold 1.0 (CI today) 23.4 / 24.6 / 27.1s cache 2 entries, 480K
threshold 0 (this) 10.4 / 10.5s cache 513 entries, 2.9M
misc/jax_assertions/delaunay_nn.py
threshold 1.0 (CI today) 27.2 / 27.8s cache 4 entries
threshold 0 (this) 13.0 / 13.5s cache 299 entries
First run against an empty cache is unchanged (32.6s vs 33.0s): writing the
extra entries costs nothing measurable. Board reference: 32.8s and 31.8s py3.13.
Neither script is 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. Printed output diffed byte-for-byte
across both regimes, RC=0 throughout.
Verified with PyAutoHands' own tooling: env_config.build_env_for_script
resolves the override for exactly these two scripts and no others (jax_grad/
and delaunay_nn_caps.py correctly do not match), and validate_env_profiles
reports 0 errors, including under --strict-declarations.
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 grows the cached artefact ~500 entries per script,
so it is left as a human's call; this is the minimal in-lane form.
Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01ARBtVPNAVEZmdG2iDTqfMk
The previous commit on this branch un-ignored `test-results/` and committed three generated files with it. They are build artefacts, not source: - test-results/smoke_timings.json - test-results/autolens_workspace_test__scripts__script.json - test-results/autolens_workspace_test__scripts__script.md They are also stale and not from this branch's work -- the report bodies carry laptop paths (/home/jammy/Code/PyAutoLabs-wt/...) and a 2026-09-08 timestamp, and record three failing scripts unrelated to this change. `test-results/` is gitignored on main deliberately; restoring that line is the whole fix. This branch's actual change is the profile_smoke.yaml override and nothing else. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01ARBtVPNAVEZmdG2iDTqfMk
Two leftovers from how these blocks were drafted, comments only -- no
override, pattern or value changes:
- a "append this entry to overrides: in ..." instruction header that was
part of the proposal, not the file
- an unresolved "the delaunay_nn_caps.py entry below/above it" -> "above it"
Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01ARBtVPNAVEZmdG2iDTqfMk
Collaborator
Author
|
Superseded on both halves, closing without merge:
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.These are ranks #1 and #3 across all of CI.
What changes
config/build/profile_smoke.yamlonly — twoset:overrides, bothJAX_PERSISTENT_CACHE_MIN_COMPILE_TIME_SECS: "0":imaging/jax_likelihood/delaunay.pymisc/jax_assertions/delaunay_nn.pyNo script is touched. No assertion, tolerance, dataset size, or sizing knob
changes. Nothing is skipped, disabled or quarantined.
Why
Both scripts compile a long tail of small XLA executables. JAX's default
jax_persistent_cache_min_compile_time_secsis 1.0s, so those compiles arenever written to the persistent cache that PyAutoHeart's
smoke-tests.ymlalready restores and saves. The board's
cache_jax: HITis a hit on a cacheholding a handful of entries, so CI re-pays the same compile work every run —
which is why a "hit" sits next to a cold-looking number.
delaunay.py— 504 distinct executables, 471 compiled from scratch, 11.0s inbackend_compile_and_load, ~50% of the run.jax.jit(analysis_jit.fit_from)traces only the
FitImagingconstructor (the jitted call is 0.018s); thecached_propertychain that computes the likelihood runs eagerly outside it.delaunay_nn.py— 312 compiles, 20.7s of 32.9s; 308 of them take under onesecond (15.0s) and only 4 clear the threshold.
Measured
Locally under this profile, libs from source, 4 cores, timing runs serialised
under a lock. Warm cache in both regimes:
delaunay.pydelaunay_nn.pyCold cache is unchanged either way (
delaunay.py26.3 vs 28.0s;delaunay_nn.py32.9 vs 33.0s) — writing the extra entries costs nothingmeasurable. The "before" bracket reproduces CI: the board has these at 32.8s and
31.8s on py3.13, both with
cache_jax: HIT.Why the assertions survive
The persistent cache is a memo of XLA compilation keyed on the lowered HLO, so a
hit returns the executable the compiler would have built. Printed output was
diffed byte-for-byte across both regimes and is identical —
[-541.50627819 ×3],NumPy
-44.32005541739227, JIT-44.32005541740216, all PASS lines; and fordelaunay_nn.pythe reconstruction parity, chunk-invariance 6/6, andcap-headroom diagnostics are unchanged. RC=0 under smoke and under the release
profile.
profile_smoke.yamlis smoke-only, so release is untouched.Rejected, with measurements
The six
SIBSON_*knobsdelaunay_nn.pyreads were all measured and rejected:SIBSON_POINTS/QUERIESbuy only 1.5s and weaken the headroomassert not overflow.any()demonstrates;SIBSON_CAVITY/NEIGHBORSare capsassertions compare against, so lowering them changes what is checked;
SIBSON_REPEATSis already 1;SIBSON_CHUNK1024 is slower.Note for review
The general fix is one line in PyAutoHeart's
smoke-tests.ymlbesideJAX_COMPILATION_CACHE_DIR— every JAX smoke script pays this tax. That is awider trade (it grows the cached artefact by ~500 entries per script), so it is
filed for a human as
draft/refactor/pyautoheart/smoke_jax_cache_threshold.mdrather than taken here. This per-script override does not preclude it.
🤖 Generated with Claude Code
https://claude.ai/code/session_01ARBtVPNAVEZmdG2iDTqfMk
Generated by Claude Code