flower icon indicating copy to clipboard operation
flower copied to clipboard

Add Client Metadata Transmission in gRPC Communication

Open kuchidareo opened this issue 1 year ago • 0 comments

Describe the type of feature and its functionality.

To enhance federated learning (FL) using gRPC communication, this feature will enable the transmission of client metadata to the ClientProxy, such as CPU and memory specifications. This addition will allow the client_manager to selectively choose clients based on device capability, enabling optimized FL strategies, including heterogeneous federated learning (heteroFL), by making better use of diverse device capacities.

Describe step by step what files and adjustments are you planning to include.

  1. Add a new attribute to the FlowerServiceStub.Join function (a grpc._StreamStreamMultiCallable class). This function has a metadata attribute in its call function. We will retrieve this data on the server side using the invocation_metadata function. The affected files will be:
  • client.grpc_client.connection.py
  • server.superlink.fleet.grpc_bidi.flower_service_servicer.py
  1. Modify the attributes of other transport types for compatibility with the API. This is mainly for consistency across transport methods. The affected file will be:
  • client.app.py
  1. Register the metadata to the GrpcClientProxy as a class attribute during initialization. This will allow the server to store and use client metadata effectively. The affected files will be:
  • server.superlink.fleet.grpc_bidi.flower_service_servicer.py
  • server.superlink.fleet.grpc_bidi.grpc_client_proxy.py
  1. Add documentation in the docstrings to explain the new metadata handling and how it integrates with the existing functionality.

Is there something else you want to add?

No response

kuchidareo avatar Oct 17 '24 15:10 kuchidareo