INNER CODE UNIT · Python

shutdown

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

    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."""
        # set DMLC environment variables here
        os.environ['DMLC_NUM_WORKER'] = str(num_workers)
        os.environ['DMLC_NUM_SERVER'] = str(num_servers)
        os.environ['BYTEPS_GLOBAL_RANK'] = str(global_rank)
        return self.C_LIB_CTYPES.byteps_resume(num_workers, num_servers)

    def size(self):
        """A function that returns the number of BytePS processes.

View source record →

📰 Research Paper
Loading…
⏳ Fetching content…