Kathryn-cat commented on code in PR #11641:
URL: https://github.com/apache/tvm/pull/11641#discussion_r894176501


##########
src/meta_schedule/search_strategy/evolutionary_search.cc:
##########
@@ -719,9 +719,36 @@ class EvolutionarySearch : public SearchStrategy {
                                                     EvolutionarySearchNode);
 };
 
+Array<Schedule> EvolutionarySearchSampleInitPopulation(ObjectRef _self, int 
num) {
+  const EvolutionarySearchNode* self = _self.as<EvolutionarySearchNode>();
+  std::vector<Schedule> results = self->state_->SampleInitPopulation(num);
+  return Array<Schedule>(results.begin(), results.end());
+}
+
+Array<Schedule> EvolutionarySearchEvolveWithCostModel(ObjectRef _self, 
Array<Schedule> population,
+                                                      int num) {
+  Array<Schedule> result;
+  const EvolutionarySearchNode* self = _self.as<EvolutionarySearchNode>();
+  std::vector<Schedule> population_vec =
+      std::vector<Schedule>(population.begin(), population.end());
+  std::vector<Schedule> schs = 
self->state_->EvolveWithCostModel(population_vec, num);
+  for (Schedule sch : schs) {
+    IRModule mod = sch->mod();
+    size_t shash = StructuralHash()(mod);
+    if (!self->state_->measured_workloads_.Has(mod, shash)) {
+      result.push_back(sch);
+    }

Review Comment:
   Thanks for the valuable suggestion! Updated :)



-- 
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]

Reply via email to