Add flag-controlled sliced MLA projections - #4630
Open
dandragona wants to merge 4 commits into
Open
Conversation
dandragona
requested review from
RissyRan,
bvandermoon,
gagika,
gobbleturk,
jiangjy1982,
parambole,
shuningjin and
suexu1025
as code owners
July 27, 2026 20:46
|
Caution The consumer version of Gemini Code Assist on GitHub has been sunset. All code review activity has officially ceased. |
dandragona
requested review from
A9isha,
NuojCheng,
SurbhiJainUSC,
abhinavclemson,
aireenmei,
darisoy,
dipannita08,
hengtaoguo,
huytransformer,
igorts-git,
khatwanimohit,
richjames0,
shralex,
vipannalla and
xibinliu
as code owners
July 27, 2026 20:46
Codecov Report✅ All modified and coverable lines are covered by tests. 📢 Thoughts on this report? Let us know! |
Port performance optimization from CL 947805696 into MaxText under a new configuration flag use_sliced_mla_projections (defaulting to False). - Add use_sliced_mla_projections flag to base.yml and types.py. - Support slice_bounds in DenseGeneral.__call__ to slice projection weights/bias prior to contraction for unquantized paths. - Update mla_query_projection and mla_get_key_value in attention_mla.py to use sliced projections when enabled. - Add unit test coverage in linears_test.py. TAG=agy CHANGE_STEWARD=true
Verify correctness of sliced MLA projections by comparing outputs against the default unsliced implementation in train, prefill, and autoregressive modes. CHANGE_STEWARD=true TAG=agy CONV=86839aa9-de96-414b-b896-1ac9aeb38589
Add documentation for the new use_sliced_mla_projections performance optimization flag in the DeepSeek runner guide. TAG=agy CONV=a262e292-a0d4-49f9-ad26-f42e697a5979 CHANGE_STEWARD=true
Remove tpu_only decorator from test_sliced_mla_projections to run it on CPU. Add test_slice_bounds_with_quantization to cover assertion in DenseGeneral. Format with pyink and fix pylint warnings. TAG=agy CONV=e336d40c-d648-45cb-9abd-7b79a924be5e CHANGE_STEWARD=true
dandragona
force-pushed
the
sliced-mla-projections
branch
from
July 27, 2026 22:25
6bd7660 to
169107a
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.
Performance optimizations that avoids an unnecessary split operation.
Tests
Checklist
Before submitting this PR, please make sure (put X in square brackets):
gemini-reviewlabel.