Uh oh!
There was an error while loading. Please reload this page.
[REFACTOR][BOYC] Non recursive partitioning - #5493
Conversation
zhiics
commented
Apr 30, 2020
@mbrookhart please take a look for the mixed mutator pattern. BTW, we will still need to refactor the infertype pass as it is the most frequently used pass. @comaniac@masahi@mbaret@manupa-arm@trevor-m please take a look. |
comaniac
left a comment
There was a problem hiding this comment.
We were trying rewriter but it is not applicable to this pass due to https://github.com/apache/incubator-tvm/pull/5493/files#diff-8d2cdf6314f73e4b32892679ad4dc44aR280, which traverses other nodes out of order. As a result, the current solution seems the most suitable.
mbrookhart
left a comment
There was a problem hiding this comment.
Use of the iterative traversals looks great. Since you originally authored the class, I'll believe you about the necessary mutators.
Why so much auto-formatting noise? As a larger conversation, we might want to build a style checker into CI that enforces a particular auto-format implementaiton...
comaniac
commented
Apr 30, 2020
Ah I think that's because I manually ran clang-format for the file. We should definitely build style checker in CI. |
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
| bool found_start_{false}; | ||
| bool found_end_{false}; | ||
| /*! \brief Map from each region output expr node to its output index and TupleGetItem node. */ | ||
| std::unordered_map<Expr, std::pair<int, TupleGetItem>, ObjectHash, ObjectEqual> out_expr_indices; |
There was a problem hiding this comment.
Since both arguments of TupleGetItem (func_call and the index) are in this struct, this TupleGetItem seems redundant to me. Also see my comment at L282.
There was a problem hiding this comment.
If this TupleGetItem is intended to be cached, please come up with a better name than out_expr_indices, since it is not just indices.
There was a problem hiding this comment.
Rename to region_func_out and only cache the function output expressions (Call or TupleGetItem).
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
3a6f409 to
00be9a9Compare00be9a9 to
26404c1Comparecomaniac
commented
May 1, 2020
@masahi thanks for valuable suggestions. We've refactored |
masahi
commented
May 1, 2020
* non recursive partitioning * refactor maps * rebase upstream * refactor shared output * address comments Co-authored-by: Cody Yu <comaniac0422@gmail.com>
* non recursive partitioning * refactor maps * rebase upstream * refactor shared output * address comments Co-authored-by: Cody Yu <comaniac0422@gmail.com>
* non recursive partitioning * refactor maps * rebase upstream * refactor shared output * address comments Co-authored-by: Cody Yu <comaniac0422@gmail.com>
* non recursive partitioning * refactor maps * rebase upstream * refactor shared output * address comments Co-authored-by: Cody Yu <comaniac0422@gmail.com>
This PR refactors the partitioning pass by using non-recursive mutator. It also removes the unnecessary mutators as we only need to look at begin/end annotations which are definitely wrapped in call nodes. In addition, a metadata struct is used to maintain the intermediate data needed for partitioning.