Repository navigation
[NVIDIA] Enable CuTe DSL BF16 GEMM on SM107 - #33617
Conversation
Co-authored-by: Lee Nau <lnau@nvidia.com>
6e431c6 to
6aa5e76
Compare
| weight: torch.Tensor, | ||
| bias: Optional[torch.Tensor], | ||
| ) -> torch.Tensor: | ||
| if get_device_sm() not in (100, 103): |
There was a problem hiding this comment.
Can we just change is to is_sm100_supported?
There was a problem hiding this comment.
maybe is_sm10x_supported ? what is Supports 110 exactly?
There was a problem hiding this comment.
is_sm10x_supported would’ve been nice if there were no need to check different cuda versions, but since sm107 needs >= 13.4 while is_sm100_supported currently checks >= 12.8 (actually, sm103 needs >= 12.9), maybe for clarity rename it to is_sm100_or_sm103_supported and add is_sm107_supported
There was a problem hiding this comment.
@leejnau You can ignore the other part of my comment. Was typing something else on another tab or something..
There was a problem hiding this comment.
Thanks! I updated the PR to use is_sm100_supported() instead of explicitly checking for SM100/103/107.
BTW, Lee and I talked about it, and we don’t think we need a separate is_sm107_supported() for now. If we add features that are only SM107-specific later, we can add it then as a follow up
There was a problem hiding this comment.
Yeah maybe not for now, but at some point we'll probably have to distinguish them
|
I tested Kimi K3 on sm107 and the cutedsl bf16 gemm works ✅ |
|
/tag-and-rerun-ci |
Co-authored-by: Lee Nau <lnau@nvidia.com>
Co-authored-by: Lee Nau <lnau@nvidia.com>
Motivation
The CuTe DSL BF16 GEMM backend is selected on SM10x GPUs, but both runtime entry points reject SM107. Enabling the architecture gate also exposes a bias conversion issue: DLPack rejects a bias view that retains
requires_grad=True, even during inference undertorch.no_grad().Modifications
requires_grad=Truebias undertorch.no_grad().The GEMM kernel math, tactic selection, and launch behavior are unchanged.
Accuracy Tests
The existing numerical comparison test now covers the added shape and gradient-bearing bias case. Controlled SM107 validation passed for eager execution, CUDA Graph execution, and an end-to-end accuracy workload on the pinned development base.
Current upstream-main GPU CI is pending while this PR remains a draft.
Speed Tests and Profiling
Controlled end-to-end SM107 testing confirmed that enabling this backend removes the fallback to
torch.nn.functional.linear. No kernel implementation or tactic was changed.Current upstream-main performance confirmation is pending while this PR remains a draft.
Checklist
Local Validation
pre-commit run --filespassed for all four modified files.git diff --checkpassed.CI States
Latest PR Test (Base): ❌ Run #31033970223
Latest PR Test (Extra): ❌ Run #31033969425