Repository navigation
[VectorDistribution]reduction support along LLVMGPUVectorDistribute pipeline - #18519
Closed
bangtianliu wants to merge 7 commits into
Closed
bangtianliu wants to merge 7 commits into
bangtianliu wants to merge 7 commits into
Conversation
bangtianliu
requested review from
Groverkss,
MaheshRavishankar,
antiagainst,
hanhanW,
kuhar and
qedawkins
as code owners
September 13, 2024 00:27
bangtianliu
marked this pull request as draft
September 13, 2024 00:28
bangtianliu
force-pushed
the
reduction_vectordistribute
branch
from
September 13, 2024 00:29
a030dab to
9ab709a
Compare
Contributor
Author
|
Still need to solve long compilation time issue |
bangtianliu
force-pushed
the
reduction_vectordistribute
branch
from
October 3, 2024 17:30
2047f61 to
8665e92
Compare
Signed-off-by: Bangtian Liu <[email protected]>
Signed-off-by: Bangtian Liu <[email protected]>
Signed-off-by: Bangtian Liu <[email protected]>
Signed-off-by: Bangtian Liu <[email protected]>
Groverkss
requested changes
Oct 15, 2024
Groverkss
left a comment
Contributor
There was a problem hiding this comment.
This is great work. Thanks! The approach is reasonable. To get started, can we split this into 3 patches:
- Distribution fixes for splat values
- Layout analysis fixes
- KernelConfig additions
The first 2 patches are easy to stamp, the 3rd patch needs some thinking through.
| replaceOpWithDistributedValues(rewriter, constantOp, | ||
| distirbutedOp->getResult(0)); | ||
|
|
||
| //@Bangtian: will revisit this part later |
Comment on lines
+112
to
+113
| bool isScalar = cast<ShapedType>(vectorType).getRank() == 0; | ||
| if (!isScalar) { |
Contributor
There was a problem hiding this comment.
nit: invert condition to be if (isScalar) and move the else branch
| //@Bangtian: will revisit this part later | ||
| bool isScalar = cast<ShapedType>(vectorType).getRank() == 0; | ||
| if (!isScalar) { | ||
| Operation *distirbutedOp = rewriter.create<arith::ConstantOp>( |
Contributor
There was a problem hiding this comment.
nit: distirbuted -> distributed
| //@Bangtian: will revisit this part later | ||
| bool isScalar = cast<ShapedType>(vectorType).getRank() == 0; | ||
| if (!isScalar) { | ||
| Operation *distirbutedOp = rewriter.create<arith::ConstantOp>( |
| replaceOpWithDistributedValues(rewriter, constantOp, | ||
| distirbutedOp->getResult(0)); | ||
| } else { | ||
| Operation *distirbutedOp = rewriter.create<arith::ConstantOp>( |
| // rank check is added to ensure that the type is indeed a vector | ||
| // value. | ||
| bool isSrcVector = | ||
| (srcVector != nullptr) && (srcVector.getType().getRank() != 0); |
Contributor
There was a problem hiding this comment.
nit: you can just check srcVector && ...
| // rank check is added to ensure that the type is indeed a vector | ||
| // value. | ||
| bool isSrcVector = | ||
| (srcVector != nullptr) && (srcVector.getType().getRank() != 0); |
Contributor
There was a problem hiding this comment.
I would create a helper function "isScalar" and use that instead of checking rank everywhere.
Comment on lines
+139
to
+141
| void visitRegionBranchTerminatorOpInterface(RegionBranchOpInterface branch, | ||
| RegionBranchPoint branchPoint); | ||
|
|
Contributor
There was a problem hiding this comment.
Can we move this fix to a seperate patch?
Comment on lines
+641
to
+642
| if (resultLattices.empty()) | ||
| return; |
Comment on lines
+708
to
+709
| if (!isa<VectorType>(inputType)) | ||
| return; |
This was referenced Oct 15, 2024
Signed-off-by: Bangtian Liu <[email protected]>
Groverkss
pushed a commit
that referenced
this pull request
Oct 28, 2024
…ion with scalars (#18800) Splitting #18519 into four patches. Depends #18784 This is the second one, adding the corresponding layout analysis and especially supporting the case where reduction is performed inside scf.for operation. Also, the relevant tests are added. Since patch 2 includes changes from patch #18784, the necessary updates from the first patch have also been included here. --------- Signed-off-by: Bangtian Liu <[email protected]>
Signed-off-by: Bangtian Liu <[email protected]>
Signed-off-by: Bangtian Liu <[email protected]>
Eliasj42
pushed a commit
that referenced
this pull request
Oct 31, 2024
…ion with scalars (#18800) Splitting #18519 into four patches. Depends #18784 This is the second one, adding the corresponding layout analysis and especially supporting the case where reduction is performed inside scf.for operation. Also, the relevant tests are added. Since patch 2 includes changes from patch #18784, the necessary updates from the first patch have also been included here. --------- Signed-off-by: Bangtian Liu <[email protected]> Signed-off-by: Elias Joseph <[email protected]>
giacs-epic
pushed a commit
to giacs-epic/iree
that referenced
this pull request
Dec 4, 2024
…ion with scalars (iree-org#18800) Splitting iree-org#18519 into four patches. Depends iree-org#18784 This is the second one, adding the corresponding layout analysis and especially supporting the case where reduction is performed inside scf.for operation. Also, the relevant tests are added. Since patch 2 includes changes from patch iree-org#18784, the necessary updates from the first patch have also been included here. --------- Signed-off-by: Bangtian Liu <[email protected]> Signed-off-by: Giacomo Serafini <[email protected]>
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.
Adding support for Linalg operations with reduction dimensions using the LLVMGPUVectorDistribute pipeline. Currently, there are unknown issues (debugging) when compiling sdxl, so this is marked as a draft until the bugs are resolved