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

Add support for layouts #587

Merged
merged 10 commits into from
May 20, 2024
Merged

Add support for layouts #587

merged 10 commits into from
May 20, 2024

Conversation

vgokhale
Copy link
Collaborator

@vgokhale vgokhale commented May 14, 2024

Add support for layouts commonly used by users.

Add option for varlen / thd layout to specify equal context lengths for all batches. Also often used by users.

@vgokhale vgokhale self-assigned this May 14, 2024
@vgokhale vgokhale marked this pull request as ready for review May 14, 2024 20:27
@vgokhale vgokhale requested a review from micmelesse May 14, 2024 20:28
@@ -1102,7 +1082,9 @@ def varlen_input_helper(Z, HQ, HK, N_CTX_Q, N_CTX_K, D_HEAD, dtype):
@pytest.mark.parametrize('use_alibi', [True, False])
def test_op_fwd(Z, HQ, HK, N_CTX_Q, N_CTX_K, D_HEAD, causal, use_alibi, dtype=torch.float16):
torch.manual_seed(20)
q, k, v, input_metadata = input_helper(Z, HQ, HK, N_CTX_Q, N_CTX_K, D_HEAD, dtype)
# TODO: Adapt test for bshd
layout = 'bhsd'
Copy link
Collaborator

Choose a reason for hiding this comment

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

Do we need to add the layouts quickly for some reason? It would be nice if we could test at least one other layout. If we need to move quick, I am fine adding the tests later.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

No, not necessary to get it in quickly. I guess I was just being lazy. Good to have tests - Done.

@vgokhale vgokhale requested a review from micmelesse May 20, 2024 15:53
Copy link
Collaborator

@micmelesse micmelesse left a comment

Choose a reason for hiding this comment

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

LGTM

@vgokhale vgokhale merged commit 2f2a655 into main_perf May 20, 2024
4 checks passed
@vgokhale vgokhale deleted the tensor_layouts branch May 20, 2024 19:57
micmelesse pushed a commit that referenced this pull request Jun 14, 2024
Add support for layouts commonly used by users.

Add option for varlen / thd layout to specify equal context lengths for all batches. Also often used by users.
micmelesse pushed a commit that referenced this pull request Jun 19, 2024
Add support for layouts commonly used by users.

Add option for varlen / thd layout to specify equal context lengths for all batches. Also often used by users.
micmelesse pushed a commit that referenced this pull request Jul 16, 2024
Add support for layouts commonly used by users.

Add option for varlen / thd layout to specify equal context lengths for all batches. Also often used by users.
micmelesse pushed a commit that referenced this pull request Jul 16, 2024
Add support for layouts commonly used by users.

Add option for varlen / thd layout to specify equal context lengths for all batches. Also often used by users.
micmelesse pushed a commit that referenced this pull request Oct 28, 2024
Add support for layouts commonly used by users.

Add option for varlen / thd layout to specify equal context lengths for all batches. Also often used by users.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants