Enable 2CTA for SM100 block-sparse backward - #2661
Conversation
stack-info: PR: #2661, branch: drisspg/stack/45
72ee600 to
5b5c03e
Compare
stack-info: PR: #2661, branch: drisspg/stack/45
5b5c03e to
7d9b4c5
Compare
stack-info: PR: #2661, branch: drisspg/stack/45
7d9b4c5 to
124f501
Compare
stack-info: PR: #2661, branch: drisspg/stack/45
124f501 to
3fea3c1
Compare
stack-info: PR: #2661, branch: drisspg/stack/45
3fea3c1 to
aebf6c0
Compare
stack-info: PR: #2661, branch: drisspg/stack/45
aebf6c0 to
b89e53d
Compare
stack-info: PR: #2661, branch: drisspg/stack/45
b89e53d to
c589194
Compare
stack-info: PR: #2661, branch: drisspg/stack/45
c589194 to
a356b2a
Compare
9d33fa6 to
cb8f308
Compare
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: cb8f3089f9
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
stack-info: PR: #2661, branch: drisspg/stack/45
cb8f308 to
c5e6ae0
Compare
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: c5e6ae04cf
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
c5e6ae0 to
41a3d67
Compare
41a3d67 to
580cb53
Compare
|
Just rebased -> still figure out my env to got an ima but I think it might just be 4.6 churn |
|
We good -> found a latent bug in some mask defs with OOB indexings so also fixed here |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: db98127eaf
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
stack-info: PR: #2661, branch: drisspg/stack/45
Enable 2CTA for SM100 block-sparse backward
Summary
Okay lots of lines of code but a decent amoutn of plumbing work for kv_subtile factor and some refactors around load utilities in blocksparese and the load loop.
The main chunk of new code is allowing for subtitling, this is basically a mirror of what we do in the fwd for q_subtile_factor where if q_block_size is a multiple of tile_m we subtile with tile_m. We now allow for the same along the k_seqlen dim with tile_n. This applies to both the fwd and the backward. This now lets us use 2cta which requires at least 2 tile_m chunks. And critical (the genesis of this PR) we can we support the DSV3 mla shapes.
Testing Testing Testing
You can see I added tests to the PR but besides that I(codex) wrote up a fuzztester;
Results in;

Full Test suite
I used 32 threads and one of em got a lil too big for their britches and oomed but reran in isolation and we good;

Also test various 1 offs
Performance
Here is the chart comparing the new blocksizes with 2cta vs 1 cta:

At first I was like damnnn that sucks. But if you look at random, this make more sense. We have went from 256,128 -> 256, 256 so end up needing to visit way more tiles in the random case.
Below is a more fair comparison with Same blocksizes (256, 256) with 2cta vs 1cta.

And now we can run deepseekshapes