summaryrefslogtreecommitdiff
path: root/scripts/compare-llama-bench.py
diff options
context:
space:
mode:
authorBrian <mofosyne@gmail.com>2024-05-08 18:54:39 +1000
committerGitHub <noreply@github.com>2024-05-08 10:54:39 +0200
commitacdce3cdef6fc2f0b7b5623231fd7762c0884d1c (patch)
tree9a50f01edbdd588447ff68a1c24c26fa2c62ee8d /scripts/compare-llama-bench.py
parent3855416027cb25d9a708ffa5581cf503a87856a6 (diff)
compare-llama-bench.py: add missing basicConfig (#7138)
* compare-llama-bench.py: add missing basicConfig * compare-llama-bench.py: Add line break between error message and print_help() * Add regular print() markdown table
Diffstat (limited to 'scripts/compare-llama-bench.py')
-rwxr-xr-xscripts/compare-llama-bench.py15
1 files changed, 9 insertions, 6 deletions
diff --git a/scripts/compare-llama-bench.py b/scripts/compare-llama-bench.py
index 3892fd25..fed3c1ee 100755
--- a/scripts/compare-llama-bench.py
+++ b/scripts/compare-llama-bench.py
@@ -93,11 +93,14 @@ help_s = (
"specified values are averaged WITHOUT weighing by the --repetitions parameter of llama-bench."
)
parser.add_argument("-s", "--show", help=help_s)
+parser.add_argument("--verbose", action="store_true", help="increase output verbosity")
known_args, unknown_args = parser.parse_known_args()
+logging.basicConfig(level=logging.DEBUG if known_args.verbose else logging.INFO)
+
if unknown_args:
- logger.error(f"Received unknown args: {unknown_args}.")
+ logger.error(f"Received unknown args: {unknown_args}.\n")
parser.print_help()
sys.exit(1)
@@ -110,7 +113,7 @@ if input_file is None:
input_file = sqlite_files[0]
if input_file is None:
- logger.error("Cannot find a suitable input file, please provide one.")
+ logger.error("Cannot find a suitable input file, please provide one.\n")
parser.print_help()
sys.exit(1)
@@ -202,12 +205,12 @@ elif repo is not None:
hexsha8_baseline = find_parent_in_data(repo.heads.master.commit)
if hexsha8_baseline is None:
- logger.error("No baseline was provided and did not find data for any master branch commits.")
+ logger.error("No baseline was provided and did not find data for any master branch commits.\n")
parser.print_help()
sys.exit(1)
else:
logger.error("No baseline was provided and the current working directory "
- "is not part of a git repository from which a baseline could be inferred.")
+ "is not part of a git repository from which a baseline could be inferred.\n")
parser.print_help()
sys.exit(1)
@@ -238,7 +241,7 @@ elif repo is not None:
break
if hexsha8_compare is None:
- logger.error("No compare target was provided and did not find data for any non-master commits.")
+ logger.error("No compare target was provided and did not find data for any non-master commits.\n")
parser.print_help()
sys.exit(1)
else:
@@ -361,7 +364,7 @@ if "gpu_info" in show:
headers = [PRETTY_NAMES[p] for p in show]
headers += ["Test", f"t/s {name_baseline}", f"t/s {name_compare}", "Speedup"]
-logger.info(tabulate(
+print(tabulate( # noqa: NP100
table,
headers=headers,
floatfmt=".2f",