fix(test): ignore the serialized Mosaic kernel when diffing HLO#4445
Draft
ecnal-cienet wants to merge 1 commit into
Draft
fix(test): ignore the serialized Mosaic kernel when diffing HLO#4445ecnal-cienet wants to merge 1 commit into
ecnal-cienet wants to merge 1 commit into
Conversation
Codecov Report✅ All modified and coverable lines are covered by tests. 📢 Thoughts on this report? Let us know! |
eef21df to
0ac0589
Compare
The Mosaic module of a Pallas custom call is serialized into the HLO and carries the absolute path of the installed jax package, so the dump differs between a venv install and a Docker image install even though the compiled graph is identical. That made hlo_diff_test fail on the Docker image CI jobs. Normalize the payload away in filter_line, like stack_frame_id already is.
0ac0589 to
0b3ae4d
Compare
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
The three
tests/integration/hlo_diff_test.pycases fail on every scheduled image build (run 29261172318), and have since the stable-image test job was added in #4401 (052fda676). The compiled graph is not deviating — the test is comparing the install path of jax.Splash attention is a Pallas kernel, so XLA serializes its Mosaic module into the custom call and dumps it as base64 under
backend_config.custom_call_config.body. That payload carries the kernel's MLIR location info, which holds the absolute path ofsplash_attention_kernel.py— and that path depends on where jax was installed:/__w/maxtext/maxtext/.venv/lib/python3.12/site-packages/jax/.../deps)/usr/local/lib/python3.12/site-packages/jax/...Decoding the payload out of the failing job's log shows that single string is the entire deviation. Each of the three references differs from its dump by exactly one line, and mask the base64 body and all three are byte-identical. Same jax, same libtpu, same graph — different directory.
filter_linealready exists to normalize this class of environment noise (it zeroesstack_frame_idand drops the sharding/metadata section lines), so the Mosaic payload is normalized there too. The kernel is still covered by the rest of the dump: its operand shapes and layouts are plain text, and its block sizes are in the plain-textxprof_metadataon the neighboring line.The reference files do not need regenerating.
filter_lineruns over the fresh dump and the stored reference alike at compare time, so the committed references — runner path and all — normalize to the same masked form. This is also why running the Update HLO References workflow does nothing: it regenerates in the venv environment, which already matches, and the commit step then fails with "nothing to commit".The
--ignore=tests/integration/hlo_diff_test.pycarried for the jax-nightly image is left alone. That image runs a different jax and XLA, so it may deviate for reasons that are real; worth revisiting separately once the stable image is green.Checklist
Before submitting this PR, please make sure (put X in square brackets):
gemini-reviewlabel.