Repository navigation
Add modules.TimmAttention; EEGPT and EEGDINO use it (same keys, same outputs) - #1460
Merged
bruAristimunha merged 7 commits intoOct 18, 2026
Merged
bruAristimunha merged 7 commits into
bruAristimunha merged 7 commits into
Conversation
…blocks); nine models and PatchTokenizer import them
…aled_dot_product_attention; private re-exports in modules.attention removed
bruAristimunha
force-pushed
the
cleanup/t24-timm-attention
branch
from
October 18, 2026 11:16
5021b30 to
37ca8d8
Compare
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## master #1460 +/- ##
==========================================
+ Coverage 91.01% 91.03% +0.01%
==========================================
Files 167 167
Lines 21621 21601 -20
==========================================
- Hits 19679 19665 -14
+ Misses 1942 1936 -6 🚀 New features to boost your workflow:
|
bruAristimunha
force-pushed
the
cleanup/t24-timm-attention
branch
from
October 18, 2026 12:02
0a54dc2 to
a0bc30f
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.
Part of #1442, Tier 2 (shared modules where the parameter layout already matches). Stacked on #1455, #1456 and #1457: the diff includes them until they merge; the commits of this PR are the last three (TimmAttention, and the growth-stop list losing the two removed classes).
eegpt._Attention(130 lines) andeegdino._Attention(42 lines) both implement timm's attention: fusedqkv, heads split, attention,proj. They are nowbraindecode.modules.TimmAttention(dim, num_heads, qkv_bias, qv_bias, attn_drop, proj_drop, exact):qv_bias=Trueadds BEiT's separateq_bias/v_biasparameters (EEGDINO);exact=Trueruns timm's op ordersoftmax((q * scale) @ k^T) @ vthrough the shared helper's exact path (EEGDINO, bit-identical to the reference); otherwise torch's kernels and Gaudi's fused kernel as before (EEGPT,fused_in_lazy=True);forward(x, need_weights=True)returns the attention weights (EEGPT'sreturn_attention_layer).EEGPT's
is_causalwas never set to True anywhere; removed with its branch.Characterization vs master: EEGPT and EEGDINO have identical
state_dictkeys and weights and bit-identical outputs;test_attention_exactkeeps asserting EEGDINO's forward, loss and gradients equal to its previous hand-written op order. 145 related tests pass.Not moved onto it: LaBraM/NeuroRVQ (
_Attentionwith relative-position bias, qk-norm and windows) and BrainOmni (rotary on a(batch, seq, heads, dim)layout): different modules, not copies.