-
Notifications
You must be signed in to change notification settings - Fork 78
Initial support for tritongpu.upcast_mxfp lowering
#2951
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
Changes from 14 commits
Commits
Show all changes
16 commits
Select commit
Hold shift + click to select a range
9b0d47d
Codegen for tritongpu.upcast_mxfp
etiotto c690cad
Add DotScaled to DPAS Analysis and fix bf16 fmul
leonling-ll cfabc03
Use blocked layout to lower upcast_mxfp op
leonling-ll 0a58d8e
Fix e2m1
leonling-ll 698a0bd
Fix failiing lit tests
etiotto 90f937a
Fix rhs scaling
leonling-ll b36c35e
make mxfpScaleBf16 private
leonling-ll 9ab90fa
Address code review comments
etiotto bc32cd2
Address code review comments
etiotto 48feaa4
Merge branch 'liyang/upcast_mxfp_and_dot_scaled' of https://github.co…
etiotto cb82d19
ASkip failing tt.dot_scaled test
etiotto 06aa7ef
Address code review comments
etiotto 63ab535
Merge branch 'main' into liyang/upcast_mxfp_and_dot_scaled
etiotto f3b501d
Merge branch 'main' into liyang/upcast_mxfp_and_dot_scaled
etiotto e2e87cd
Add test_scaled_dot tests to LTS skip list
etiotto c60f763
Address code review comments
etiotto File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
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
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
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
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
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -26,6 +26,14 @@ class DPASAnalysis { | |
| BF16_BF16_BF16_BF16, | ||
| U32_U32_U8_U8, | ||
| S32_S32_S8_S8, | ||
| // data types for dot scaled. | ||
| FP32_FP32_BF16_FP8, | ||
| FP32_FP32_BF16_FP4, | ||
| FP32_FP32_FP8_BF16, | ||
| FP32_FP32_FP8_FP8, | ||
| FP32_FP32_FP8_FP4, | ||
| FP32_FP32_FP4_BF16, | ||
| FP32_FP32_FP4_FP8, | ||
| NOT_APPLICABLE | ||
| }; | ||
|
|
||
|
|
@@ -39,17 +47,24 @@ class DPASAnalysis { | |
| /// (aka threads per warp) size. | ||
| Result canUseDPAS(FunctionOpInterface funcOp) const; | ||
|
|
||
| /// Given a DotOp operation, return its DPAS engine type. | ||
| static DPASEngineType getDPASType(DotOp op); | ||
| /// Given a 'DotOp' or 'ScaledDot' operation, return its DPAS engine type. | ||
| static DPASEngineType getDPASType(Operation *op); | ||
|
|
||
| // clang-format off | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. why need to turn off clang-format?
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. because it formats the template horribly |
||
| template <typename OpTy> | ||
| typename std::enable_if<llvm::is_one_of<OpTy, DotOp, DotScaledOp>::value, | ||
| DPASAnalysis::DPASEngineType>::type | ||
| static getDPASType(OpTy); | ||
| // clang-format on | ||
|
|
||
| private: | ||
| mlir::ModuleOp mod; | ||
|
|
||
| /// Tracks Dot operations and their DPAS engine type. | ||
| std::map<DotOp, DPASEngineType> dotToDPASEngineMap; | ||
| /// Tracks Dot/DotScaled operations and their DPAS engine type. | ||
| std::map<Operation *, DPASEngineType> dotToDPASEngineMap; | ||
|
|
||
| /// Tracks the Dot operations contained in a function. | ||
| std::map<FunctionOpInterface, SmallVector<DotOp>> funcToDotMap; | ||
| /// Tracks the Dot/DotScaled operations contained in a function. | ||
| std::map<FunctionOpInterface, SmallVector<Operation *>> funcToDotMap; | ||
| }; | ||
|
|
||
| } // namespace mlir::triton::gpu::intel | ||
|
|
||
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
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
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
Oops, something went wrong.
Oops, something went wrong.
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.
Uh oh!
There was an error while loading. Please reload this page.