Skip to content

Enable VSCode Debugging with Breakpoints for flwr Apps #5321

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
hetparekh16 opened this issue May 1, 2025 · 2 comments
Open

Enable VSCode Debugging with Breakpoints for flwr Apps #5321

hetparekh16 opened this issue May 1, 2025 · 2 comments
Assignees

Comments

@hetparekh16
Copy link

hetparekh16 commented May 1, 2025

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 --debug flag to the flwr run CLI 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.py or client_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 --debug and attaching an IDE debugger like VSCode to step through the code.

Additional Context

No response

@WilliamLindskog
Copy link
Contributor

Hi @hetparekh16,

Thanks for bringing this to GitHub Issues. It is something we are aware of, and need to carefully consider how to move forward, will talk with the team about this and update you asap.

@hetparekh16
Copy link
Author

Hi @WilliamLindskog
Thank you for the update! Looking forward to hearing back.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants