Repository navigation
[varlen_attn] change is_causal to window_size - #2267
Merged
Merged
Conversation
liangel-02
requested review from
fegin,
tianyu-l,
wconstab and
wwwjn
as code owners
January 21, 2026 16:58
fegin
reviewed
Jan 21, 2026
fegin
left a comment
Contributor
There was a problem hiding this comment.
We will need to wait for nightly pytorch has window_size.
| max_k, | ||
| is_causal=True, | ||
| scale=scale, | ||
| window_size=[-1, 0], |
Contributor
There was a problem hiding this comment.
Can we add descriptions to describe what -1 means and what 0 means? I checked the API's docstring, but it is still not very clear to me.
liangel-02
force-pushed
the
varlen_is_causal
branch
2 times, most recently
from
January 22, 2026 17:36
621b609 to
5709bba
Compare
tianyu-l
reviewed
Jan 23, 2026
tianyu-l
left a comment
Contributor
There was a problem hiding this comment.
CI fails because of is_causal is already deprecated. Let's test again and see if this PR is ready.
| scale=scale, | ||
| # causal attention, token looks at all tokens before it | ||
| # and itself but no tokens after it | ||
| window_size=(-1, 0), |
Contributor
There was a problem hiding this comment.
It's still not clear what -1 and 0 means. Maybe explain it here or at least add a link to documents.
liangel-02
force-pushed
the
varlen_is_causal
branch
from
January 23, 2026 21:12
5709bba to
795dc5f
Compare
xrsrke
pushed a commit
to NousResearch/torchtitan
that referenced
this pull request
Feb 13, 2026
`is_causal` flag has been deprecated in `varlen_attn`, use `window_size = [-1, 0]` instead, see [this PR](pytorch/pytorch#172245) *Test* <img width="1225" height="496" alt="Screenshot 2026-01-21 at 11 55 59 AM" src="https://github.com/user-attachments/assets/125c56af-76ed-4f6f-a433-da4d9a631dab" />
TXacs
pushed a commit
to McmillanTAC/torchtitan
that referenced
this pull request
Apr 13, 2026
`is_causal` flag has been deprecated in `varlen_attn`, use `window_size = [-1, 0]` instead, see [this PR](pytorch/pytorch#172245) *Test* <img width="1225" height="496" alt="Screenshot 2026-01-21 at 11 55 59 AM" src="https://github.com/user-attachments/assets/125c56af-76ed-4f6f-a433-da4d9a631dab" />
ACharacterInASimulation
pushed a commit
to ACharacterInASimulation/torchtitan
that referenced
this pull request
Apr 21, 2026
`is_causal` flag has been deprecated in `varlen_attn`, use `window_size = [-1, 0]` instead, see [this PR](pytorch/pytorch#172245) *Test* <img width="1225" height="496" alt="Screenshot 2026-01-21 at 11 55 59 AM" src="https://github.com/user-attachments/assets/125c56af-76ed-4f6f-a433-da4d9a631dab" />
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.
is_causalflag has been deprecated invarlen_attn, usewindow_size = [-1, 0]instead, see this PRTest
