MCPcopy Create free account
hub / github.com/deepspeedai/DeepSpeed / is_compatible

Method is_compatible

op_builder/inference_core_ops.py:22–45  ·  view source on GitHub ↗
(self, verbose=False)

Source from the content-addressed store, hash-verified

20 return f'deepspeed.inference.v2.kernels{self.NAME}'
21
22 def is_compatible(self, verbose=False):
23 try:
24 import torch
25 except ImportError:
26 if verbose:
27 self.warning("Please install torch if trying to pre-compile inference kernels")
28 return False
29
30 cuda_okay = True
31 if not os.environ.get("DS_IGNORE_CUDA_DETECTION"):
32 if not self.is_rocm_pytorch() and torch.cuda.is_available(): #ignore-cuda
33 sys_cuda_major, _ = installed_cuda_version()
34 torch_cuda_major = int(torch.version.cuda.split('.')[0])
35 cuda_capability = self.cuda_capability_major()
36 if cuda_capability is not None and cuda_capability < 6:
37 if verbose:
38 self.warning("NVIDIA Inference is only supported on Pascal and newer architectures")
39 cuda_okay = False
40 if cuda_capability is not None and cuda_capability >= 8:
41 if torch_cuda_major < 11 or sys_cuda_major < 11:
42 if verbose:
43 self.warning("On Ampere and higher architectures please use CUDA 11+")
44 cuda_okay = False
45 return super().is_compatible(verbose) and cuda_okay
46
47 def filter_ccs(self, ccs):
48 ccs_retained = []

Callers

nothing calls this directly

Calls 6

installed_cuda_versionFunction · 0.85
warningMethod · 0.80
is_rocm_pytorchMethod · 0.80
cuda_capability_majorMethod · 0.80
getMethod · 0.45
is_availableMethod · 0.45

Tested by

no test coverage detected