Skip to content

Commit 42d8bfe

Browse files
committed
The best found configuration is now added to the envs dictionary returned from tune_kernel
1 parent fe52050 commit 42d8bfe

File tree

1 file changed

+7
-5
lines changed

1 file changed

+7
-5
lines changed

kernel_tuner/interface.py

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -677,14 +677,16 @@ def tune_kernel(
677677
env = runner.get_environment(tuning_options)
678678

679679
# finished iterating over search space
680-
if not device_options.quiet:
681-
if results: # checks if results is not empty
682-
best_config = util.get_best_config(results, objective, objective_higher_is_better)
680+
if results: # checks if results is not empty
681+
best_config = util.get_best_config(results, objective, objective_higher_is_better)
682+
# add the best configuration to env
683+
env['best_config'] = best_config
684+
if not device_options.quiet:
683685
units = getattr(runner, "units", None)
684686
print("best performing configuration:")
685687
util.print_config_output(tune_params, best_config, device_options.quiet, metrics, units)
686-
else:
687-
print("no results to report")
688+
elif not device_options.quiet:
689+
print("no results to report")
688690

689691
if cache:
690692
util.close_cache(cache)

0 commit comments

Comments
 (0)