INNER CODE UNIT · Python

__init__

bytedance/byteps · byteps/common/__init__.py:55

    def __init__(self, pkg_path, *args):
        full_path = get_extension_full_path(pkg_path, *args)
        self.C_LIB_CTYPES = ctypes.CDLL(full_path, mode=ctypes.RTLD_GLOBAL)

    def init(self, lazy=True):
        """A function that inits BytePS."""
        atexit.register(self.shutdown)
        if lazy:
            return self.C_LIB_CTYPES.byteps_lazy_init()
        else:
            return self.C_LIB_CTYPES.byteps_init()

    def shutdown(self):
        """A function that shuts BytePS down."""
        return self.C_LIB_CTYPES.byteps_shutdown()

    def suspend(self):
        """A function that suspends BytePS for elastic training."""

View source record →

📰 Research Paper
Loading…
⏳ Fetching content…