Skip to content

Commit 138b765

Browse files
committed
Fix RuntimeError: parallel_for_dynamic
1 parent 2d964b4 commit 138b765

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-0
lines changed

src/meta_schedule/search_strategy/evolutionary_search.cc

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -592,6 +592,7 @@ std::vector<Schedule> EvolutionarySearchNode::State::EvolveWithCostModel(
592592
// Loop until success
593593
for (int fail_count = 0; fail_count <= self->genetic_max_fail_count; ++fail_count) {
594594
sampled_trace_id = trace_sampler();
595+
sampled_trace_id = sampled_trace_id % self->population_size;
595596
tir::Trace trace = population.at(sampled_trace_id)->trace().value();
596597
if (Optional<Mutator> opt_mutator = mutator_sampler()) {
597598
// Decision: mutate

0 commit comments

Comments
 (0)