[JAX] [PyT] [Common] Enable D=256 BWD cuDNN fused attn for Blackwell CC 10.x - #3056
[JAX] [PyT] [Common] Enable D=256 BWD cuDNN fused attn for Blackwell CC 10.x #3056KshitijLakhani wants to merge 33 commits into
Conversation
51ad582 to
d177ecf
Compare
Greptile SummaryAdds Blackwell D=256 backward fused-attention support and corresponding framework coverage.
Confidence Score: 5/5The PR appears safe to merge. No blocking failure remains. Important Files Changed
Flowchart%%{init: {'theme': 'neutral'}}%%
flowchart TD
A[D=256 backward request] --> B{SM10x server GPU?}
B -- No --> Z[Use another backend or fallback]
B -- Yes --> C{Layout-specific cuDNN version met?}
C -- No --> Z
C -- Yes --> D{No bias or dropout and vanilla softmax?}
D -- No --> Z
D -- Yes --> E{Window and mask supported?}
E -- No --> Z
E -- Yes --> F[Select cuDNN F16 arbitrary-seqlen backend]
Reviews (22): Last reviewed commit: "[pre-commit.ci] auto fixes from pre-comm..." | Re-trigger Greptile |
e317f99 to
e08e9e8
Compare
5063b39 to
55f3bb4
Compare
|
Latest testing: Pipeline [56553160] |
a678b84 to
ba0cb94
Compare
|
/te-ci L2 |
88217fd to
06eee35
Compare
|
Latest testing: Pipeline [58978691] |
| ), | ||
| ), | ||
| ], | ||
| ) |
There was a problem hiding this comment.
No problem with the "id", but it seems inconsistent with other PyTorch tests. Also, please check the 9.30 vs 9.25 version guard.
There was a problem hiding this comment.
Could you remove the 'id' fields actually - they just look really odd sitting next to other tests with no 'id's. :D
| "cp_hd256_causal": ModelConfig(2, 1024, 16, 256, attn_mask_type="causal"), | ||
| "cp_hd256_causal_swa": ModelConfig( | ||
| 2, 1024, 16, 256, attn_mask_type="causal", window_size=(128, 0) | ||
| ), |
There was a problem hiding this comment.
Should we test no_mask, padding_causal as well, or not really?
There was a problem hiding this comment.
I think it's okay to not test those two, if you are fine with it ?
The non-CP tests cover no_mask and I believe THD CP anyways translates to padding_causal under the hood, so I decided to keep this lightweight.
da25221 to
e3032d3
Compare
078c80f to
9921b99
Compare
|
Latest testing: Pipeline 59713381 |
| ), | ||
| ], | ||
| ) | ||
| def test_dpa_fused_attn_d256(dtype, model_configs, model, qkv_layout): |
There was a problem hiding this comment.
I think we can remove the "fused_xx" keyword from model_configs_fused_d256, fused_d256_no_mask, and test_dpa_fused_attn_d256. Those tests will run both unfused/flash and fused for comparison. Maybe there's no need to restrict it to "fused". Essentially what we want to test here is d256.
Signed-off-by: Kshitij Lakhani <klakhani@nvidia.com>
for more information, see https://pre-commit.ci
…n fused attn Signed-off-by: Kshitij Lakhani <klakhani@nvidia.com>
Signed-off-by: Kshitij Lakhani <klakhani@nvidia.com>
for more information, see https://pre-commit.ci
Signed-off-by: Kshitij Lakhani <klakhani@nvidia.com>
Signed-off-by: Kshitij Lakhani <klakhani@nvidia.com>
Signed-off-by: Kshitij Lakhani <klakhani@nvidia.com>
Signed-off-by: Kshitij Lakhani <klakhani@nvidia.com>
…ersions Signed-off-by: Kshitij Lakhani <klakhani@nvidia.com>
for more information, see https://pre-commit.ci
Signed-off-by: Kshitij Lakhani <klakhani@nvidia.com>
Signed-off-by: Kshitij Lakhani <klakhani@nvidia.com>
Signed-off-by: Kshitij Lakhani <klakhani@nvidia.com>
for more information, see https://pre-commit.ci
Signed-off-by: Kshitij Lakhani <klakhani@nvidia.com>
Signed-off-by: Kshitij Lakhani <klakhani@nvidia.com>
Signed-off-by: Kshitij Lakhani <klakhani@nvidia.com>
Signed-off-by: Kshitij Lakhani <klakhani@nvidia.com>
Signed-off-by: Kshitij Lakhani <klakhani@nvidia.com>
Signed-off-by: Kshitij Lakhani <klakhani@nvidia.com>
for more information, see https://pre-commit.ci
Signed-off-by: Kshitij Lakhani <klakhani@nvidia.com>
for more information, see https://pre-commit.ci
Signed-off-by: Kshitij Lakhani <klakhani@nvidia.com>
Signed-off-by: Kshitij Lakhani <klakhani@nvidia.com>
Signed-off-by: Kshitij Lakhani <klakhani@nvidia.com>
Signed-off-by: Kshitij Lakhani <klakhani@nvidia.com>
51bd332 to
72958ee
Compare
for more information, see https://pre-commit.ci
Description
Support for D=256 BWD for Blackwell CC 10x via the C++ API (which TE uses) was added in cuDNN 9.23 + cuDNN FE 1.24 (BSHD) and cuDNN 9.30 + cuDNN FE 1.26 (THD)
Enabling this support in TE attention and adding conditional tests for the same
Type of change
Changes
Add guard when picking the backend (sub backend) in TE common.
Add tests for D=256 case in TE PyT and TE JAX
Checklist: