TST: Speed up repeated jax tests #649
Merged
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.
Add pytest option --jax-pcc for the jax persistent compilation cache. This uses a jax config to set cache options.
Total size of cache for all tests (well, really four main ones) is only 2.7M on linux, 416 files.
On subsequent calls, reduces runtime from
4.16s call test_optimizers.py::test_fit[SBR]
2.98s call test_optimizers.py::test_complexity_not_fitted[SBR]
2.89s call test_optimizers.py::test_pickle[SBR-opt_args1]
2.89s call test_optimizers.py::test_sbr_accurate
To:
1.94s call test_optimizers.py::test_fit[SBR]
1.56s call test_optimizers.py::test_sbr_accurate
1.23s call test_optimizers.py::test_pickle[SBR-opt_args1]
1.18s call test_optimizers.py::test_complexity_not_fitted[SBR]