comaniac commented on a change in pull request #6686:
URL: https://github.com/apache/incubator-tvm/pull/6686#discussion_r505272389
##########
File path: src/te/schedule/schedule_dataflow_rewrite.cc
##########
@@ -138,6 +138,15 @@ Tensor Schedule::cache_read(const Tensor& tensor, const
std::string& scope,
}
os << "." << scope;
+ // when a schedule has multiple cache_read on the same tensor,
+ // we make sure their op names are unique. e.g., w.shared, w.shared.d,
w.shared.d.d
+ for (auto pair : (*this)->stage_map) {
+ auto stage = pair.second;
+ if (stage->op->name == os.str()) {
+ os << ".d";
Review comment:
I was thinking about this too, but in this way we need to maintain
another set in Schedule. Consider this case doesn't happen frequently now, the
current solution should be sufficient. We can definitely use the approach you
suggested in the future after naming conflict becomes much common.
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
[email protected]