mirror of
https://github.com/deepspeedai/DeepSpeed.git
synced 2025-10-20 15:33:51 +08:00
Op_builder->is_compatible quite warning (#6093)
Set the default value of op_builder/xxx.py/is_compatible()/verbose to False for quite warning. Add verbose judgement before op_builder/xxx.py/is_compatible()/self.warning(...). Otherwise the verbose arg will not work. --------- Co-authored-by: Logan Adams <114770087+loadams@users.noreply.github.com>
This commit is contained in:
@ -296,7 +296,7 @@ class OpBuilder(ABC):
|
|||||||
'''
|
'''
|
||||||
return []
|
return []
|
||||||
|
|
||||||
def is_compatible(self, verbose=True):
|
def is_compatible(self, verbose=False):
|
||||||
'''
|
'''
|
||||||
Check if all non-python dependencies are satisfied to build this op
|
Check if all non-python dependencies are satisfied to build this op
|
||||||
'''
|
'''
|
||||||
@ -679,7 +679,7 @@ class CUDAOpBuilder(OpBuilder):
|
|||||||
version_ge_1_5 = ['-DVERSION_GE_1_5']
|
version_ge_1_5 = ['-DVERSION_GE_1_5']
|
||||||
return version_ge_1_1 + version_ge_1_3 + version_ge_1_5
|
return version_ge_1_1 + version_ge_1_3 + version_ge_1_5
|
||||||
|
|
||||||
def is_compatible(self, verbose=True):
|
def is_compatible(self, verbose=False):
|
||||||
return super().is_compatible(verbose)
|
return super().is_compatible(verbose)
|
||||||
|
|
||||||
def builder(self):
|
def builder(self):
|
||||||
|
@ -28,7 +28,7 @@ class CCLCommBuilder(CPUOpBuilder):
|
|||||||
def cxx_args(self):
|
def cxx_args(self):
|
||||||
return ['-O2', '-fopenmp']
|
return ['-O2', '-fopenmp']
|
||||||
|
|
||||||
def is_compatible(self, verbose=True):
|
def is_compatible(self, verbose=False):
|
||||||
# TODO: add soft compatibility check for private binary release.
|
# TODO: add soft compatibility check for private binary release.
|
||||||
# a soft check, as in we know it can be trivially changed.
|
# a soft check, as in we know it can be trivially changed.
|
||||||
return super().is_compatible(verbose)
|
return super().is_compatible(verbose)
|
||||||
@ -65,7 +65,7 @@ class ShareMemCommBuilder(CPUOpBuilder):
|
|||||||
def cxx_args(self):
|
def cxx_args(self):
|
||||||
return ['-O2', '-fopenmp']
|
return ['-O2', '-fopenmp']
|
||||||
|
|
||||||
def is_compatible(self, verbose=True):
|
def is_compatible(self, verbose=False):
|
||||||
# TODO: add soft compatibility check for private binary release.
|
# TODO: add soft compatibility check for private binary release.
|
||||||
# a soft check, as in we know it can be trivially changed.
|
# a soft check, as in we know it can be trivially changed.
|
||||||
return super().is_compatible(verbose)
|
return super().is_compatible(verbose)
|
||||||
|
@ -19,7 +19,7 @@ class InferenceCoreBuilder(CUDAOpBuilder):
|
|||||||
def absolute_name(self):
|
def absolute_name(self):
|
||||||
return f'deepspeed.inference.v2.kernels{self.NAME}'
|
return f'deepspeed.inference.v2.kernels{self.NAME}'
|
||||||
|
|
||||||
def is_compatible(self, verbose=True):
|
def is_compatible(self, verbose=False):
|
||||||
try:
|
try:
|
||||||
import torch
|
import torch
|
||||||
except ImportError:
|
except ImportError:
|
||||||
|
@ -18,7 +18,7 @@ class InferenceCutlassBuilder(CUDAOpBuilder):
|
|||||||
def absolute_name(self):
|
def absolute_name(self):
|
||||||
return f'deepspeed.inference.v2.kernels.cutlass_ops.{self.NAME}'
|
return f'deepspeed.inference.v2.kernels.cutlass_ops.{self.NAME}'
|
||||||
|
|
||||||
def is_compatible(self, verbose=True):
|
def is_compatible(self, verbose=False):
|
||||||
try:
|
try:
|
||||||
import torch
|
import torch
|
||||||
except ImportError:
|
except ImportError:
|
||||||
|
@ -83,7 +83,7 @@ class AsyncIOBuilder(NPUOpBuilder):
|
|||||||
break
|
break
|
||||||
return found
|
return found
|
||||||
|
|
||||||
def is_compatible(self, verbose=True):
|
def is_compatible(self, verbose=False):
|
||||||
# Check for the existence of libaio by using distutils
|
# Check for the existence of libaio by using distutils
|
||||||
# to compile and link a test program that calls io_submit,
|
# to compile and link a test program that calls io_submit,
|
||||||
# which is a function provided by libaio that is used in the async_io op.
|
# which is a function provided by libaio that is used in the async_io op.
|
||||||
|
@ -19,7 +19,7 @@ class RaggedOpsBuilder(CUDAOpBuilder):
|
|||||||
def absolute_name(self):
|
def absolute_name(self):
|
||||||
return f'deepspeed.inference.v2.kernels.ragged_ops.{self.NAME}'
|
return f'deepspeed.inference.v2.kernels.ragged_ops.{self.NAME}'
|
||||||
|
|
||||||
def is_compatible(self, verbose=True):
|
def is_compatible(self, verbose=False):
|
||||||
try:
|
try:
|
||||||
import torch
|
import torch
|
||||||
except ImportError:
|
except ImportError:
|
||||||
|
@ -19,7 +19,7 @@ class RaggedUtilsBuilder(CUDAOpBuilder):
|
|||||||
def absolute_name(self):
|
def absolute_name(self):
|
||||||
return f'deepspeed.inference.v2.{self.NAME}'
|
return f'deepspeed.inference.v2.{self.NAME}'
|
||||||
|
|
||||||
def is_compatible(self, verbose=True):
|
def is_compatible(self, verbose=False):
|
||||||
try:
|
try:
|
||||||
import torch
|
import torch
|
||||||
except ImportError:
|
except ImportError:
|
||||||
|
@ -64,7 +64,6 @@ class SparseAttnBuilder(OpBuilder):
|
|||||||
if verbose:
|
if verbose:
|
||||||
self.warning(
|
self.warning(
|
||||||
f'{self.NAME} requires a torch version >= 1.5 and < 2.0 but detected {TORCH_MAJOR}.{TORCH_MINOR}')
|
f'{self.NAME} requires a torch version >= 1.5 and < 2.0 but detected {TORCH_MAJOR}.{TORCH_MINOR}')
|
||||||
|
|
||||||
try:
|
try:
|
||||||
import triton
|
import triton
|
||||||
except ImportError:
|
except ImportError:
|
||||||
|
@ -17,7 +17,7 @@ class SpatialInferenceBuilder(CUDAOpBuilder):
|
|||||||
def absolute_name(self):
|
def absolute_name(self):
|
||||||
return f'deepspeed.ops.spatial.{self.NAME}_op'
|
return f'deepspeed.ops.spatial.{self.NAME}_op'
|
||||||
|
|
||||||
def is_compatible(self, verbose=True):
|
def is_compatible(self, verbose=False):
|
||||||
try:
|
try:
|
||||||
import torch
|
import torch
|
||||||
except ImportError:
|
except ImportError:
|
||||||
|
@ -17,7 +17,7 @@ class InferenceBuilder(CUDAOpBuilder):
|
|||||||
def absolute_name(self):
|
def absolute_name(self):
|
||||||
return f'deepspeed.ops.transformer.inference.{self.NAME}_op'
|
return f'deepspeed.ops.transformer.inference.{self.NAME}_op'
|
||||||
|
|
||||||
def is_compatible(self, verbose=True):
|
def is_compatible(self, verbose=False):
|
||||||
try:
|
try:
|
||||||
import torch
|
import torch
|
||||||
except ImportError:
|
except ImportError:
|
||||||
|
@ -79,7 +79,7 @@ class AsyncIOBuilder(OpBuilder):
|
|||||||
break
|
break
|
||||||
return found
|
return found
|
||||||
|
|
||||||
def is_compatible(self, verbose=True):
|
def is_compatible(self, verbose=False):
|
||||||
# Check for the existence of libaio by using distutils
|
# Check for the existence of libaio by using distutils
|
||||||
# to compile and link a test program that calls io_submit,
|
# to compile and link a test program that calls io_submit,
|
||||||
# which is a function provided by libaio that is used in the async_io op.
|
# which is a function provided by libaio that is used in the async_io op.
|
||||||
|
Reference in New Issue
Block a user