INNER CODE UNIT · Python
init
bytedance/byteps · byteps/common/__init__.py:59
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."""
return self.C_LIB_CTYPES.byteps_suspend()
def resume(self, num_workers, num_servers, global_rank, context=None):
"""A function that restarts BytePS after being suspended, for elastic training."""