masahi commented on code in PR #13329:
URL: https://github.com/apache/tvm/pull/13329#discussion_r1017638468
##########
tests/python/unittest/test_meta_schedule_trace_apply.py:
##########
@@ -2742,5 +3026,351 @@ def apply_trace(sch):
)
+def test_inline_order():
+ # In this test, the order of applying AutoInline is tested.
+ # We need to make sure that the last block in
Conv2dInt8_with_predicate_target,
+ # "compute_4", is AutoInline-ed after all other blocks have been processed.
+ #
+ # Otherwise, if the order is "T_add_2" -> "compute_4" -> "compute_3",
"compute_4" is neither
+ # inlined (because this is the last block) nor reverse-inlined
+ # (because it has multiple producers). This results in the "compute_4"
block being
+ # reverse-inlined at the very end of ScheduleUsingAnchorTrace, where its
producer block
+ # "conv2d_nhwc_reindex_shared" has the predicate
+ # T.where(((ax1_0 * 4 + ax1_1) * 32 + ax1_2) * 2 + ax1_3 < 64) due to
anchor-block scheduling
+ # (see Conv2dInt8_with_predicate_scheduled). Currently, if we try to
reverse-inline a block to
+ # its producer that has a predicate, the predicate disappears after
reverse inlining.
Review Comment:
cc @vinx13 to confirm if applying `reverse_compute_inline` when the producer
has a predicate should be disallowed. Currently it is allowed, and the
predicate disappears. A minimum repro in
https://gist.github.com/masahi/01a80b86062122ad57b9b1fd785fb960
--
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]