From fb6827d503c762a964db0cc58019deaf2f9e9e98 Mon Sep 17 00:00:00 2001 From: Pritiks23 Date: Sun, 9 Aug 2026 22:15:18 +0000 Subject: [PATCH 1/2] Add dry-run option to benchmark runner --- bench/scripts/run_benchmarks.py | 24 +++++++++++++++++++----- 1 file changed, 19 insertions(+), 5 deletions(-) diff --git a/bench/scripts/run_benchmarks.py b/bench/scripts/run_benchmarks.py index 0e402bddb..9a9bb9a6b 100755 --- a/bench/scripts/run_benchmarks.py +++ b/bench/scripts/run_benchmarks.py @@ -373,13 +373,20 @@ def find_default_build_dir(): # Per-profile orchestration. # --------------------------------------------------------------------------- -def run_profile(name, profile, build_dir, out_dir, extra_args): +def run_profile(name, profile, build_dir, out_dir, extra_args, dry_run): exe = _resolve_exe(build_dir, profile["exe_stems"]) + if exe is None: - print(f"[{name}] could not find any of {profile['exe_stems']} under {build_dir}/bench/", - file=sys.stderr) - return False + if not dry_run: + print( + + f"[{name}] could not find any of {profile['exe_stems']} " + f"under {build_dir}/bench/", + file=sys.stderr, + ) + return False + exe = build_dir / "bench" / profile["exe_stems"][0] json_path = out_dir / f"{name}.json" md_path = out_dir / f"{name}.md" csv_path = out_dir / f"{name}.csv" @@ -395,6 +402,8 @@ def run_profile(name, profile, build_dir, out_dir, extra_args): cmd += extra_args timeout = profile.get("timeout_seconds", DEFAULT_TIMEOUT_SECONDS) print(f"[{name}] {' '.join(cmd)} (timeout {timeout}s)") + if dry_run: + return True try: res = subprocess.run(cmd, timeout=timeout) except subprocess.TimeoutExpired: @@ -433,6 +442,11 @@ def main(): "--out-dir", type=Path, default=Path("bench_results"), help="Directory for nvbench JSON/MD/CSV output (default: ./bench_results).", ) + parser.add_argument( + "--dry-run", + action="store_true", + help="Print benchmark commands without executing them.", + ) parser.add_argument( "nvbench_args", nargs=argparse.REMAINDER, help="Extra args forwarded verbatim to the nvbench executable. " @@ -447,7 +461,7 @@ def main(): profiles = sorted(PROFILES) if args.profile == "all" else [args.profile] failures = 0 for name in profiles: - ok = run_profile(name, PROFILES[name], build_dir, args.out_dir, extra) + ok = run_profile(name, PROFILES[name], build_dir, args.out_dir, extra, args.dry_run,) if not ok: failures += 1 From 02e001d9b08adbfd5e0eeeac56c1d87e3d0dd142 Mon Sep 17 00:00:00 2001 From: Pritika Vipin <65793273+Pritiks23@users.noreply.github.com> Date: Mon, 10 Aug 2026 08:29:35 -0700 Subject: [PATCH 2/2] Fix formatting in error message for missing executables Remove unnecessary line break in error message. --- bench/scripts/run_benchmarks.py | 1 - 1 file changed, 1 deletion(-) diff --git a/bench/scripts/run_benchmarks.py b/bench/scripts/run_benchmarks.py index 9a9bb9a6b..c988c701c 100755 --- a/bench/scripts/run_benchmarks.py +++ b/bench/scripts/run_benchmarks.py @@ -379,7 +379,6 @@ def run_profile(name, profile, build_dir, out_dir, extra_args, dry_run): if exe is None: if not dry_run: print( - f"[{name}] could not find any of {profile['exe_stems']} " f"under {build_dir}/bench/", file=sys.stderr,