Fix compile_cache_test to assert single jit_train_step cache file#4210
Open
Liauuu wants to merge 1 commit into
Open
Fix compile_cache_test to assert single jit_train_step cache file#4210Liauuu wants to merge 1 commit into
Liauuu wants to merge 1 commit into
Conversation
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.
Description
Fixes a failure in the nightly
cpu-unitjob (Build Nightly Docker Images, commit85690dab).compile_cache_test.pyassumed the JAX persistent compilation cache directory would contain exactly one file total. In nightly CI, two entries are written:jit_train_step-...jit_initialize_state-...initialize_stateis a separate JIT used during model state initialization and is unrelated to thetrain_stepdouble-compilation regression this test is meant to catch. Requiring a total cache file count of1therefore fails even whentrain_stepcaching behaves correctly.This change updates the test to:
jit_train_stepjit_train_stepOther cache entries (e.g.
jit_initialize_state) are allowed and no longer cause a false failure.Context
Related to #4000 (partial — MoE and GPU integration failures in the same nightly run are separate issues).
Error log (before fix)
FAILED tests/unit/compile_cache_test.py::test_train_step_cache_hit - AssertionError: Expected exactly 1 JAX compilation cache file, but found 2: ['jit_train_step-425341b98f4b4ea0715158828c3b68ee2deab5f2df3c74ad475a08c09652d19f-cache', 'jit_initialize_state-68b1de74b0881dd7ff1205f613bc9988724719034daf764e4c2f6893b61098ca-cache']. This indicates a cache miss where AOT compilation and runtime execution generated different keys, causing train_step to be compiled twice (double-compilation regression). assert 2 == 1