-
Notifications
You must be signed in to change notification settings - Fork 3.6k
[App] Enable debugger with LightningApp #15590
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
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM 😃
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Great! Docstring change and a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't understand how this is supposed to work. I checked out the branch, set a breakpoint()
in the examples/app_boring
in one of the works, and it exited with an error.
Perhaps you only meant to add support for the debugger in the IDE. I verified that it works in PyCharm with the debugger, but the user will have to change their code from
app = L.LightningApp(BoringApp())
to
app = L.LightningApp(BoringApp())
MultiProcessRuntime(app).dispatch()
in order to run it as a regular python program without cli.
However, we never explain to the user that this is another way of launching an app locally. Using the runtime directly like that is only meant for our testing. We would need to introduce a simpler API here to do the same if we really want to support running it like that.
This is meant to work if you run your script with a debugger attached to it. This enables to debug very simply your app directly within the IDE. You don't need to change single line of code for it to work, this is the entire goal here.
This isn't what we are trying to enable. Just for users to run their app in their IDE without code modification and set breakpoints wherever they decide. |
…ightning into enable_debug_mode
(cherry picked from commit f06de83)
(cherry picked from commit f06de83)
Adds lightning==1.8.2 for the latest goodies. - Removes 'debug.py' now that debugging is supported (Lightning-AI/pytorch-lightning#15590)
What does this PR do?
This PR enables running an app within a debugger with breakpoints with flows and works without your changing code :)
fimal.mp4
Does your PR introduce any breaking changes? If yes, please list them.
Before submitting
PR review
Anyone in the community is welcome to review the PR.
Before you start reviewing, make sure you have read the review guidelines. In short, see the following bullet-list:
Did you have fun?
Make sure you had fun coding 🙃
cc @Borda