Skip to content

Commit f6811ab

Browse files
committed
Added firefly to hyperparameter tuning, various minor improvements
1 parent 83df948 commit f6811ab

File tree

3 files changed

+11
-2
lines changed

3 files changed

+11
-2
lines changed

kernel_tuner/backends/hypertuner.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -77,7 +77,8 @@ def __init__(self, iterations, compiler_options=None):
7777
"experimental_groups_defaults": {
7878
"repeats": 25,
7979
"samples": self.iterations,
80-
"minimum_fraction_of_budget_valid": 0.01,
80+
"minimum_fraction_of_budget_valid": 0.1,
81+
"minimum_number_of_valid_search_iterations": 10,
8182
},
8283
"statistics_settings": {
8384
"cutoff_percentile": 0.95,

kernel_tuner/hyper.py

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -107,6 +107,14 @@ def put_if_not_present(target_dict, key, value):
107107
'c1': [1.0, 2.0, 3.0],
108108
'c2': [0.5, 1.0, 1.5]
109109
}
110+
elif strategy_to_tune.lower() == "firefly_algorithm":
111+
hyperparams = {
112+
'popsize': [10, 20, 30],
113+
'maxiter': [50, 100, 150],
114+
'B0': [0.5, 1.0, 1.5],
115+
'gamma': [0.1, 0.25, 0.5],
116+
'alpha': [0.1, 0.2, 0.3]
117+
}
110118
elif strategy_to_tune.lower() == "greedy_ils":
111119
hyperparams = {
112120
'neighbor': ['Hamming', 'adjacent'],

kernel_tuner/strategies/genetic_algorithm.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -189,7 +189,7 @@ def repair(self, dna):
189189
# if we have found valid neighboring configurations, select one at random
190190
if len(neighbors) > 0:
191191
new_dna = list(random.choice(neighbors))
192-
print(f"GA crossover resulted in invalid config {dna=}, repaired dna to {new_dna=}")
192+
# print(f"GA crossover resulted in invalid config {dna=}, repaired dna to {new_dna=}")
193193
return new_dna
194194

195195
return dna

0 commit comments

Comments
 (0)