Skip to content

ci(smoke): persist every JAX compile in the smoke leg (threshold 0) - #222

Merged
Jammy2211 merged 1 commit into
mainfrom
claude/jax-cache-threshold-smoke-nfobes
Sep 10, 2026
Merged

Jammy2211 merged 1 commit into
mainfrom
claude/jax-cache-threshold-smoke-nfobes

Conversation

@Jammy2211

Copy link
Copy Markdown
Contributor

Summary

Closes #221 (Mind prompt active/smoke_jax_cache_threshold.md).

smoke-tests.yml restores and saves a JAX compilation cache but set no compile-time threshold, so autonerves/jax_wrapper.py's setdefault of JAX_PERSISTENT_CACHE_MIN_COMPILE_TIME_SECS=1 won and only executables that took over a second were ever persisted. The smoke scripts are hundreds of sub-second compiles each, so a cache_jax: HIT leg held 1–4 entries and every run re-paid the compile. This exports JAX_PERSISTENT_CACHE_MIN_COMPILE_TIME_SECS: "0" in the runner step env, beside JAX_COMPILATION_CACHE_DIR, so every script subprocess inherits it.

API Changes

None — one env key in the reusable workflow's runner step. The runner command is byte-identical (the wiring test pins it). No PYAUTO_CACHE_EPOCH bump: the restore-keys prefix still matches today's entries and the next save is the superset.

Measured (local, smoke profile, from the prompt)

script threshold 1.0 (CI today) threshold 0 cache entries
autolens imaging/jax_likelihood/delaunay.py 23.4–27.1s 10.4–10.5s 2 → 513
autolens misc/jax_assertions/delaunay_nn.py 27.2–27.8s 13.0–13.5s 4 → 299
autogalaxy interferometer/jax_likelihood/delaunay_mge.py 30.5–31.3s 18.1–18.4s 1 → ~490

Printed output diffed byte-identical across both regimes; the threshold governs which executables are persisted, not what is compiled.

The trade this PR asks a human to price (decision flagged)

The saved cache artefact grows by roughly ~500 entries / ~3 MB per JAX script, per workspace, per Python leg. Restore time scales with it. This lands in every workspace's gate the moment it is on main (they call this workflow @main), and it cannot be measured before merge — Heart's own CI here runs only the wiring tests. Watch after merge: the board's per-repo [jax cache hit|miss] lines and cache_state.json's jax_mb / jax_n before/after. Rollback: delete the one line, or bump PYAUTO_CACHE_EPOCH to drop the fat caches.

Follow-ups (not this PR)

  • autolens_workspace_test / autogalaxy_workspace_test profile_smoke.yaml: the three per-script overrides from /ci_speedup (2026-09-10) become redundant once this is on main; harmless while they stay.
  • lib-tests.yml (the libraries' unit gate) restores the same cache with the same missing threshold — a separate pricing.

Tests

python3 -m pytest -q -n auto in PyAutoHeart: 966 passed. New: test_the_runner_persists_every_compile_it_makes.

🤖 Generated with Claude Code

https://claude.ai/code/session_01NWYEAsAsN5cfuqqBoYTHho


Generated by Claude Code

`smoke-tests.yml` restores and saves a JAX compilation cache but set no
compile-time threshold, so autonerves' setdefault of 1s won and only
executables that took over a second were ever written. The smoke scripts
are hundreds of sub-second compiles each, so a "hit" cache held 1-4
entries and every run re-paid the compile.

Export JAX_PERSISTENT_CACHE_MIN_COMPILE_TIME_SECS="0" in the runner step
env, beside JAX_COMPILATION_CACHE_DIR, so every script subprocess inherits
it. Measured locally on the three slowest JAX scripts: 23-31s -> 10-18s,
2->513 / 4->299 / 1->~490 entries, output byte-identical. The price is
cache-artefact size (~3 MB per JAX script per python leg); rollback is
this one line or a PYAUTO_CACHE_EPOCH bump. Wiring test pins the key and
that the runner command is still untouched.

Closes #221

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01NWYEAsAsN5cfuqqBoYTHho
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

ci(smoke): persist every JAX compile in the smoke leg (threshold 0)

2 participants