Skip to content

Commit 219ef36

Browse files
mariusdkmThe tunix Authors
authored andcommitted
Modernize Pallas Splash attention kernel and define eager fallback routing in Tunix Gemma 4.
- Refactor Attention.block() into modular helper methods. - Broaden Pallas Splash attention execution across rectangular sequences (kv_len > q_len) using memoized in-kernel computable masks (LocalMask / CausalMask). - Define eager attention fallback routing (_eager_attention) with exact offset alignment for rectangular sequences. - Modernize use_gqa property to properly support MQA (num_kv_heads=1). - Add unit tests for mask predicate equivalence, block-size divisibility, and attention routing. PiperOrigin-RevId: 963446160
1 parent 48e1f0a commit 219ef36

2 files changed

Lines changed: 1237 additions & 233 deletions

File tree

0 commit comments

Comments
 (0)