|
108 | 108 | current_onnx_compiler = ""
|
109 | 109 | current_batch_size = None
|
110 | 110 | output_filename = None
|
| 111 | +disable_output = False |
111 | 112 |
|
112 | 113 | MAX_DOWNLOAD_ATTEMPTS = 5
|
113 | 114 |
|
@@ -306,6 +307,9 @@ def load_model_from_path(path_and_class_str):
|
306 | 307 |
|
307 | 308 |
|
308 | 309 | def output_csv(filename, headers, row):
|
| 310 | + global disable_output |
| 311 | + if disable_output: |
| 312 | + return |
309 | 313 | if os.path.exists(filename):
|
310 | 314 | with open(filename) as fd:
|
311 | 315 | lines = list(csv.reader(fd)) or [[]]
|
@@ -3212,6 +3216,11 @@ def get_example_inputs(self):
|
3212 | 3216 | "--output-directory",
|
3213 | 3217 | help="Overrides the directory to place output files.",
|
3214 | 3218 | )
|
| 3219 | + parser.add_argument( |
| 3220 | + "--disable-output", |
| 3221 | + action="store_true", |
| 3222 | + help="Disable writing of output files, e.g., for warm-up runs", |
| 3223 | + ) |
3215 | 3224 | parser.add_argument(
|
3216 | 3225 | "--baseline",
|
3217 | 3226 | help="Compare with a prior --output",
|
@@ -3612,7 +3621,8 @@ def main(runner, original_dir=None, args=None):
|
3612 | 3621 | cmd.remove("--warm-start-latency")
|
3613 | 3622 |
|
3614 | 3623 | print(f"Performing cold-start run for {args.only}")
|
3615 |
| - subprocess.check_call(cmd + ["--repeat=1"], timeout=args.timeout, env=env) |
| 3624 | + warmup_cmd = cmd + ["--repeat=1", "--disable-output"] |
| 3625 | + subprocess.check_call(warmup_cmd, timeout=args.timeout, env=env) |
3616 | 3626 |
|
3617 | 3627 | print(f"Performing warm-start run for {args.only}")
|
3618 | 3628 | subprocess.check_call(cmd, timeout=args.timeout, env=env)
|
@@ -3821,9 +3831,12 @@ def run(runner, args, original_dir=None):
|
3821 | 3831 | runner.skip_models.clear()
|
3822 | 3832 |
|
3823 | 3833 | experiment = null_experiment
|
3824 |
| - global current_name, current_device, current_batch_size, output_filename, optimize_ctx, current_onnx_compiler |
| 3834 | + global current_name, current_device, current_batch_size, output_filename, disable_output, optimize_ctx, current_onnx_compiler |
3825 | 3835 | optimize_ctx = contextlib.nullcontext()
|
3826 | 3836 |
|
| 3837 | + if args.disable_output: |
| 3838 | + disable_output = True |
| 3839 | + |
3827 | 3840 | if args.overhead:
|
3828 | 3841 | optimize_ctx = torch._dynamo.optimize(dummy_fx_compile, nopython=args.nopython)
|
3829 | 3842 | experiment = speedup_experiment
|
|
0 commit comments