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

Method is_compatible

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

Source from the content-addressed store, hash-verified

94 return found
95
96 def is_compatible(self, verbose=False):
97 # Check for the existence of libaio by using distutils
98 # to compile and link a test program that calls io_submit,
99 # which is a function provided by libaio that is used in the async_io op.
100 # If needed, one can define -I and -L entries in CFLAGS and LDFLAGS
101 # respectively to specify the directories for libaio.h and libaio.so.
102 aio_compatible = self.has_function('io_submit', ('aio', ))
103 if verbose and not aio_compatible:
104 self.warning(f"{self.NAME} requires the dev libaio .so object and headers but these were not found.")
105
106 # Check for the libaio package via known package managers
107 # to print suggestions on which package to install.
108 self.check_for_libaio_pkg()
109
110 self.warning(
111 "If libaio is already installed (perhaps from source), try setting the CFLAGS and LDFLAGS environment variables to where it can be found."
112 )
113 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