-
Notifications
You must be signed in to change notification settings - Fork 3.7k
[Codegen, CUDA] Add FP8 Tensor Core Codegen #16950
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
Merged
Merged
Conversation
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
Member
|
cc @vinx13 |
Contributor
Author
|
I just removed the modification for the signature in get_mma_intrin_group, so this pr no longer affects items which uses this function. I believe this pr is now ready for review. @Hzfengsy |
spectrometerHBH
approved these changes
Feb 8, 2025
JoieAli
pushed a commit
to JoieAli/mcTVM
that referenced
this pull request
Jul 8, 2025
* [FP8] SM89 (Ada) can also support fp8. * extend fp8 vectorize to f16 * Supprt fp8 * Support fp8 mma codegen. * Fix test_tir_schedule_tensorize_ldmatrix_mma_numeric.py to use tvm.testing.main() * lint fix * lint fix * CUDA Lint fix * Fix formatting in codegen_cuda.cc * lint fix for ptc.cc * update comments * chore: Refactor CUDA tensor intrinsics function signature * remove debug print
JoieAli
pushed a commit
to JoieAli/mcTVM
that referenced
this pull request
Jul 8, 2025
* [FP8] SM89 (Ada) can also support fp8. * extend fp8 vectorize to f16 * Supprt fp8 * Support fp8 mma codegen. * Fix test_tir_schedule_tensorize_ldmatrix_mma_numeric.py to use tvm.testing.main() * lint fix * lint fix * CUDA Lint fix * Fix formatting in codegen_cuda.cc * lint fix for ptc.cc * update comments * chore: Refactor CUDA tensor intrinsics function signature * remove debug print
ShiboXing
pushed a commit
to ShiboXing/tvm
that referenced
this pull request
Aug 10, 2025
* [FP8] SM89 (Ada) can also support fp8. * extend fp8 vectorize to f16 * Supprt fp8 * Support fp8 mma codegen. * Fix test_tir_schedule_tensorize_ldmatrix_mma_numeric.py to use tvm.testing.main() * lint fix * lint fix * CUDA Lint fix * Fix formatting in codegen_cuda.cc * lint fix for ptc.cc * update comments * chore: Refactor CUDA tensor intrinsics function signature * remove debug print
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.
Major changes of this pull request:
requires_cuda_compute_versionfrom 9 to 8.9 (since sm_89 ada architecture also supports fp8 tensor cores, which is the platform I have tested on).get_mma_intrin_groupandget_mma_intrinfunctions, as the prior implementation assumed that input A and input B were of the same datatype. However, fp8 tensor cores can process combinations like e5m2e5m2, e5m2e4m3, e4m3e4m3, or e4m3e5m2. Note: This change may affect code in MLC that utilizesget_mma_intrin_group.Check out the correctness:
expected output:
numpy_simulated: [[-410.33817 -30.429443 -470.51312 ... 64.58632 -381.49658 14.920105] [ 56.357788 744.9746 -29.630783 ... -44.779022 298.5943 -24.109558] [ 77.765305 -426.8894 286.35736 ... 10.655792 -129.63507 232.30026 ] ... [ 39.094635 -47.508118 -225.59912 ... 775.10614 -109.92264 268.50952 ] [-813.8422 111.21069 -316.5697 ... 455.90875 -37.09839 478.28406 ] [ 122.78345 148.104 340.1291 ... -304.5721 -115.578735 -639.9563 ]] codegen: [[-410.28125 -30.441406 -470.09375 ... 64.66406 -381.5 14.8203125] [ 56.367188 744.8125 -29.597656 ... -44.695312 298.625 -24.148438 ] [ 77.65625 -426.71875 286.3125 ... 10.746094 -129.6875 232.34375 ] ... [ 39.191406 -47.539062 -225.57812 ... 774.9375 -109.875 268.46875 ] [-813.625 111.109375 -316.46875 ... 455.96875 -37.08203 478.0625 ] [ 122.75 148.10938 339.84375 ... -304.5 -115.546875 -639.8125 ]]Please CC @yzh119