Skip to content

Commit 5ad98c6

Browse files
masnesralfacebook-github-bot
authored andcommitted
Adjust number of repeats when using --warm-start-latency benchmark flag (#125917)
Summary: In --warm-start-latency mode, we can just perform the cache-warmup run once instead of whatever was provided with --repeat X-link: pytorch/pytorch#125917 Approved by: https://github.com/desertfire Reviewed By: huydhn Differential Revision: D57421485 Pulled By: masnesral fbshipit-source-id: 7fe944d0427495af99e4630127598fb5811d9f02
1 parent 43621bc commit 5ad98c6

File tree

1 file changed

+5
-4
lines changed

1 file changed

+5
-4
lines changed

userbenchmark/dynamo/dynamobench/common.py

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3391,6 +3391,7 @@ def get_example_inputs(self):
33913391
)
33923392
group_latency.add_argument(
33933393
"--warm-start-latency",
3394+
"--warm_start_latency",
33943395
action="store_true",
33953396
help="Run model(s) twice and preseve caches in between to enable a 'warm start' on the 2nd run",
33963397
)
@@ -3610,10 +3611,10 @@ def main(runner, original_dir=None, args=None):
36103611
cmd = [sys.executable] + sys.argv
36113612
cmd.remove("--warm-start-latency")
36123613

3613-
print(f"Executing cold-start run for {args.only}")
3614-
subprocess.check_call(cmd, timeout=args.timeout, env=env)
3614+
print(f"Performing cold-start run for {args.only}")
3615+
subprocess.check_call(cmd + ["--repeat=1"], timeout=args.timeout, env=env)
36153616

3616-
print(f"Executing warm-start run for {args.only}")
3617+
print(f"Performing warm-start run for {args.only}")
36173618
subprocess.check_call(cmd, timeout=args.timeout, env=env)
36183619
else:
36193620
# single process path just uses the main process
@@ -3666,7 +3667,7 @@ def run(runner, args, original_dir=None):
36663667
if args.ci:
36673668
if args.accuracy:
36683669
# Run fewer iterations when checking accuracy
3669-
args.repeat = 2
3670+
args.repeat = min(args.repeat, 2)
36703671

36713672
# Set translation validation on by default on CI accuracy runs.
36723673
torch.fx.experimental._config.translation_validation = True

0 commit comments

Comments
 (0)