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

gemm split-k implementation #696

Draft
wants to merge 4 commits into
base: main_perf
Choose a base branch
from
Draft

gemm split-k implementation #696

wants to merge 4 commits into from

Conversation

xiaohuguo2023
Copy link
Member

  • add autotuning for split-k
  • add reduction kernel for split-k
  • use torch.sum to replace split-k reduction kernel

@xiaohuguo2023 xiaohuguo2023 requested a review from vgokhale January 7, 2025 22:40
@@ -145,11 +194,17 @@ def matmul(a, b, c, a_scale, b_scale, scale_a8_b8=False, activation=""):
assert a.dtype == b.dtype, "Mixed dtype GEMMs are not supported!!!"
M, K = a.shape
K, N = b.shape
grid = lambda META: (triton.cdiv(M, META['BLOCK_SIZE_M']) * triton.cdiv(N, META['BLOCK_SIZE_N']), )
splitk = 1
c_buf = torch.zeros((M, N, splitk), device=a.device, dtype=torch.float32)
Copy link
Collaborator

Choose a reason for hiding this comment

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

torch.empty

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