Skip to content

Fix load-balanced TPU Splash masks#4298

Merged
copybara-service[bot] merged 1 commit into
AI-Hypercomputer:mainfrom
huytransformer:htn/tpu-splash-load-balanced-masks
Jul 2, 2026
Merged

Fix load-balanced TPU Splash masks#4298
copybara-service[bot] merged 1 commit into
AI-Hypercomputer:mainfrom
huytransformer:htn/tpu-splash-load-balanced-masks

Conversation

@huytransformer

@huytransformer huytransformer commented Jun 29, 2026

Copy link
Copy Markdown
Collaborator

Description

Fixes TPU Splash local sliding masks when CP load balancing is enabled. The causal mask already uses the load-balanced query order, but the local sliding mask used the default query order. This PR adds a load-balanced local mask so both masks use the same query positions.

BUGS: b/416110599

Tests

Ran:

python3 -m pytest tests/unit/attention_test.py -k LoadBalancedMaskTest

Checklist

Before submitting this PR, please make sure (put X in square brackets):

  • I have performed a self-review of my code. For an optional AI review, add the gemini-review label.
  • I have necessary comments in my code, particularly in hard-to-understand areas.
  • I have run end-to-end tests tests and provided workload links above if applicable.
  • I have made or will make corresponding changes to the doc if needed, including adding new documentation pages to the relevant Table of Contents (toctree directive) as explained in our documentation.

@codecov

codecov Bot commented Jun 29, 2026

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 83.33333% with 2 lines in your changes missing coverage. Please review.

Files with missing lines Patch % Lines
src/maxtext/layers/attention_op.py 83.33% 1 Missing and 1 partial ⚠️

📢 Thoughts on this report? Let us know!

Comment thread src/maxtext/layers/attention_op.py Outdated
Comment thread src/maxtext/layers/attention_op.py
Comment thread src/maxtext/layers/attention_op.py Outdated
@huytransformer
huytransformer force-pushed the htn/tpu-splash-load-balanced-masks branch from f561fc3 to b4e0472 Compare July 2, 2026 01:10
@huytransformer
huytransformer requested a review from xibinliu as a code owner July 2, 2026 01:10
@copybara-service
copybara-service Bot merged commit 7014e2b into AI-Hypercomputer:main Jul 2, 2026
78 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants