-
Hello, I'm looking for the code piece in NVFlare where the processing logic of a controller is defined. I'm trying to build my own controller, following the example of swarm_client_ctl.py. I saw classes and methods were defined inside the example py, but didn't find a "main" function. In the Programming Guide of Swarm Learning, I saw written description of the processing logic: "The workflow is started from the starting_client..." I wonder where these logics were implemented in the codes, as I need to modify them for my own controller. Thanks in advance! |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments 5 replies
-
Hi, great question! There isn't a "main" function in the swarm_client_ctl.py, as controllers (as well as other components) are all used within the running FLARE system. A main function would be called in the specific case of using our new ClientAPI to launch a subprocess, however the Swarm Learning example does not currently use this. For the processing logic "The workflow is started from the starting_client..." if you look at Since Swarm Learning uses a Client-Controlled Workflow rather than a Server-Controlled Workflow, the ServerSideController in this case is just managing the job lifecycle, and the Hope this helps! |
Beta Was this translation helpful? Give feedback.
2: Currently, in
InTimeAccumulateWeightedAggregrator
, theaccept()
function is used to obtain the results from the clients (swarm_client_ctl.py 149). Here you have the right idea of getting the model weights from the dxo. This current accept() function receives the shareable and extracts the dxo, however right now it stores the accepted dxo inself.dxo_aggregrators
. In your case you would want to store the dxo in a new data structure in the aggregator that can be accessed when you want to do the validation step.3: For where to execute the validate task, we would want to do this in the controller, not the aggregator (component), as controllers are responsible for sending tasks and receivi…