Skip to content

Commit 45322d4

Browse files
authored
[Tuner] Fix handling of compilation failures (#807)
Also misc fixes for logging
1 parent 64359b4 commit 45322d4

File tree

1 file changed

+9
-3
lines changed

1 file changed

+9
-3
lines changed

tuner/tuner/libtuner.py

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -466,7 +466,11 @@ def run_iree_compile_command(compile_pack: CompilePack) -> Optional[int]:
466466
timeout_seconds=compile_pack.iree_compile_timeout,
467467
)
468468
)
469-
if result.process_res is None or result.is_timeout:
469+
470+
# We need to check if the output vmfb exists as iree-compile returns a success
471+
# status code when crash reproducers are dumped.
472+
output_vmfb_exists = candidate_tracker.compiled_vmfb_path.is_file()
473+
if result.process_res is None or result.is_timeout or not output_vmfb_exists:
470474
return None
471475
return candidate_tracker.candidate_id
472476

@@ -520,7 +524,7 @@ def run_iree_benchmark_module_command(benchmark_pack: BenchmarkPack):
520524
**extra_flags,
521525
)
522526
except ireert.benchmark.BenchmarkTimeoutError as e:
523-
logging.warning(
527+
logging.info(
524528
f"Benchmark of candidate {candidate_id} timed out after {timeout} seconds."
525529
)
526530
return BenchmarkResult(
@@ -557,7 +561,9 @@ def run_iree_benchmark_module_command(benchmark_pack: BenchmarkPack):
557561
)
558562

559563
mean_benchmark_time = sum(times) / float(len(times))
560-
logging.debug(f"Benchmark time of candidate {candidate_id}: {mean_benchmark_time}")
564+
logging.debug(
565+
f"Benchmark time of candidate {candidate_id}: {mean_benchmark_time:.2f}"
566+
)
561567
return BenchmarkResult(
562568
candidate_id=candidate_id,
563569
time=mean_benchmark_time,

0 commit comments

Comments
 (0)