What is the difference between flwr.server and flwr.serverapp?

Hello there! I am a student currently learning Flower for a research project, as I am planning on doing a Split Learning / SplitFed implementation using it. In this context, I am playing around with a few projects, learning the framework, and recently read through the section on the Strategy abstraction.

I realized that, to implement SplitFed, I will probably need to override the start method in the Strategy class (as I need a custom round communication loop). I went to look into the source code to see how the default implementation works, and found there are two modules: flwr.server and flwr.serverapp. Both seem to define the strategy base class, so what exactly is the difference between them? The documentation for the former seemed quite scant, but the Vertical FL project, which I was using as a study reference, seems to use it. Is serverapp a newer implementation?

1 Like

Hi @mcarmo, thanks for creating the post. And a very valid question!!

We introduced recently the set of strategies under flwr.serverapp. Those there, make use of the Message abstraction which brings far more versatility than the older datastructures (FitIns/Res, EvaluateIns/Res, etc) that were originally introduced in the very early version of Flower. The new strategies enable writing more sophisticated ClientApp and ServerApp functionality because they operate on Messages.

With the latest release of Flower (1.22.0) we migrated all existing strategies to the new Message-based abstraction and we therefore recommend only using those under flwr.serverapp. We also attempted to migrate all documentation and most examples – the vertical FL one you point to remains to be migrated :smirking_face:

I would recommend you to take a look at other examples and use them as reference. For example quickstart-pytorch. That being said, migrating the example to the new Message API is fairly simple, so if you are up to it, we’d very much welcome a PR :rocket:

1 Like

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.