[gpt-oss] attention decode optimizations#37190
Merged
sraizada-tt merged 3 commits intomainfrom Feb 6, 2026
Merged
Conversation
Contributor
There was a problem hiding this comment.
Pull request overview
This PR introduces optimizations for GPT attention operations, focusing on reducing overhead in tensor parallelism (TP) scenarios through padding for tile alignment and a fused QK RoPE kernel for decode mode.
Changes:
- Added padding to o_proj weights and bias to ensure tile-aligned dimensions in CCL operations, avoiding expensive untilize-pad-tilize cycles
- Implemented fused QK RoPE operation and fused KV cache update for decode mode when batch size ≤ 32
- Added slice operation after allreduce to remove padding and restore original hidden dimensions
Reviewed changes
Copilot reviewed 4 out of 4 changed files in this pull request and generated 3 comments.
| File | Description |
|---|---|
| models/demos/gpt_oss/tt/attention/weights.py | Adds padding logic to o_proj weight and bias for tile alignment in TP operations; updates cache keys to reflect padding |
| models/demos/gpt_oss/tt/attention/operations.py | Adds slice operation after allreduce to remove padding added to support tile-aligned CCL |
| models/demos/gpt_oss/tt/attention/decode.py | Implements fused QK RoPE optimization for batch_size ≤ 32; adds reshape logic for padded dimensions before allreduce |
| models/demos/gpt_oss/tt/attention/init.py | Pre-creates fused transformation matrix for fused QK RoPE to avoid host writes during trace |
This reverts commit d89d34f.
handrewsTT
approved these changes
Feb 6, 2026
handrewsTT
added a commit
that referenced
this pull request
Feb 7, 2026
This reverts commit e1c0a22.
handrewsTT
added a commit
that referenced
this pull request
Feb 9, 2026
This reverts commit 0773d2b.
adrian-pascual-bernal
pushed a commit
that referenced
this pull request
Feb 10, 2026
Added padding to o_proj weights and bias to ensure tile-aligned dimensions in CCL operations, avoiding expensive untilize-pad-tilize cycles https://github.com/tenstorrent/tt-metal/actions/runs/21719380426
ssundaramTT
pushed a commit
that referenced
this pull request
Feb 10, 2026
Added padding to o_proj weights and bias to ensure tile-aligned dimensions in CCL operations, avoiding expensive untilize-pad-tilize cycles https://github.com/tenstorrent/tt-metal/actions/runs/21719380426
handrewsTT
added a commit
that referenced
this pull request
Feb 16, 2026
This reverts commit e1c0a22.
handrewsTT
added a commit
that referenced
this pull request
Feb 16, 2026
This reverts commit 0773d2b.
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.
Added padding to o_proj weights and bias to ensure tile-aligned dimensions in CCL operations, avoiding expensive untilize-pad-tilize cycles
https://github.com/tenstorrent/tt-metal/actions/runs/21719380426