Repository navigation
Conversation
jiapingW
requested review from
FlamingoPg,
FrankLeeeee,
shuaills and
sleepcoo
as code owners
November 8, 2026 08:28
jiapingW
force-pushed
the
design/40-dynamic-rotary
branch
from
November 8, 2026 16:21
226e9e6 to
bbb4c57
Compare
jiapingW
force-pushed
the
design/41-eager-attention-backend
branch
3 times, most recently
from
November 8, 2026 17:45
dd00e14 to
c8f1731
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.
Adds an independent eager softmax-attention backend under
layers/attention/backends/. It consumes prepared Q/K/V tensors and an explicit mask, scale, dropout probability, and training flag. It owns no projections, architecture settings, learned parameters, or causal/window policy.The backend supports MHA/grouped KV heads, unequal query/key lengths, and distinct query/value widths. Boolean masks use True for visibility; floating masks are additive, with negative infinity blocking a key. Fully blocked rows return zero with zero gradients instead of NaNs. Finite negative biases retain their additive meaning. Invalid tensor/mask layouts fail before attention computation.
Validation on H20-wjp:
Uses the existing Transformers 5.12.1 environment; the project's pinned 5.19.0 environment was not exercised. This supplies the numerical backend for subsequent attention components; it does not yet implement/register GQA projections, build algorithm masks, or migrate model entry points. No serving/performance claim is made. Stacked on #1121; one commit.
Historical PR for original Draft design 41. Superseded by current Draft design 06/21, #1124. Its code is included in that PR; this historical PR remains closed.