From d4e9bd972a0eb867a05d16a28af1734c3076c550 Mon Sep 17 00:00:00 2001 From: Logan Adams Date: Mon, 6 Nov 2023 15:00:13 -0800 Subject: [PATCH] Remove from CUDAOpBuilder --- op_builder/builder.py | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/op_builder/builder.py b/op_builder/builder.py index 59ff212a5de3..3b1730567eef 100644 --- a/op_builder/builder.py +++ b/op_builder/builder.py @@ -597,7 +597,12 @@ def is_compatible(self, verbose=True): return super().is_compatible(verbose) def builder(self): - self.build_for_cpu = not torch.cuda.is_available() + try: + if not self.is_rocm_pytorch(): + assert_no_cuda_mismatch(self.name) + self.build_for_cpu = False + except BaseException: + self.build_for_cpu = True if self.build_for_cpu: from torch.utils.cpp_extension import CppExtension as ExtensionBuilder