Skip to content

Commit 371ef6e

Browse files
authored
[tuner] reduce log file size (#809)
This PR aims to the log size detailed in: #806 - Avoid printing the stdout and stderr of running the command - Reduce the precision of fp constants printed Signed-off-by: Bangtian Liu <[email protected]>
1 parent b920696 commit 371ef6e

File tree

2 files changed

+2
-7
lines changed

2 files changed

+2
-7
lines changed

tuner/tuner/candidate_gen.py

-5
Original file line numberDiff line numberDiff line change
@@ -237,11 +237,6 @@ def run_command(run_pack: RunPack) -> RunResult:
237237
text=True,
238238
timeout=timeout_seconds,
239239
)
240-
241-
if result.stdout:
242-
logging.debug(f"stdout: {result.stdout}")
243-
if result.stderr:
244-
logging.debug(f"stderr: {result.stderr}")
245240
except subprocess.TimeoutExpired as e:
246241
logging.warning(
247242
f"Command '{command_str}' timed out after {timeout_seconds} seconds."

tuner/tuner/libtuner.py

+2-2
Original file line numberDiff line numberDiff line change
@@ -803,7 +803,7 @@ def compile(
803803
compiled_candidates = [c for c in compiled_candidates if c is not None]
804804
success_rate = float(len(compiled_candidates)) / float(len(candidates))
805805
logging.info(
806-
f"Successfully compiled [{len(compiled_candidates)}] candidates. Success rate: {success_rate}"
806+
f"Successfully compiled [{len(compiled_candidates)}] candidates. Success rate: {success_rate:.2f}"
807807
)
808808

809809
# Remove duplicate vmfbs from the candidate list.
@@ -875,7 +875,7 @@ def get_speedup(result: BenchmarkResult) -> float:
875875
speedup = f"{round(get_speedup(r) * 100, 2)}% of baseline"
876876
else:
877877
speedup = "baseline unavailable"
878-
logging.info(f"Candidate {r.candidate_id} time: {r.time} ({speedup})")
878+
logging.info(f"Candidate {r.candidate_id} time: {r.time:.2f} ({speedup})")
879879
return best_results
880880

881881

0 commit comments

Comments
 (0)