Skip to content

Commit

Permalink
sort results for retrospective stop criterion check
Browse files Browse the repository at this point in the history
  • Loading branch information
MiloLurati committed Apr 29, 2024
1 parent af9bd5e commit d382f05
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion kernel_tuner/strategies/common.py
Original file line number Diff line number Diff line change
Expand Up @@ -134,6 +134,9 @@ def _get_legal_configs(self, configs):

def _evaluate_configs(self, configs):
results = self.runner.run(configs, self.tuning_options)
# sort based on timestamp, needed because of parallel tuning of populations and restrospective stop criterion check
if "timestamp" in results[0]:
results.sort(key=lambda x: x['timestamp'])

final_results = []
for result in results:
Expand All @@ -142,7 +145,7 @@ def _evaluate_configs(self, configs):
# append to tuning results
if x_int not in self.tuning_options.unique_results:
self.tuning_options.unique_results[x_int] = result
# check if max_fevals is reached or time limit is exceeded within the the results
# check restrospectively if max_fevals is reached or time limit is exceeded within the the results
util.check_stop_criterion(self.tuning_options)
final_results.append(result)

Expand Down

0 comments on commit d382f05

Please sign in to comment.