-
Notifications
You must be signed in to change notification settings - Fork 662
[CP] Enable FlexCP for llama3 #2145
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: gh/fegin/54/base
Are you sure you want to change the base?
Changes from 1 commit
4c06750
44a2d8c
4c950e8
3bd90f8
0803909
c4f3886
e18f9ad
21e2a5d
e173410
8521969
8ed8d5a
e29bc56
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
[ghstack-poisoned]
- Loading branch information
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -15,6 +15,7 @@ | |
| from torch.nn.attention import sdpa_kernel, SDPBackend | ||
| from torch.nn.attention.flex_attention import ( | ||
| _mask_mod_signature, | ||
| _score_mod_signature, | ||
| BlockMask, | ||
| create_block_mask, | ||
| flex_attention, | ||
|
|
@@ -113,7 +114,8 @@ def forward( | |
| k: torch.Tensor, | ||
| v: torch.Tensor, | ||
| *, | ||
| block_mask: BlockMask, | ||
| score_mod: _score_mod_signature | None = None, | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. arg not used anywhere
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. We need score_mod to ensure the function signature is the same as flex_attention so that the module hooks know how to allgather K, V. |
||
| block_mask: BlockMask | None = None, | ||
| scale: float | None = None, | ||
| return_lse: bool = False, | ||
| ) -> torch.Tensor | tuple[torch.Tensor, torch.Tensor]: | ||
|
|
||
Uh oh!
There was an error while loading. Please reload this page.