You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
. However, I'm not sure if this is the right fix as I am having trouble understanding the logic of bound checking. The part that confuses me is why the reduction body does not skip the bound checks (shown in
if (vmax.dtype() != value.dtype() || !analyzer.CanProve(vmax < dom->extent)) {
preds.emplace_back(value < dom->extent);
}
}
}
for (const IterVar& iv : stage->op->root_iter_vars()) {
if (skip_iter.count(iv) || iv->iter_type == kOpaque) continue;
Range dom = dom_map.at(iv);
ICHECK(iv->dom.defined());
if (!skip_ivar_domain && !IsRangeSame(iv->dom, dom)) {
PrimExpr value = value_map.at(iv) - iv->dom->min;
IntSet s = analyzer.int_set(value, iset_dmap);
PrimExpr vmin = s.min();
PrimExpr vmax = s.max();
// The range of `value` resides in [vmin, vmax]
if (vmin.dtype() != value.dtype() || !analyzer.CanProve(vmin >= 0)) {
preds.emplace_back(value >= 0);
}
if (vmax.dtype() != value.dtype() || !analyzer.CanProve(vmax < iv->dom->extent)) {
preds.emplace_back(value < iv->dom->extent);
}
}
}
return preds;
}
and passing false to skip_ivar_domain only disables the second one. But the first check seems not comprehensive: in the above code, due to the compute_at B's axis is "implicitly" binded to a split axis of C, but the first check cannot see the split relation. As a result PassUpBoundCheck doesn't mark it as needing checks. So I'm also curious whehter this is expected or not.
This triggers segmentation fault. The produced IR is
where
B_2[((i.outer*100) + i.inner)] = 0f32
isn't wrapped with the predicate as in the reduction body.Investigation
The problem can be solved if we do not skip the bound check by replacing
!stage->rolling_buffer
withfalse
intvm/src/te/operation/compute_op.cc
Lines 487 to 488 in adf560e
tvm/src/te/operation/compute_op.cc
Lines 446 to 447 in adf560e
I see that there are two types (L550-L560 and L561-577) of bound checks in the MakeBoundCheck function
tvm/src/te/schedule/message_passing.cc
Lines 526 to 580 in adf560e
false
toskip_ivar_domain
only disables the second one. But the first check seems not comprehensive: in the above code, due to the compute_atB
's axis is "implicitly" binded to a split axis ofC
, but the first check cannot see the split relation. As a resultPassUpBoundCheck
doesn't mark it as needing checks. So I'm also curious whehter this is expected or not.Environment
OS: Ubuntu 18.04
TVM Version: ecd8a9c
The text was updated successfully, but these errors were encountered: