-
Notifications
You must be signed in to change notification settings - Fork 3.4k
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
[schedule] Improve ceil_divide in tile/split #3842
Merged
Merged
Changes from 3 commits
Commits
Show all changes
5 commits
Select commit
Hold shift + click to select a range
bf5f79e
[schedule] Improve ceil_divide in tile/split
yzhliu 0e9685e
support arithmetic size (only multiplication for now) in codegen
yzhliu 67f9385
fix lint
yzhliu 21b9714
Merge remote-tracking branch 'upstream/master' into shape8M
yzhliu 425d5c7
revert codegen change
yzhliu 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 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 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 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 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
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.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please comment about an example use-case.
This logic deals with an additional constraint like 8 * arg = value, and we would like to know what is the example application. Because normally, this will generate a constraint instead and the simplifier should be able to simplify the constraint. So we won't need this logic.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
without the fix, tvm will complain things like "TVMError: Not all Vars are passed in api_args: 'M' 'K' 'N' does not appear in api_args"
The example use-case is op computation for mxnet. To get decent performance for unknown shape (during compile time), we generate multiple kernels for one operator, and dispatch according to the shape during runtime. However, if the shape is pure symbolic, tiling/splitting has to generate if-else, which hurts the performance. One idea is to "hint" tvm, say, this shape can be divided by 8, pls don't generate if-else for tile size 2/4/8. This is where
8*M
comes from.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I see, i think we could use better expressions for such kind of hint. Your proposal is interesting.
We could also use alternatives to resolve this problem, in particular, we can do something like
AssertExpr(x, x % 8 == 0)
. Given this change affects more of the perf, can be separate it out from this PR?There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
do you mean remove the second commit (support arithmetic size in codegen) from this PR and merge the first one (Improve ceil_divide in tile/split) for now?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, we can use a second PR for that
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
reverted