Skip to content

Commit

Permalink
[Tuner] Fix handling of compilation failures (#807)
Browse files Browse the repository at this point in the history
Also misc fixes for logging
  • Loading branch information
kuhar authored Jan 9, 2025
1 parent 64359b4 commit 45322d4
Showing 1 changed file with 9 additions and 3 deletions.
12 changes: 9 additions & 3 deletions tuner/tuner/libtuner.py
Original file line number Diff line number Diff line change
Expand Up @@ -466,7 +466,11 @@ def run_iree_compile_command(compile_pack: CompilePack) -> Optional[int]:
timeout_seconds=compile_pack.iree_compile_timeout,
)
)
if result.process_res is None or result.is_timeout:

# We need to check if the output vmfb exists as iree-compile returns a success
# status code when crash reproducers are dumped.
output_vmfb_exists = candidate_tracker.compiled_vmfb_path.is_file()
if result.process_res is None or result.is_timeout or not output_vmfb_exists:
return None
return candidate_tracker.candidate_id

Expand Down Expand Up @@ -520,7 +524,7 @@ def run_iree_benchmark_module_command(benchmark_pack: BenchmarkPack):
**extra_flags,
)
except ireert.benchmark.BenchmarkTimeoutError as e:
logging.warning(
logging.info(
f"Benchmark of candidate {candidate_id} timed out after {timeout} seconds."
)
return BenchmarkResult(
Expand Down Expand Up @@ -557,7 +561,9 @@ def run_iree_benchmark_module_command(benchmark_pack: BenchmarkPack):
)

mean_benchmark_time = sum(times) / float(len(times))
logging.debug(f"Benchmark time of candidate {candidate_id}: {mean_benchmark_time}")
logging.debug(
f"Benchmark time of candidate {candidate_id}: {mean_benchmark_time:.2f}"
)
return BenchmarkResult(
candidate_id=candidate_id,
time=mean_benchmark_time,
Expand Down

0 comments on commit 45322d4

Please sign in to comment.