Fix dynamo benchmark skip logic for cpu device (#135193)

Fixes #132380, adjust torchbench and huggingface skip models list, then we can remove `--no-skip` when running benchmarks on 3 suites.

Pull Request resolved: https://github.com/pytorch/pytorch/pull/135193
Approved by: https://github.com/chuanqi129, https://github.com/jansel
This commit is contained in:
zengxian
2024-09-10 03:02:19 +00:00
committed by PyTorch MergeBot
parent 146921007a
commit 7ec17b49cf
19 changed files with 174 additions and 18 deletions

View File

@ -387,11 +387,6 @@ def get_skip_tests(suite, device, is_training: bool):
skip_tests.update(module.TorchBenchmarkRunner().skip_models_for_cpu)
elif device == "cuda":
skip_tests.update(module.TorchBenchmarkRunner().skip_models_for_cuda)
else:
if hasattr(module, "SKIP"):
skip_tests.update(module.SKIP)
if is_training and hasattr(module, "SKIP_TRAIN"):
skip_tests.update(module.SKIP_TRAIN)
skip_tests = (f"-x {name}" for name in skip_tests)
skip_str = " ".join(skip_tests)
@ -438,7 +433,7 @@ def generate_commands(args, dtypes, suites, devices, compilers, output_dir):
if args.enable_cpu_launcher:
launcher_cmd = f"python -m torch.backends.xeon.run_cpu {args.cpu_launcher_args}"
cmd = f"{launcher_cmd} benchmarks/dynamo/{suite}.py --{testing} --{dtype} -d{device} --output={output_filename}"
cmd = f"{cmd} {base_cmd} {args.extra_args} --no-skip --dashboard"
cmd = f"{cmd} {base_cmd} {args.extra_args} --dashboard"
skip_tests_str = get_skip_tests(suite, device, args.training)
cmd = f"{cmd} {skip_tests_str}"