[Task Runner API] [Flower Interoperability] Integrate changes for flower-app-pytorch workspace's custom Collaborator into core component #1598
Conversation
Signed-off-by: kta-intel <kevin.ta@intel.com>
Signed-off-by: kta-intel <kevin.ta@intel.com>
teoparvanov
left a comment
There was a problem hiding this comment.
A couple of thoughts from my first read-through:
… local_grpc_server to interop_server Signed-off-by: kta-intel <kevin.ta@intel.com>
Signed-off-by: kta-intel <kevin.ta@intel.com>
Signed-off-by: kta-intel <kevin.ta@intel.com>
Signed-off-by: kta-intel <kevin.ta@intel.com>
Signed-off-by: kta-intel <kevin.ta@intel.com>
Signed-off-by: kta-intel <kevin.ta@intel.com>
| function : start_client_adapter | ||
| kwargs : | ||
| local_server_port : 0 # local grpc server, 0 to dynamically allocate | ||
| interop_server_port : 0 # interop server port, 0 to dynamically allocate |
There was a problem hiding this comment.
Working on addressing making dynamic allocation of gRPC ports consistent across OpenFL in #1599
The issue with this particular case is that for a local simulation, we need the collaborators to have different ports but hashing the plan would result in the same port which will lead to binding issues. I'm considering adding a local_simulation flag where the Collaborator can dynamically allocate based on its common name during the _prepare_interop_server - or the Task Runner can also handle this which may be a cleaner delineation from the Collaborator
It's the actually same reason for this messy handling of the client_port too: https://github.com/securefederatedai/openfl/blob/develop/openfl-workspace/flower-app-pytorch/src/runner.py#L51
…wer-app-pytorch workspace's custom Collaborator into core component (securefederatedai#1598) * integrate flower collaborator into core collaborator Signed-off-by: kta-intel <kevin.ta@intel.com> * formatting Signed-off-by: kta-intel <kevin.ta@intel.com> * change task name interop -> prepare_for_interop, change references to local_grpc_server to interop_server Signed-off-by: kta-intel <kevin.ta@intel.com> * add prepare_interop_server as callback to run on_experiment_begin Signed-off-by: kta-intel <kevin.ta@intel.com> * fix typo Signed-off-by: kta-intel <kevin.ta@intel.com> * change to on_round_begin() Signed-off-by: kta-intel <kevin.ta@intel.com> * return empty dict Signed-off-by: kta-intel <kevin.ta@intel.com> * set self.prepare_interop_server() to run on experiment begin Signed-off-by: kta-intel <kevin.ta@intel.com> * remove self-explanatory comment, added another comment for clarity Signed-off-by: kta-intel <kevin.ta@intel.com> --------- Signed-off-by: kta-intel <kevin.ta@intel.com> Signed-off-by: Tayfun Ceylan <tayfun.ceylan>
Summary
Part 2/x of bringing flower-app-pytorch custom components back into core components
flower-app-pytorchworkspace's customAggregatorinto core component #1585openfl.component.Collaborator...
...
Type of Change (Mandatory)
Specify the type of change being made.
Description (Mandatory)
This PR:
src.collaborator.CollaboratorFlowerand pulls changes back intoopenfl.component.Collaboratorstart_client_adaptertointeropfor better generalizabilityprepare_interop_server()callback toCollaboratorin order to minimize changes needed indo_task(). Originally, there was a separate conditional that started a separate set of tasks specific to interopability, which made it harder to read. Instead, we now pass the module to import (src.grpc.connector.flower.interop_server) viaplan.tasksetting. This module is imported and initialized and sent to the Task Runner inkwargsat the beginning of the experimentflower.interop_serverarg is modified to accept a callable function (receive_message_from_interop(), which is defined inprepare_interop_server(). The reason for this change is that originally, we send the entire client to theinterop_server()and theinterop_server()calledself.client.send_message_to_server()directly. It better encapsulates the client and the collaborator for theinterop_server()to pass just the response to a callable function of theCollaboratorTesting
Manual testing in non-SGX and SGX