MCPcopy
hub / github.com/deepspeedai/DeepSpeed / is_compatible

Method is_compatible

op_builder/supa/async_io.py:70–87  ·  view source on GitHub ↗
(self, verbose=False)

Source from the content-addressed store, hash-verified

68 return found
69
70 def is_compatible(self, verbose=False):
71 # Check for the existence of libaio by using distutils
72 # to compile and link a test program that calls io_submit,
73 # which is a function provided by libaio that is used in the async_io op.
74 # If needed, one can define -I and -L entries in CFLAGS and LDFLAGS
75 # respectively to specify the directories for libaio.h and libaio.so.
76 aio_compatible = self.has_function('io_pgetevents', ('aio', ))
77 if verbose and not aio_compatible:
78 self.warning(f"{self.NAME} requires the dev libaio .so object and headers but these were not found.")
79
80 # Check for the libaio package via known package managers
81 # to print suggestions on which package to install.
82 self.check_for_libaio_pkg()
83
84 self.warning(
85 "If libaio is already installed (perhaps from source), try setting the CFLAGS and LDFLAGS environment variables to where it can be found."
86 )
87 return super().is_compatible(verbose) and aio_compatible

Callers

nothing calls this directly

Calls 3

check_for_libaio_pkgMethod · 0.95
has_functionMethod · 0.80
warningMethod · 0.80

Tested by

no test coverage detected