From 324a4e58b6b0365d16dcf8f93739be8f74cd7d37 Mon Sep 17 00:00:00 2001 From: Ross Wightman Date: Wed, 13 Jul 2022 10:34:34 -0700 Subject: [PATCH] disable nvfuser for jit te/legacy modes (for PT 1.12+) --- timm/utils/jit.py | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/timm/utils/jit.py b/timm/utils/jit.py index a32cbd40..d527411f 100644 --- a/timm/utils/jit.py +++ b/timm/utils/jit.py @@ -28,11 +28,19 @@ def set_jit_fuser(fuser): torch._C._jit_override_can_fuse_on_cpu(False) torch._C._jit_override_can_fuse_on_gpu(True) torch._C._jit_set_texpr_fuser_enabled(True) + try: + torch._C._jit_set_nvfuser_enabled(False) + except Exception: + pass elif fuser == "old" or fuser == "legacy": torch._C._jit_set_profiling_executor(False) torch._C._jit_set_profiling_mode(False) torch._C._jit_override_can_fuse_on_gpu(True) torch._C._jit_set_texpr_fuser_enabled(False) + try: + torch._C._jit_set_nvfuser_enabled(False) + except Exception: + pass elif fuser == "nvfuser" or fuser == "nvf": os.environ['PYTORCH_NVFUSER_DISABLE_FALLBACK'] = '1' #os.environ['PYTORCH_NVFUSER_DISABLE_FMA'] = '1'