Skip to content

add splitk as a post op #375

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

Open
wants to merge 8 commits into
base: sycl-develop
Choose a base branch
from

Conversation

yuankuns
Copy link

@yuankuns yuankuns commented May 14, 2025

Add splitk as a post op for gemm

q=self.q_proj(hidden_states).view(-1,self.num_local_heads,self.qk_head_dim)
q.split([self.qk_nope_head_dim,·self.qk_rope_head_dim],dim=-1)

In the case of MLA shape, the splitk dimension is M=512, N=24576, K=1536, NUM_HEAD=128, NOPE_DIM=128, ROPE_DIM=64

y=xwT (512x1536 24576x1536)
y=y.reshape(512, 128, 192)
y_nope, y_rope=y.splitk(128,64)
y_nope (512x128x128)
y_rope (512x128x64)

@yuankuns
Copy link
Author

<style> </style>
  BW (GB/s)  
Shape Before After
512x24576x1536x1 117.305 124.388
1024x24576x1536x1 96.363 119.975
512x24576x2048x1 91.365 100.785
256x24576x1536x1 182.11 182.366

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.

1 participant