:mod:`fedlab_core.server.topology` ================================== .. py:module:: fedlab_core.server.topology Module Contents --------------- Classes ~~~~~~~ .. autoapisummary:: fedlab_core.server.topology.EndTop fedlab_core.server.topology.ServerSyncTop .. class:: EndTop(server_handler, server_address, dist_backend) Bases: :class:`torch.multiprocessing.Process` Abstract class for server network topology If you want to define your own topology agreements, please subclass it. :param server_handler: Parameter server backend handler derived from :class:`ParameterServerHandler` :param server_address: Address of server in form of ``(SERVER_ADDR, SERVER_IP)`` :type server_address: tuple :param dist_backend: :attr:`backend` of ``torch.distributed``. Valid values include ``mpi``, ``gloo``, :type dist_backend: str or Backend :param and ``nccl``: .. method:: run(self) :abstractmethod: Process .. method:: activate_clients(self) :abstractmethod: Activate some of clients to join this FL round .. method:: listen_clients(self) :abstractmethod: Listen messages from clients .. class:: ServerSyncTop(server_handler, server_address, dist_backend='gloo', logger_path='server_top.txt', logger_name='ServerTop') Bases: :class:`fedlab_core.server.topology.EndTop` Synchronous communication class This is the top class in our framework which is mainly responsible for network communication of SERVER!. Synchronize with clients following agreements defined in :meth:`run`. :param server_handler: Subclass of :class:`ParameterServerHandler` :param server_address: Address of this server in form of ``(SERVER_ADDR, SERVER_IP)`` :type server_address: tuple :param dist_backend: :attr:`backend` of ``torch.distributed``. Valid values include ``mpi``, ``gloo``, :type dist_backend: str or Backend :param and ``nccl``. Default: ``"gloo"`` :param logger_path: path to the log file for this class. Default: ``"server_top.txt"`` :type logger_path: str, optional :param logger_name: class name to initialize logger. Default: ``"ServerTop"`` :type logger_name: str, optional :raises None: .. method:: run(self) Process .. method:: activate_clients(self) Activate some of clients to join this FL round .. method:: listen_clients(self) Listen messages from clients