perf: Skip VRAM, I/O, model.info in test mode 2+ and add PYAUTO_DISABLE_JAX#1184
Merged
Jammy2211 merged 1 commit intomain_buildfrom Apr 7, 2026
Merged
Conversation
…mode 2+ When PYAUTOFIT_TEST_MODE >= 2: - print_vram_use() returns immediately (saves ~16s) - pre_fit_output() and post_fit_output() are skipped (saves ~4s) - _fit_bypass_test_mode() skips all file I/O (saves ~6s) - model.info returns a stub (saves ~7s for MGE models) - result_info_from() returns a stub (saves ~5s) Also adds PYAUTO_DISABLE_JAX=1 env var to force use_jax=False in Analysis base class, avoiding JAX JIT overhead in smoke tests. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
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.
Summary
When
PYAUTOFIT_TEST_MODE >= 2, skip expensive operations that aren't needed for smoke testing: VRAM estimation (16s), pre/post-fit file I/O (10s), model.info formatting (7s), and result.info formatting (5s). Also addsPYAUTO_DISABLE_JAX=1env var to forceuse_jax=Falsein the Analysis base class.Combined with the earlier
PYAUTO_WORKSPACE_SMALL_DATASETSandPYAUTO_DISABLE_CRITICAL_CAUSTICSenv vars, this reduces smoke test runtime from ~100s to ~22s per modeling script.API Changes
Added one environment variable:
PYAUTO_DISABLE_JAX=1. When set,Analysis.__init__forcesuse_jax=Falseregardless of what the caller passes.In test mode 2+,
model.inforeturns a stub string andresult.inforeturns a stub string.print_vram_use()is a no-op.search.fit()skips pre-fit output, post-fit output, and all file I/O in the bypass path. These are internal behavioural changes that only apply when the test mode env var is explicitly set.See full details below.
Test Plan
Full API Changes (for automation & release notes)
Added
PYAUTO_DISABLE_JAX=1— forcesuse_jax=FalseinAnalysis.__init__Changed Behaviour (test mode 2+ only)
Analysis.print_vram_use()— returns immediately (no-op)AbstractSearch.fit()— skipspre_fit_output(),post_fit_output(),modify_after_fit()AbstractSearch._fit_bypass_test_mode()— skipssave_samples(),save_results(),save_results_combined(),paths.completed()AbstractPriorModel.info— returns stub stringtext_util.result_info_from()— returns stub stringMigration
None — all changes are gated behind
PYAUTOFIT_TEST_MODE >= 2orPYAUTO_DISABLE_JAX=1.🤖 Generated with Claude Code