From 664381b29344bde030d219a8988f89e9f40254d3 Mon Sep 17 00:00:00 2001 From: Bin Bao Date: Wed, 8 Mar 2023 00:38:33 +0000 Subject: [PATCH] [CI] Avoid calling torch.use_deterministic_algorithms for some models (#96245) tests Pull Request resolved: https://github.com/pytorch/pytorch/pull/96245 Approved by: https://github.com/davidberard98 --- benchmarks/dynamo/common.py | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/benchmarks/dynamo/common.py b/benchmarks/dynamo/common.py index 31ce60b5e3c..58a4311e30d 100644 --- a/benchmarks/dynamo/common.py +++ b/benchmarks/dynamo/common.py @@ -1986,7 +1986,13 @@ def run(runner, args, original_dir=None): # TODO - Using train mode for timm_models. Move to train mode for HF and Torchbench as well. args.use_eval_mode = True inductor_config.fallback_random = True - torch.use_deterministic_algorithms(True) + if args.only is not None and args.only not in { + "pytorch_CycleGAN_and_pix2pix", + "pytorch_unet", + "Super_SloMo", + }: + # some of the models do not support use_deterministic_algorithms + torch.use_deterministic_algorithms(True) os.environ["CUBLAS_WORKSPACE_CONFIG"] = ":4096:8" torch.backends.cudnn.deterministic = True torch.backends.cudnn.allow_tf32 = False