-
Notifications
You must be signed in to change notification settings - Fork 1.1k
Description
Type
Feature
Description
Currently, flwr apps are executed using the Flower CLI (flwr run), and due to the architecture, it is not possible to set breakpoints inside user-defined files (e.g., server_app.py or client_app.py) using the VSCode debugger. This makes it difficult to step through the code, inspect function calls, and understand the data flow without manually inserting pdb.set_trace() statements or relying on print/debug logs.
As a developer exploring and building on top of Flower, it would be extremely helpful to set breakpoints and debug using VSCode’s built-in tools. This would allow stepping through execution from initialization to training and aggregation phases, greatly enhancing understanding of the framework's inner workings.
Being able to inspect how strategy methods are called and how data is passed and transformed would improve development efficiency and help new contributors get up to speed quickly.
Planned Implementation
- Introduce a
--debugflag to theflwr runCLI command. - When this flag is provided, the Flower app should start in a way that enables Python debuggers (such as those in VSCode) to hit breakpoints set in user-defined files like
server_app.pyorclient_app.py. - The debug mode should remove the need to manually insert
pdb.set_trace()and support smooth integration with IDE debuggers. - Update the Flower documentation to include instructions for running
flwr run --debugand attaching an IDE debugger like VSCode to step through the code.
Additional Context
No response