masahi commented on code in PR #13329:
URL: https://github.com/apache/tvm/pull/13329#discussion_r1017631570
##########
src/meta_schedule/trace_apply.cc:
##########
@@ -140,9 +159,13 @@ std::vector<BlockRV> ApplyAnchorTrace(Schedule sch, Trace
anchor_trace) {
// Similar to the reverse_compute_inline case above.
auto block = Downcast<BlockRV>(inputs[0]);
auto block_sref = sch->GetSRef(block);
- if (!CanComputeInline(sch->state(), block_sref)) {
- ICHECK(CanReverseComputeInline(sch->state(), block_sref));
- sch->ReverseComputeInline(block);
+ auto state = sch->state();
+ if (!CanComputeInline(state, block_sref)) {
+ ICHECK(IsOutputBlock(state, block_sref, GetScopeRoot(state,
block_sref, false)))
+ << "If a spatial block cannot be inlined, it should be the output
block";
+ if (CanReverseComputeInline(sch->state(), block_sref)) {
+ sch->ReverseComputeInline(block);
+ }
Review Comment:
This is another fix, just relaxing the wrong assumption at L144.
--
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.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]