junrushao commented on code in PR #13734:
URL: https://github.com/apache/tvm/pull/13734#discussion_r1065423327
##########
include/tvm/meta_schedule/schedule_rule.h:
##########
@@ -124,7 +125,8 @@ class ScheduleRule : public runtime::ObjectRef {
bool disallow_if_then_else, //
bool require_injective, //
bool require_ordered, //
- Optional<Array<String>> disallow_op);
+ Optional<Array<String>> disallow_op,
+ Optional<Array<String>>
disallow_block = {});
Review Comment:
It is less stable to specify blocks by their names, instead, please consider
using other approaches to suppress inline, for example, `T.block_attr`
##########
src/meta_schedule/trace_apply.cc:
##########
@@ -175,16 +175,30 @@ std::vector<BlockRV> ApplyAnchorTrace(Schedule sch, Trace
anchor_trace) {
Array<ObjectRef> outputs = inst->kind->f_apply_to_schedule(sch, inputs,
inst->attrs, decision);
if (inst->kind.same_as(kind_get_child_blocks)) {
- // We want to allow a trace generated for a single conv2d block to be
applied to
- // conv2d -> elemwise blocks, where two conv2d are the same workload.
- // GetChildBlocks returns a different number of blocks for the two cases
above, which
- // violates the assumption made by TranslateAddOutputRVs:
old_outputs.size() ==
- // new_outputs.size(). We workaround this problem by assuming that the
prefix of the "new"
- // outputs matches with the "old" outputs, and truncating the new
outputs accordingly.
- ICHECK(inst->outputs.size() <= outputs.size());
- TranslateAddOutputRVs(
- inst->outputs, Array<ObjectRef>(outputs.begin(), outputs.begin() +
inst->outputs.size()),
- &rv_map);
+ if (inst->outputs.size() == outputs.size()) {
+ TranslateAddOutputRVs(inst->outputs, outputs, &rv_map);
+ } else if (inst->outputs.size() < outputs.size()) {
+ // We want to allow a trace generated for a single conv2d block to be
applied to
Review Comment:
MetaSchedule requires structural stability - that is being said, it does not
support the case where the number of children varies. The workaround is
probably too hacky to get it work...Shall we consider other alternatives?
--
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]