flower icon indicating copy to clipboard operation
flower copied to clipboard

feat(framework) Add client results strategy

Open drorasaf opened this issue 7 months ago • 2 comments

Issue

#2252

Description

This PR extends the capability to split the aggregation phase and the detection phase of malicious clients. It is important to note that the detection of the malicious users cannot be solely handled in the client manager logic as it relies its detection in the results coming back from the different clients to be able to detect the malicious behaviour.

Related issues/PRs

It can enable #4565

Proposal

Explanation

This PR opens the door to implementations like FLDetector and FedDefender and others that are focusing more on the detection process rather than the aggregation function. So far, the logic has been coupled in together.

Checklist

  • [x] Implement proposed change
  • [ ] Write tests
  • [ ] Update documentation
  • [ ] Make CI checks pass
  • [ ] Ping maintainers on Slack (channel #contributions)

Any other comments?

I am not sure what documentation I should change at this point as it is expected to continue to work as is out of the box, but allow advanced use cases to focus on the detection mechanism.

drorasaf avatar May 31 '25 14:05 drorasaf

@drorasaf Thanks for opening this PR! This looks great — it's a solid improvement. I walked through the implementation of your proposed client_results_strategy, and if I understand correctly, it preprocesses the results and failures before passing them to Strategy.aggregate_fit.

Instead of adding a new argument to the start_grid API, would you consider implementing this as a Strategy wrapper, similar to how it's done in the DP strategy? This would allow us to keep the start_grid signature unchanged. Since Flower has transitioned to a new paradigm based on ServerApp and ClientApp, modifying the start_grid API would have limited impact.

Thanks again for the excellent contribution!

panh99 avatar Jun 05 '25 09:06 panh99