Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 8 additions & 0 deletions .github/workflows/lib-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -326,6 +326,14 @@ jobs:
# function cache out of the source trees (where it would be neither
# restorable nor saveable) into the one directory those steps cache.
JAX_COMPILATION_CACHE_DIR: ${{ github.workspace }}/.pyauto_jax_cache
# Persist EVERY compile, not only those over JAX's 1.0s default
# (autonerves setdefaults the same 1s whenever the cache dir is set;
# a preset value wins). Same reasoning and same knob as the smoke
# leg (PyAutoHeart#221): a unit suite is many small compiles, so
# under the 1s regime the restored cache holds almost nothing and
# every run re-pays them. The price is cache-artefact size; the way
# out is this one line, or an epoch bump to drop the fat caches.
JAX_PERSISTENT_CACHE_MIN_COMPILE_TIME_SECS: "0"
NUMBA_CACHE_DIR: ${{ github.workspace }}/.numba_cache
run: |
export JAX_ENABLE_X64=True
Expand Down
11 changes: 11 additions & 0 deletions tests/test_lib_tests_wiring.py
Original file line number Diff line number Diff line change
Expand Up @@ -253,6 +253,17 @@ def test_the_suite_runs_under_both_cache_dirs_and_is_otherwise_untouched():
assert "--junitxml=test-results/junit.xml" in step["run"]


def test_the_suite_persists_every_compile_it_makes():
"""Same knob as the smoke leg (PyAutoHeart#221): JAX and autonerves only
persist an executable that took over a second to compile, and a unit suite
is many small compiles, so under that default the restored cache held
almost nothing. Exactly "0", not a smaller-but-nonzero value a faster
runner could silently drop a compile under."""
step = _step(_steps("unittest"), "Run tests")
assert step["env"]["JAX_PERSISTENT_CACHE_MIN_COMPILE_TIME_SECS"] == "0"
assert "JAX_COMPILATION_CACHE_DIR" in step["env"]


def test_the_record_step_runs_on_a_red_run_too_and_writes_the_sidecar():
"""A red run's cache state is exactly as interesting as a green one's — and
the artifact it rides in is uploaded either way."""
Expand Down
Loading