Fix dynamo benchmark runner for torchbench skip sets (#118615)

Fix dynamo benchmark runner for torchbench skip sets, which introduced by PR #118032

This runner.py script is still used in the [Inductor CPU Performance Dashboard](https://github.com/pytorch/pytorch/issues/93531) regular test

Pull Request resolved: https://github.com/pytorch/pytorch/pull/118615
Approved by: https://github.com/jgong5, https://github.com/ysiraichi, https://github.com/ezyang
This commit is contained in:
chuanqiw 2024-02-06 02:06:54 +00:00 committed by PyTorch MergeBot
parent 9250965f8b
commit 074f2bb5ce

View file

@ -378,10 +378,17 @@ def get_skip_tests(suite, is_training: bool):
module = importlib.import_module(suite)
os.chdir(original_dir)
if hasattr(module, "SKIP"):
skip_tests.update(module.SKIP)
if is_training and hasattr(module, "SKIP_TRAIN"):
skip_tests.update(module.SKIP_TRAIN)
if suite == "torchbench":
skip_tests.update(module.TorchBenchmarkRunner().skip_models)
if is_training:
skip_tests.update(
module.TorchBenchmarkRunner().skip_not_suitable_for_training_models
)
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)