Skip to content
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

update frontend and mk_ck_lib #777

Closed
wants to merge 4 commits into from

Conversation

fsx950223
Copy link
Contributor

No description provided.

@facebook-github-bot facebook-github-bot added the CLA Signed This label is managed by the Facebook bot. Authors need to sign the CLA before a PR can be reviewed. label Jun 16, 2023
@fsx950223
Copy link
Contributor Author

@chenyang78 @ipiszy review this one too.


def forward(self, *args):
def forward(self, *args, seqlens=None):
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What does seqlen represent? Where is seqlens used?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It's used in rocm attention.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I feel the API after this change is not very readable. This API is supposed to be backend-agnostic, and is shared between CUDA and ROCM. Can we avoid this change?

Copy link
Contributor Author

@fsx950223 fsx950223 Jun 25, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

rocm attention backend requires seqlen. Do you have any plan to add an API supports attention mask?

@@ -395,7 +419,8 @@ def forward(self, *args):
else:
x = self.proj(attn_output)
x = self.proj_drop(x)
x = ops.reshape()(x, [batch, -1, self.dim])
if not isinstance(batch, IntVar):
x = ops.reshape()(x, [batch, -1, self.dim])
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This looks weird. Why this change?

Copy link
Contributor Author

@fsx950223 fsx950223 Jun 21, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ROCM attention support [batch * seqlen, nheads] tensor as inputs and output [batch * seqlen, nheads] tensor. The branch keeps original behavior.

@fsx950223
Copy link
Contributor Author

I have reverted the attention

@facebook-github-bot
Copy link
Contributor

@ipiszy has imported this pull request. If you are a Meta employee, you can view this diff on Phabricator.

1 similar comment
@facebook-github-bot
Copy link
Contributor

@ipiszy has imported this pull request. If you are a Meta employee, you can view this diff on Phabricator.

@facebook-github-bot
Copy link
Contributor

@ipiszy merged this pull request in 039bb9f.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
CLA Signed This label is managed by the Facebook bot. Authors need to sign the CLA before a PR can be reviewed. Merged
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants