Skip to content

Commit 5fbed44

Browse files
committed
improve error handling
1 parent 8fa6cc8 commit 5fbed44

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

helion/autotuner/base_search.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -393,11 +393,12 @@ def population_statistics(population: list[PopulationMember]) -> str:
393393
working = [x for x in population if not math.isinf(x.perf)]
394394
return (
395395
f"failed={len(population) - len(working)} "
396+
) + (
396397
f"min={working[0].perf:.4f} "
397398
f"mid={working[len(working) // 2].perf:.4f} "
398399
f"max={working[-1].perf:.4f} "
399400
f"best={population[0].config!s}"
400-
)
401+
) if len(working) > 0 else "all failed!"
401402
return (
402403
f"min={population[0].perf:.4f} "
403404
f"mid={population[len(population) // 2].perf:.4f} "

0 commit comments

Comments
 (0)