[TIR] HoistExpression, generalization of HoistIfThenElse#11592
Merged
vinx13 merged 12 commits intoapache:mainfrom Jun 24, 2022
Merged
[TIR] HoistExpression, generalization of HoistIfThenElse#11592vinx13 merged 12 commits intoapache:mainfrom
vinx13 merged 12 commits intoapache:mainfrom
Conversation
This feels like it should definitely be part of RewriteSimplify, but that will require making CanInlineLet be a virtual function.
This is a generalized form of HoistIfThenElse, which can also hoist Let bindings, or portions of conditional expressions. This will be used in upcoming changes to separate compute loops into a slow loop that handles edge cases and a fast branchless loop.
Contributor
Author
|
Current failures in Once #11646 is merged, will rebase this PR on top of it. |
Contributor
Author
|
Merged from main now that #11646 is merged. Previous CI failures were due to inconsistent simplification of |
Didn't correctly reproduce previous behavior. In addition to preventing hoisting of expressions that use a block variable (e.g. threadIdx.x), should also prevent hoisting of expressions across a "thread_extent" AttrStmt.
vinx13
approved these changes
Jun 22, 2022
zxybazh
pushed a commit
to zxybazh/tvm
that referenced
this pull request
Jun 26, 2022
* [TIR][Arith] Use non-inlined bindings when proving conditional * [TIR][Arith] Recognize Var when used as a literal constraint * [TIR][Arith] Added simplification of constrained if_then_else op This feels like it should definitely be part of RewriteSimplify, but that will require making CanInlineLet be a virtual function. * [TIR] Implemented HoistExpression transformation This is a generalized form of HoistIfThenElse, which can also hoist Let bindings, or portions of conditional expressions. This will be used in upcoming changes to separate compute loops into a slow loop that handles edge cases and a fast branchless loop. * [TIR] Expressed HoistIfThenElse as special case of HoistExpression * Lint fixes * Fixed breakage in tvmc unit test that relied on pass type * More accurate handling of kUsingBlockVar Didn't correctly reproduce previous behavior. In addition to preventing hoisting of expressions that use a block variable (e.g. threadIdx.x), should also prevent hoisting of expressions across a "thread_extent" AttrStmt. * Updated comment for HoistExpression pass * Fix linting error
blackkker
pushed a commit
to blackkker/tvm
that referenced
this pull request
Jul 7, 2022
* [TIR][Arith] Use non-inlined bindings when proving conditional * [TIR][Arith] Recognize Var when used as a literal constraint * [TIR][Arith] Added simplification of constrained if_then_else op This feels like it should definitely be part of RewriteSimplify, but that will require making CanInlineLet be a virtual function. * [TIR] Implemented HoistExpression transformation This is a generalized form of HoistIfThenElse, which can also hoist Let bindings, or portions of conditional expressions. This will be used in upcoming changes to separate compute loops into a slow loop that handles edge cases and a fast branchless loop. * [TIR] Expressed HoistIfThenElse as special case of HoistExpression * Lint fixes * Fixed breakage in tvmc unit test that relied on pass type * More accurate handling of kUsingBlockVar Didn't correctly reproduce previous behavior. In addition to preventing hoisting of expressions that use a block variable (e.g. threadIdx.x), should also prevent hoisting of expressions across a "thread_extent" AttrStmt. * Updated comment for HoistExpression pass * Fix linting error
14 tasks
mikeseven
pushed a commit
to mikeseven/tvm
that referenced
this pull request
Sep 27, 2023
* [TIR][Arith] Use non-inlined bindings when proving conditional * [TIR][Arith] Recognize Var when used as a literal constraint * [TIR][Arith] Added simplification of constrained if_then_else op This feels like it should definitely be part of RewriteSimplify, but that will require making CanInlineLet be a virtual function. * [TIR] Implemented HoistExpression transformation This is a generalized form of HoistIfThenElse, which can also hoist Let bindings, or portions of conditional expressions. This will be used in upcoming changes to separate compute loops into a slow loop that handles edge cases and a fast branchless loop. * [TIR] Expressed HoistIfThenElse as special case of HoistExpression * Lint fixes * Fixed breakage in tvmc unit test that relied on pass type * More accurate handling of kUsingBlockVar Didn't correctly reproduce previous behavior. In addition to preventing hoisting of expressions that use a block variable (e.g. threadIdx.x), should also prevent hoisting of expressions across a "thread_extent" AttrStmt. * Updated comment for HoistExpression pass * Fix linting error
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 is a generalized form of
HoistIfThenElse, which can also hoistLetbindings and independent portions of conditional expressions, in addition to hoisting an entire conditional expression. This will be used in upcoming changes to separate compute loops into a slow loop that handles edge cases and a fast branchless loop.