-
Notifications
You must be signed in to change notification settings - Fork 3.4k
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
Add AttributeDict container for Fabric #18943
Conversation
for more information, see https://pre-commit.ci
for more information, see https://pre-commit.ci
⚡ Required checks status: All passing 🟢Groups summary🟢 pytorch_lightning: Tests workflowThese checks are required after the changes to 🟢 pytorch_lightning: Azure GPU
These checks are required after the changes to 🟢 pytorch_lightning: Benchmarks
These checks are required after the changes to 🟢 fabric: Docs
These checks are required after the changes to 🟢 pytorch_lightning: Docs
These checks are required after the changes to 🟢 lightning_fabric: CPU workflowThese checks are required after the changes to 🟢 lightning_fabric: Azure GPU
These checks are required after the changes to 🟢 mypy
These checks are required after the changes to 🟢 installThese checks are required after the changes to Thank you for your contribution! 💜
|
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 think this pattern is not very Pythonic and can be confusing for users who are not super knowledgeable about Python: there's already been discussions around whether it's a good idea or not: https://lwn.net/Articles/818777
However, if we still want to suggest it, I would not call it State
which might sound like this is the state of Fabric, or the model, or something similar to new users.
I would be specific and call it AttributeDict as before, which is exactly what it is and has been around for at leat 13 years (https://code.activestate.com/recipes/576972-attrdict)
Co-authored-by: Carlos Mocholí <[email protected]>
Co-authored-by: Jirka Borovec <[email protected]>
for more information, see https://pre-commit.ci
Codecov Report
Additional details and impacted files@@ Coverage Diff @@
## master #18943 +/- ##
=========================================
- Coverage 76% 54% -22%
=========================================
Files 443 438 -5
Lines 36120 36030 -90
=========================================
- Hits 27303 19430 -7873
- Misses 8817 16600 +7783 |
What does this PR do?
Fixes #18515
Adds a convenience container to make training scripts stateful. An immediate application of this would be a script like the one in lit-gpt, where state gets defined here and accessed in several places.
📚 Documentation preview 📚: https://pytorch-lightning--18943.org.readthedocs.build/en/18943/
cc @Borda @justusschock @awaelchli @carmocca