[Linear Layouts] Implement LL conversion for DotOperand(version=2)#4891
Merged
lezcano merged 4 commits intotriton-lang:mainfrom Oct 15, 2024
Merged
[Linear Layouts] Implement LL conversion for DotOperand(version=2)#4891lezcano merged 4 commits intotriton-lang:mainfrom
lezcano merged 4 commits intotriton-lang:mainfrom
Conversation
Collaborator
|
Looks good overall but I'll look more in details after the lit tests are fixed |
Jokeren
reviewed
Oct 11, 2024
Jokeren
reviewed
Oct 11, 2024
lezcano
commented
Oct 14, 2024
Comment on lines
1040
to
+1045
| SmallVector<unsigned> DotOperandEncodingAttr::getWarpsPerCTA() const { | ||
| auto parentLayout = getParent(); | ||
| assert(parentLayout && "DotOperandEncodingAttr must have a parent"); | ||
| if (auto distributedLayout = | ||
| mlir::dyn_cast<DistributedEncodingTrait>(parentLayout)) { | ||
| return distributedLayout.getWarpsPerCTA(); | ||
| } else { | ||
| llvm::report_fatal_error( | ||
| "DotOperandEncodingAttr non-DistributedEncodingAttr parent not " | ||
| "supported yet"); | ||
| } | ||
| auto distributedLayout = mlir::cast<DistributedEncodingTrait>(getParent()); | ||
| auto warps = distributedLayout.getWarpsPerCTA(); | ||
| auto rank = warps.size(); | ||
| auto kDim = getOpIdx() == 0 ? rank - 1 : rank - 2; | ||
| warps[kDim] = 1; | ||
| return warps; |
Contributor
Author
There was a problem hiding this comment.
@Jokeren added this fix as I needed it for the layout conversion to be correct and pass the newly added tests.
Contributor
Author
|
Addressed the reviews |
Jokeren
reviewed
Oct 15, 2024
|
|
||
| LinearLayout ampereDotToLinearLayout(ArrayRef<int64_t> shape, | ||
| DotOperandEncodingAttr dot) { | ||
| // TODO,BE. Implement ampereMMA in terms of this one |
Contributor
There was a problem hiding this comment.
What does "BE" mean? Backend?
Jokeren
approved these changes
Oct 15, 2024
lezcano
added a commit
that referenced
this pull request
Oct 16, 2024
This PR includes #4891 and #4895. I will rebase once those have landed. It includes a number of hacks to work around bugs in `DotOperandEncodingAttr`. All these are marked as `FIXME [Dot LL]` to be easy to grep for. @Jokeren is working on a comprehensive revamp of `DotOperandEncodingAttr` which will get rid of all these. #4895 is the first step in this direction.
alexsamardzic
pushed a commit
to alexsamardzic/triton
that referenced
this pull request
Oct 16, 2024
This PR includes triton-lang#4891 and triton-lang#4895. I will rebase once those have landed. It includes a number of hacks to work around bugs in `DotOperandEncodingAttr`. All these are marked as `FIXME [Dot LL]` to be easy to grep for. @Jokeren is working on a comprehensive revamp of `DotOperandEncodingAttr` which will get rid of all these. triton-lang#4895 is the first step in this direction.
Luosuu
pushed a commit
to Luosuu/triton
that referenced
this pull request
Nov 13, 2024
…riton-lang#4891) Note that the current implementation uses `DotOperandEncodingAttr::getWarpsPerCTA`, which was buggy for cases where the warps are not of the form `[numWarps, 1]` or `[1, numWarps]`. This PR bundles a fix for this issue. We will activate its use for a subset of `DotOperandEncoding`s in a PR coming soon.
Luosuu
pushed a commit
to Luosuu/triton
that referenced
this pull request
Nov 13, 2024
This PR includes triton-lang#4891 and triton-lang#4895. I will rebase once those have landed. It includes a number of hacks to work around bugs in `DotOperandEncodingAttr`. All these are marked as `FIXME [Dot LL]` to be easy to grep for. @Jokeren is working on a comprehensive revamp of `DotOperandEncodingAttr` which will get rid of all these. triton-lang#4895 is the first step in this direction.
guacamoleo
pushed a commit
to guacamoleo/triton
that referenced
this pull request
Nov 14, 2024
…riton-lang#4891) Note that the current implementation uses `DotOperandEncodingAttr::getWarpsPerCTA`, which was buggy for cases where the warps are not of the form `[numWarps, 1]` or `[1, numWarps]`. This PR bundles a fix for this issue. We will activate its use for a subset of `DotOperandEncoding`s in a PR coming soon.
guacamoleo
pushed a commit
to guacamoleo/triton
that referenced
this pull request
Nov 14, 2024
This PR includes triton-lang#4891 and triton-lang#4895. I will rebase once those have landed. It includes a number of hacks to work around bugs in `DotOperandEncodingAttr`. All these are marked as `FIXME [Dot LL]` to be easy to grep for. @Jokeren is working on a comprehensive revamp of `DotOperandEncodingAttr` which will get rid of all these. triton-lang#4895 is the first step in this direction.
bertmaher
pushed a commit
to bertmaher/triton
that referenced
this pull request
Dec 10, 2024
…riton-lang#4891) Note that the current implementation uses `DotOperandEncodingAttr::getWarpsPerCTA`, which was buggy for cases where the warps are not of the form `[numWarps, 1]` or `[1, numWarps]`. This PR bundles a fix for this issue. We will activate its use for a subset of `DotOperandEncoding`s in a PR coming soon.
bertmaher
pushed a commit
to bertmaher/triton
that referenced
this pull request
Dec 10, 2024
This PR includes triton-lang#4891 and triton-lang#4895. I will rebase once those have landed. It includes a number of hacks to work around bugs in `DotOperandEncodingAttr`. All these are marked as `FIXME [Dot LL]` to be easy to grep for. @Jokeren is working on a comprehensive revamp of `DotOperandEncodingAttr` which will get rid of all these. triton-lang#4895 is the first step in this direction.
liuyunqi20
pushed a commit
to flagos-ai/FlagTree
that referenced
this pull request
Oct 21, 2025
This PR includes triton-lang/triton#4891 and triton-lang/triton#4895. I will rebase once those have landed. It includes a number of hacks to work around bugs in `DotOperandEncodingAttr`. All these are marked as `FIXME [Dot LL]` to be easy to grep for. @Jokeren is working on a comprehensive revamp of `DotOperandEncodingAttr` which will get rid of all these. triton-lang/triton#4895 is the first step in this direction.
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.
Note that the current implementation uses
DotOperandEncodingAttr::getWarpsPerCTA, which was buggy for cases where the warps are not of the form[numWarps, 1]or[1, numWarps]. This PR bundles a fix for this issue.We will activate its use for a subset of
DotOperandEncodings in a PR coming soon.