-
Notifications
You must be signed in to change notification settings - Fork 79
Introduce triton-to-unstructured pass
#210
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 8 commits
Commits
Show all changes
11 commits
Select commit
Hold shift + click to select a range
7d25c03
FoldUnstructuredTritonPtr
nhat-nguyen f8e5773
Update
nhat-nguyen b46785f
Update
nhat-nguyen ba41383
Fix missing add_subdirectory
nhat-nguyen 072e903
Simplify pass name
nhat-nguyen 999c080
Update FoldUnstructuredPtrPass.cpp
nhat-nguyen 7a53f67
Refactor
nhat-nguyen a2dd49e
Remove unused Triton pass registrations
nhat-nguyen bf5f7e5
Fix typo
nhat-nguyen f775362
Update comment
nhat-nguyen cd4c220
Remove unused op
nhat-nguyen 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
3 changes: 3 additions & 0 deletions
3
include/triton-shared/Conversion/TritonToUnstructured/CMakeLists.txt
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 |
|---|---|---|
| @@ -0,0 +1,3 @@ | ||
| set(LLVM_TARGET_DEFINITIONS Passes.td) | ||
| mlir_tablegen(Passes.h.inc -gen-pass-decls --name TritonToUnstructured) | ||
| add_public_tablegen_target(TritonToUnstructuredConversionPassIncGen) |
15 changes: 15 additions & 0 deletions
15
include/triton-shared/Conversion/TritonToUnstructured/Passes.h
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 |
|---|---|---|
| @@ -0,0 +1,15 @@ | ||
| #ifndef TRITON_TO_UNSTRUCTURED_CONVERSION_PASSES_H | ||
| #define TRITON_TO_UNSTRUCTURED_CONVERSION_PASSES_H | ||
|
|
||
| #include "triton-shared/Conversion/TritonToUnstructured/TritonToUnstructured.h" | ||
|
|
||
| namespace mlir { | ||
| namespace triton { | ||
|
|
||
| #define GEN_PASS_REGISTRATION | ||
| #include "triton-shared/Conversion/TritonToUnstructured/Passes.h.inc" | ||
|
|
||
| } // namespace triton | ||
| } // namespace mlir | ||
|
|
||
| #endif | ||
15 changes: 15 additions & 0 deletions
15
include/triton-shared/Conversion/TritonToUnstructured/Passes.td
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 |
|---|---|---|
| @@ -0,0 +1,15 @@ | ||
| #ifndef TRITON_TO_UNSTRUCTURED_CONVERSION_PASSES | ||
| #define TRITON_TO_UNSTRUCTURED_CONVERSION_PASSES | ||
|
|
||
| include "mlir/Pass/PassBase.td" | ||
|
|
||
| def TritonToUnstructured : Pass<"triton-to-unstructured", "mlir::ModuleOp"> { | ||
| let summary = "Transforms tt.addptr ops into offset accumulation ops"; | ||
| let constructor = "triton::createTritonToUnstructuredPass()"; | ||
| let options = [ | ||
| Option<"offsetBitWidth", "offset-bit-width", "size_t", /*default*/"32", | ||
| "Bitwidth used for the starting offset of each pointer"> | ||
| ]; | ||
| } | ||
|
|
||
| #endif |
17 changes: 17 additions & 0 deletions
17
include/triton-shared/Conversion/TritonToUnstructured/TritonToUnstructured.h
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 |
|---|---|---|
| @@ -0,0 +1,17 @@ | ||
| #ifndef TRITON_CONVERSION_TRITON_TO_UNSTRUCTURED_TRITON_TO_UNSTRUCTURED_H | ||
| #define TRITON_CONVERSION_TRITON_TO_UNSTRUCTURED_TRITON_TO_UNSTRUCTURED_H | ||
|
|
||
| #include "mlir/Pass/Pass.h" | ||
| #include "mlir/Transforms/DialectConversion.h" | ||
|
|
||
| #include "triton/Dialect/Triton/IR/Dialect.h" | ||
|
|
||
| namespace mlir { | ||
| namespace triton { | ||
|
|
||
| std::unique_ptr<OperationPass<ModuleOp>> createTritonToUnstructuredPass(); | ||
|
|
||
| } // namespace triton | ||
| } // namespace mlir | ||
|
|
||
| #endif // TRITON_CONVERSION_TRITON_TO_UNSTRUCTURED_TRITON_TO_UNSTRUCTURED_H |
16 changes: 9 additions & 7 deletions
16
include/triton-shared/Dialect/TritonStructured/IR/TritonStructuredDialect.h
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 |
|---|---|---|
| @@ -1,5 +1,6 @@ | ||
| add_subdirectory(TritonToLinalg) | ||
| add_subdirectory(TritonToLinalgExperimental) | ||
| add_subdirectory(TritonToStructured) | ||
| add_subdirectory(TritonToUnstructured) | ||
| add_subdirectory(TritonArithToLinalg) | ||
| add_subdirectory(StructuredToMemref) |
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 |
|---|---|---|
| @@ -0,0 +1,22 @@ | ||
| add_triton_library(TritonToUnstructured | ||
| TritonToUnstructuredPass.cpp | ||
|
|
||
| DEPENDS | ||
| TritonStructuredTableGen | ||
| TritonToUnstructuredConversionPassIncGen | ||
|
|
||
| LINK_LIBS PUBLIC | ||
| MLIRArithDialect | ||
| MLIRDialectUtils | ||
| MLIRIR | ||
| MLIRMathDialect | ||
| MLIRPass | ||
| MLIRTensorDialect | ||
| MLIRTransforms | ||
| MLIRSupport | ||
| MLIRReconcileUnrealizedCasts | ||
| TritonIR | ||
| TritonTransforms | ||
| TritonSharedAnalysisStructured | ||
| TritonStructuredIR | ||
| ) |
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.