-
Notifications
You must be signed in to change notification settings - Fork 542
gpt-oss model enablement #1754
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
gpt-oss model enablement #1754
Conversation
…ks but reduces mfu for 20b
torchtitan/models/attention.py
Outdated
block_mask = FlexAttention.block_masks[self.mask_key] | ||
return FlexAttention.flex_attn(q, k, v, block_mask=block_mask, scale=scale) | ||
|
||
def _forward_with_sink( |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM.
I'm curious how expensive it is to always return lse. If it is actually no cost, we can merge the FlexAttention call to the original forward.
cc., @drisspg
Need to rebase onto #1776 |
] # (mask_type, fixed_block_size, sliding_window) | ||
|
||
|
||
class FlexAttention(torch.nn.Module): |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sorry for the disruption. I should have done this earlier.
As for the FlexAttention, @drisspg confirmed that, while it is probably just a minor overhead, the AuxOutput does incur some extra memory and memory write. So let's keep it optional.
Keep developing on top of #1559. Thanks @KhoomeiK for initial contribution!
Initialized by the same seed checkpoint, set seed=0 and deterministic = True.

Run 1: dp_shard = 2

Run 2: dp_shard = 2, TP degree = 2 (NGPU=4)

Run 3: dp_shard = 2, TP degree =2, EP degree = 2 (NGPU=4)

Run 4: dp_shard = 2, TP degree = 2, EP degree = 2, ETP degree = 2 (NGPU=4)

Run 5: dp_shard=2, EP degree = 2 (NGPU=2)
