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

Method is_compatible

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

Source from the content-addressed store, hash-verified

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