-
Notifications
You must be signed in to change notification settings - Fork 3.7k
[TIR][Schedule] Blockize and Tensorize #9871
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
Conversation
36e6ed0 to
5a31897
Compare
src/tir/schedule/state.cc
Outdated
| self_->block_info[scope_root] = BlockInfo(BlockScope(child_block_srefs)); | ||
| BlockInfo& info = self_->block_info[scope_root]; |
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.
Why this change? I suppose they are logically equivalent and the original one saves one lookup?
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.
emplace will not overwrite the old entry if the key exists. This function may be called in UpdateScopeBlockInfo
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.
Oh I see - that makes sense to me! Then to save one look-up, let's do
| self_->block_info[scope_root] = BlockInfo(BlockScope(child_block_srefs)); | |
| BlockInfo& info = self_->block_info[scope_root]; | |
| BlockInfo& info = self_->block_info[scope_root] = BlockInfo(BlockScope(child_block_srefs)); |
src/tir/schedule/analysis.h
Outdated
| bool CompareRange(const Range& lhs, const Range& rhs); | ||
| bool CompareType(const DataType& lhs, const DataType& rhs); | ||
|
|
||
| protected: |
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.
Why protected?
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.
there might be some use cases to subclass this class, like auto tensorization
| if (n->type_index() != other->type_index()) return false; | ||
| bool equal = StmtComparator::VisitStmt(n, other); | ||
| if (!equal && assert_mode_) | ||
| LOG(FATAL) << "Stmts are not matching between:\n" << n << "\nand\n" << other; |
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.
Can we use ScheduleError here? Since it has a better error renderer
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.
looks like it's non-trivial for now to do so, let's leave it as future improvement
junrushao
left a comment
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.
Looks like all my comments (a lot) are addressed. Thanks for the effort @vinx13!
Co-authored-by: Siyuan Feng <[email protected]> Co-authored-by: Bohan Hou <[email protected]> Co-authored-by: Hongyi Jin <[email protected]> Co-authored-by: Ruihang Lai <[email protected]> Co-authored-by: Junru Shao <[email protected]> Co-authored-by: Xiyou Zhou <[email protected]>
* WIP * WIP * WIP * test cases * add examples * lint * Amend co-authors information Co-authored-by: Siyuan Feng <[email protected]> Co-authored-by: Bohan Hou <[email protected]> Co-authored-by: Hongyi Jin <[email protected]> Co-authored-by: Ruihang Lai <[email protected]> Co-authored-by: Junru Shao <[email protected]> Co-authored-by: Xiyou Zhou <[email protected]> * WIP * address comments and changed tensorized comparator * update * nit * fix example * lint * lint * lint * remove unused * trigger ci * clang-format * fix * rebase Co-authored-by: Siyuan Feng <[email protected]> Co-authored-by: Bohan Hou <[email protected]> Co-authored-by: Hongyi Jin <[email protected]> Co-authored-by: Ruihang Lai <[email protected]> Co-authored-by: Junru Shao <[email protected]> Co-authored-by: Xiyou Zhou <[email protected]>
* WIP * WIP * WIP * test cases * add examples * lint * Amend co-authors information Co-authored-by: Siyuan Feng <[email protected]> Co-authored-by: Bohan Hou <[email protected]> Co-authored-by: Hongyi Jin <[email protected]> Co-authored-by: Ruihang Lai <[email protected]> Co-authored-by: Junru Shao <[email protected]> Co-authored-by: Xiyou Zhou <[email protected]> * WIP * address comments and changed tensorized comparator * update * nit * fix example * lint * lint * lint * remove unused * trigger ci * clang-format * fix * rebase Co-authored-by: Siyuan Feng <[email protected]> Co-authored-by: Bohan Hou <[email protected]> Co-authored-by: Hongyi Jin <[email protected]> Co-authored-by: Ruihang Lai <[email protected]> Co-authored-by: Junru Shao <[email protected]> Co-authored-by: Xiyou Zhou <[email protected]>
This PR added two schedule primitives, blockize, and tensorize to TensorIR.
cc @junrushao1994 @spectrometerHBH @Hzfengsy @masahi @comaniac @tqchen @csullivan
Co-authored-by: Siyuan Feng [email protected]
Co-authored-by: Bohan Hou [email protected]
Co-authored-by: Hongyi Jin [email protected]
Co-authored-by: Ruihang Lai [email protected]
Co-authored-by: Junru Shao [email protected]
Co-authored-by: Xiyou Zhou [email protected]