Repository navigation
Reduce control flow overhead when tiling conv/pool ops. - #3419
Merged
MaheshRavishankar merged 2 commits intoOct 12, 2020
Merged
MaheshRavishankar merged 2 commits into
MaheshRavishankar merged 2 commits into
Conversation
MaheshRavishankar
requested review from
ThomasRaoux,
antiagainst,
asaadaldien,
hanhanW and
nicolasvasilache
October 9, 2020 17:43
MaheshRavishankar
pushed a commit
to MaheshRavishankar/iree
that referenced
this pull request
Oct 9, 2020
hanhanW
approved these changes
Oct 12, 2020
hanhanW
left a comment
Contributor
There was a problem hiding this comment.
LGTM, sorry for the late review! Thanks!
| FuncOp numWorkgroupsFn = dyn_cast<FuncOp>(SymbolTable::lookupSymbolIn( | ||
| spvFuncOp.getParentOfType<ModuleOp>(), numWorkgroupsFnAttr)); | ||
| if (!numWorkgroupsFn) { | ||
| return spvFuncOp.emitError("unable to fund function ") |
This PR fixes the issues that were preventing conv/pool tile loop distribution and lowering to loops from following the same approach as matmul. With this PR the inter-tile loops can be eliminated and the workitem loops can be converted to a simple `scf.if` reducing the control flow overhead significantly. This also means that all the tiling to workgroups patterns are now using the same pattern. These can always be specialized later, but based on explicit needs. This also means that the conv/pool operations also generate a function to determine the number of workgroups to use during the launch, cleaning up some of the fallback paths in the SPIRVTarget code. Adding a test that was causing the correctness issues.
ThomasRaoux
approved these changes
Oct 12, 2020
MaheshRavishankar
force-pushed
the
reduce_conv_pool_control_overhead
branch
from
October 12, 2020 17:15
d2eb245 to
6cd5c15
Compare
MaheshRavishankar
pushed a commit
to MaheshRavishankar/iree
that referenced
this pull request
Oct 12, 2020
MaheshRavishankar
pushed a commit
to MaheshRavishankar/iree
that referenced
this pull request
Oct 13, 2020
Merged
MaheshRavishankar
added a commit
to MaheshRavishankar/iree
that referenced
this pull request
Oct 13, 2020
This PR fixes the issues that were preventing conv/pool tile loop distribution and lowering to loops from following the same approach as matmul. With this PR the inter-tile loops can be eliminated and the workitem loops can be converted to a simple `scf.if` reducing the control flow overhead significantly. This also means that all the tiling to workgroups patterns are now using the same pattern. These can always be specialized later, but based on explicit needs. This also means that the conv/pool operations also generate a function to determine the number of workgroups to use during the launch, cleaning up some of the fallback paths in the SPIRVTarget code. Adding a test that was causing the correctness issues.
MaheshRavishankar
pushed a commit
to MaheshRavishankar/iree
that referenced
this pull request
Oct 13, 2020
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.
This PR fixes the issues that were preventing conv/pool tile loop
distribution and lowering to loops from following the same approach as
matmul. With this PR the inter-tile loops can be eliminated and the
workitem loops can be converted to a simple
scf.ifreducing thecontrol flow overhead significantly. This also means that all the
tiling to workgroups patterns are now using the same pattern. These
can always be specialized later, but based on explicit needs.
This also means that the conv/pool operations also generate a function
to determine the number of workgroups to use during the launch,
cleaning up some of the fallback paths in the SPIRVTarget code.
Adding a test that was causing the correctness issues.
Closes #2134