Skip to content

Commit

Permalink
[tuner] clean up the code. NFC. (#841)
Browse files Browse the repository at this point in the history
- Fix mypy warning issues.
- remove unused parameter for benchmark function.
- remove unused import.

Signed-off-by: Bangtian Liu <liubangtian@gmail.com>
  • Loading branch information
bangtianliu authored Jan 17, 2025
1 parent 2bdf4cd commit d049625
Show file tree
Hide file tree
Showing 4 changed files with 2 additions and 6 deletions.
2 changes: 0 additions & 2 deletions tuner/examples/simple/simple_tuner.py
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down Expand Up @@ -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,
Expand Down
4 changes: 2 additions & 2 deletions tuner/tuner/candidate_gen.py
Original file line number Diff line number Diff line change
Expand Up @@ -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(
Expand Down Expand Up @@ -369,4 +369,4 @@ def main():


if __name__ == "__main__":
args = main()
main()
1 change: 0 additions & 1 deletion tuner/tuner/libtuner.py
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down
1 change: 0 additions & 1 deletion tuner/tuner/libtuner_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@

import argparse
import math
from subprocess import CompletedProcess
from unittest.mock import call, patch, MagicMock
from . import libtuner

Expand Down

0 comments on commit d049625

Please sign in to comment.