From e47635e2a96f846d22aa6fa5b2b4e459a6249e2d Mon Sep 17 00:00:00 2001 From: Alexander Grund Date: Thu, 10 Jun 2021 11:56:52 +0200 Subject: [PATCH] Import hipify_python only when needed Do this after the version check to avoid failures on import for earlier torch where that module did not exist. See #3901 --- setup.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/setup.py b/setup.py index 4cc3d0698a4..0b9a5d4ac11 100644 --- a/setup.py +++ b/setup.py @@ -11,7 +11,6 @@ import torch from torch.utils.cpp_extension import BuildExtension, CppExtension, CUDAExtension, CUDA_HOME -from torch.utils.hipify import hipify_python def read(*names, **kwargs): @@ -150,6 +149,7 @@ def get_extensions(): is_rocm_pytorch = True if ((torch.version.hip is not None) and (ROCM_HOME is not None)) else False if is_rocm_pytorch: + from torch.utils.hipify import hipify_python hipify_python.hipify( project_directory=this_dir, output_directory=this_dir,