From d0496250dfb585e791b4b6a50bbf25730d374e48 Mon Sep 17 00:00:00 2001 From: Bangtian Liu Date: Fri, 17 Jan 2025 12:43:15 -0500 Subject: [PATCH] [tuner] clean up the code. NFC. (#841) - Fix mypy warning issues. - remove unused parameter for benchmark function. - remove unused import. Signed-off-by: Bangtian Liu --- tuner/examples/simple/simple_tuner.py | 2 -- tuner/tuner/candidate_gen.py | 4 ++-- tuner/tuner/libtuner.py | 1 - tuner/tuner/libtuner_test.py | 1 - 4 files changed, 2 insertions(+), 6 deletions(-) diff --git a/tuner/examples/simple/simple_tuner.py b/tuner/examples/simple/simple_tuner.py index 9a8a88e76..979e069fd 100644 --- a/tuner/examples/simple/simple_tuner.py +++ b/tuner/examples/simple/simple_tuner.py @@ -126,7 +126,6 @@ def main(): simple_tuner.benchmark_flags = ["--input=1", "--benchmark_repetitions=3"] top_candidates = libtuner.benchmark( args, - path_config, compiled_candidates, candidate_trackers, simple_tuner, @@ -159,7 +158,6 @@ def main(): simple_tuner.benchmark_timeout = 60 top_model_candidates = libtuner.benchmark( args, - path_config, compiled_model_candidates, candidate_trackers, simple_tuner, diff --git a/tuner/tuner/candidate_gen.py b/tuner/tuner/candidate_gen.py index 852cef7d4..f0494c2e5 100644 --- a/tuner/tuner/candidate_gen.py +++ b/tuner/tuner/candidate_gen.py @@ -291,7 +291,7 @@ def strip_compilation_info(input_path: Path) -> str: return result.process_res.stdout -def main(): +def main() -> None: parser = argparse.ArgumentParser() parser.add_argument("input", help="Input mlir file", type=str) parser.add_argument( @@ -369,4 +369,4 @@ def main(): if __name__ == "__main__": - args = main() + main() diff --git a/tuner/tuner/libtuner.py b/tuner/tuner/libtuner.py index f0c619217..580e0d30e 100644 --- a/tuner/tuner/libtuner.py +++ b/tuner/tuner/libtuner.py @@ -892,7 +892,6 @@ def get_speedup(result: BenchmarkResult) -> float: def benchmark( args: argparse.Namespace, - path_config: PathConfig, compiled_candidates: list[int], candidate_trackers: list[CandidateTracker], tuning_client: TuningClient, diff --git a/tuner/tuner/libtuner_test.py b/tuner/tuner/libtuner_test.py index 11f80a323..f7e189637 100644 --- a/tuner/tuner/libtuner_test.py +++ b/tuner/tuner/libtuner_test.py @@ -6,7 +6,6 @@ import argparse import math -from subprocess import CompletedProcess from unittest.mock import call, patch, MagicMock from . import libtuner