Skip to content

Commit e602929

Browse files
committed
fix sketch search policy
1 parent 813dd74 commit e602929

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

src/auto_scheduler/search_policy/sketch_policy_rules.cc

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -908,6 +908,7 @@ PopulationGenerationRule::ResultKind MutateTileSize::Apply(SketchPolicyNode* pol
908908
continue;
909909
}
910910

911+
// Divide one factor from lengths[src_idx] and multiply it to lengths[dst_idx]
911912
size_t dst_idx = random_perm[(i + 1) % random_perm.size()];
912913
const std::vector<int>& factors = policy->split_memo.GetFactors(length);
913914
CHECK_GE(factors.size(), 1);
@@ -942,6 +943,8 @@ PopulationGenerationRule::ResultKind MutateTileSize::Apply(SketchPolicyNode* pol
942943
}
943944
}
944945

946+
CHECK_LE(GetIntImm(new_lengths.back()), max_innermost_split_factor);
947+
945948
StateNode* pstate = state->CopyOnWrite();
946949
pstate->transform_steps.Set(
947950
step_id, SplitStep(ps->stage_id, ps->iter_id, ps->extent,
@@ -1006,7 +1009,7 @@ PopulationGenerationRule::ResultKind MutateComputeLocation::Apply(SketchPolicyNo
10061009
}
10071010
}
10081011
if (compute_at_steps.empty()) {
1009-
return PopulationGenerationRule::ResultKind::kValid;
1012+
return PopulationGenerationRule::ResultKind::kInvalid;
10101013
}
10111014

10121015
// Randomly pick one step

0 commit comments

Comments
 (0)