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 microbenchmark for A@B^t #2408

Merged
merged 16 commits into from
Oct 4, 2024
Merged

Add microbenchmark for A@B^t #2408

merged 16 commits into from
Oct 4, 2024

Conversation

Egor-Krivov
Copy link
Contributor

@Egor-Krivov Egor-Krivov commented Oct 2, 2024

PR adds microbenchmark for gemm with A@B^t, which closes #2414

@vlad-penkin vlad-penkin linked an issue Oct 2, 2024 that may be closed by this pull request
@Egor-Krivov Egor-Krivov marked this pull request as ready for review October 4, 2024 14:20
@Egor-Krivov Egor-Krivov changed the title Add microbenchmark with A@B^t Add microbenchmark for A@B^t Oct 4, 2024
@Egor-Krivov
Copy link
Contributor Author

@Egor-Krivov Egor-Krivov enabled auto-merge (squash) October 4, 2024 15:48
Copy link
Contributor

@alexbaden alexbaden left a comment

Choose a reason for hiding this comment

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

The benchmark implementation looks fine. One note - this example is almost identical to our tutorial 10 experimental block pointer code, with some small changes to handle the transpose case and a user provided bias vector. We might be able to unify this microbenchmark with tutorial 10 in the future.

@Egor-Krivov Egor-Krivov merged commit cac829d into main Oct 4, 2024
5 checks passed
@Egor-Krivov Egor-Krivov deleted the egor/gemm_b branch October 4, 2024 15:48
@Egor-Krivov Egor-Krivov mentioned this pull request Oct 7, 2024
Egor-Krivov added a commit that referenced this pull request Oct 8, 2024
Based on this feedback
#2408 (review)

Changed GEMM benchmark to include transposed matrices case.

Closes #2424
Relates to
#1795

A@B^t case is important because weight matrix is often stored in [M, K]
format. For example, in
https://pytorch.org/docs/stable/generated/torch.nn.Linear.html
Right now we are about 1.5 times slower on XPU against raw torch for
that case.


A^t@B case is important because it's part of matmul backprop. Right now
we are about 4 times slower on XPU against raw torch for that case.
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.

[Benchmarks] Add microbenchmark with A@B^t
2 participants