I've added unit tests for critical conversion, layer, and inference c… #1804
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.
…omponents.
This commit introduces unit tests for several key modules that previously lacked them:
Checkpoint Conversion (
MaxText/checkpoint_conversion_utils.py
):convert_gemma_chkpt.py
into the newcheckpoint_conversion_utils.py
to facilitate testing without heavy dependencies.MaxText/tests/convert_gemma_chkpt_test.py
covering parameter name mapping, tensor transformations (scaling, transposition), and model-specific (MQA vs. MHA) logic for Gemma checkpoint conversion.Gemma Layer (
MaxText/layers/gemma.py
):MaxText/tests/layers/gemma_layer_test.py
for theGemmaDecoderLayer
.Config
object for layer tests by using minimalpyconfig.initialize
arguments and manual post-initialization configuration.Paged Attention (
MaxText/inference/paged_attention.py
):MaxText/tests/inference/paged_attention_test.py
for thePagedAttentionOp
.@unittest.expectedFailure
on CPU due to Pallas kernel incompatibility, documenting this current limitation.PagedAttentionOp
also involved carefulConfig
and mockPageState
creation.These tests improve the robustness and maintainability of the MaxText codebase by providing automated verification for these critical components.
Description
Start with a short description of what the PR does and how this is a change from
the past.
The rest of the description includes relevant details and context, examples:
If the change fixes a bug or a Github issue, please include a link, e.g.,:
FIXES: b/123456
FIXES: #123456
Notice 1: Once all tests pass, the "pull ready" label will automatically be assigned.
This label is used for administrative purposes. Please do not add it manually.
Notice 2: For external contributions, our settings currently require an approval from a MaxText maintainer to trigger CI tests.
Tests
Please describe how you tested this change, and include any instructions and/or
commands to reproduce.
Checklist
Before submitting this PR, please make sure (put X in square brackets):