merrymercy commented on a change in pull request #4931: Tighten split's extent
URL: https://github.com/apache/incubator-tvm/pull/4931#discussion_r385613944
##########
File path: src/te/schedule/message_passing.cc
##########
@@ -72,14 +121,35 @@ void PassDownDomain(const Stage& stage,
}
CHECK(!state.count(r->inner));
const Range& range_parent = state.at(r->parent);
+ // Tighten iv's extent to min(parent_extent, factor_or_nparts), only if
all of the
+ // following conditions are met:
+ // 1. no leaf IterVar derived from iv binds to any thread. People may
use split
+ // to force an IterVar extent to match the number of allocated threads
to fuse stages
+ // that require different number of threads. We don't want to change
these extents.
+ // 2. allow_missing is false, i.e. that PassDownDomain is called by the
final InferBound,
+ // rather than by an early compiler phase, such as rfactor(). We don't
want to tighten an
+ // IterVar in an early phase allowing missing IterVars, because it may
bind to a thread later.
+ // 3. range_parent's extent is not 0. At lest one Topi test has a case
where a tensor has one
+ // zero-sized dimension. Split creates iv with a positive extent to
avoid zero-extent
+ // IterVar. We don't touch it.
+ auto resolve_min_extent_for_split = [&](IterVar iv, PrimExpr
factor_or_nparts) {
Review comment:
```suggestion
auto resolve_min_extent_for_split = [&](const IterVar& iv, const
PrimExpr& factor_or_nparts) {
```
----------------------------------------------------------------
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]
With regards,
Apache Git Services