Skip to content

Commit 0155a9b

Browse files
committed
Fix Evoformer compilation when no GPU is present
- this is taken care correctly and more generally by builder.compute_capability_args - allow for cross-compilation in systems without GPU (see e.g., #5308) Signed-off-by: Santi Villalba <[email protected]>
1 parent 311674f commit 0155a9b

File tree

1 file changed

+0
-12
lines changed

1 file changed

+0
-12
lines changed

op_builder/evoformer_attn.py

Lines changed: 0 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -29,18 +29,6 @@ def sources(self):
2929
src_dir = 'csrc/deepspeed4science/evoformer_attn'
3030
return [f'{src_dir}/attention.cpp', f'{src_dir}/attention_back.cu', f'{src_dir}/attention_cu.cu']
3131

32-
def nvcc_args(self):
33-
args = super().nvcc_args()
34-
try:
35-
import torch
36-
except ImportError:
37-
self.warning("Please install torch if trying to pre-compile kernels")
38-
return args
39-
major = torch.cuda.get_device_properties(0).major #ignore-cuda
40-
minor = torch.cuda.get_device_properties(0).minor #ignore-cuda
41-
args.append(f"-DGPU_ARCH={major}{minor}")
42-
return args
43-
4432
def is_compatible(self, verbose=False):
4533
try:
4634
import torch

0 commit comments

Comments
 (0)