flash norm + blackwell softmax#4
Open
Lazarus-931 wants to merge 6 commits into
Open
Conversation
Blackwell softmax + FlashNorm kernel
add ampere flash_norm + bench entry
| kernel_name = _extract_entry_name(ptx_source) | ||
|
|
||
| err, module = driver.cuModuleLoadData(ptx_source.encode()) | ||
| if err == driver.CUresult.CUDA_ERROR_UNSUPPORTED_PTX_VERSION: |
Owner
There was a problem hiding this comment.
Why are the changes to this file needed?
Contributor
Author
There was a problem hiding this comment.
for blackwell softmax, i kept hitting compiling errors, apparently torch's bundled CUDA driver JIT is built for sm_50–sm_90, so cuModuleLoadData always gave me a CUDA_ERROR_INVALID_PTX.
errors like:
Found GPU0 NVIDIA B200 which is of compute capability (CC) 10.0.
The following list shows the CCs this version of PyTorch was built
for and the hardware CCs it supports:
- 5.0 which supports hardware CC >=5.0,<6.0
- 6.0 which supports hardware CC >=6.0,<7.0
- 7.0 which supports hardware CC >=7.0,<8.0
- 7.5 which supports hardware CC >=7.5,<8.0
- 8.0 which supports hardware CC >=8.0,<9.0
- 8.6 which supports hardware CC >=8.6,<9.0
- 9.0 which supports hardware CC >=9.0,<10.0
patrick-toulme
requested changes
May 3, 2026
patrick-toulme
left a comment
Owner
There was a problem hiding this comment.
Confused about why jax_support.py needs changes
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Per req of #2, added flash norm
There is a per kernel gain of 5-7%, didn't test fully as @fm1320 had said, and I do thing the 12% gains materialize when in a 256-token decode with 33 norm call. Per paper, I made it two sep @_kernel calls, one launching xW and another doing RMS(x).
Also included softmax for blackwell, ~2.7x faster than torch, but again std::exp is slower in torch than log2e used in this, so not really a accurate comparison, as @ezyang mentioned.