-
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
Fix attribute error on _NotYetLoadedTensor
after loading checkpoint into quantized model with _lazy_load()
#20121
Conversation
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## master #20121 +/- ##
=======================================
Coverage 91% 91%
=======================================
Files 266 266
Lines 22976 22976
=======================================
+ Hits 20808 20810 +2
+ Misses 2168 2166 -2 |
_NotYetLoadedTensor
after loading checkpoint into quantized model with _lazy_load()
_NotYetLoadedTensor after loading checkpoint into quantized model with
_lazy_load()`
_NotYetLoadedTensor after loading checkpoint into quantized model with
_lazy_load()`_NotYetLoadedTensor
after loading checkpoint into quantized model with _lazy_load()
|
||
# Test with lazy load (LitGPT uses this) | ||
# TODO: Replace `_lazy_load` with `torch.load(..., mmap=True)` in LitGPT | ||
state_dict = _lazy_load(tmp_path / "checkpoint.pt") |
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.
how about using steps for these long tests?
https://smarie.github.io/python-pytest-steps/
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.
If you think it's a good idea let's open an issue? I prefer not to add the test dependency in this PR because it's a simple fix, so prefer to keep the PR minimal.
… into quantized model with `_lazy_load()` (Lightning-AI#20121)
What does this PR do?
Fixes #20119
📚 Documentation preview 📚: https://pytorch-lightning--20121.org.readthedocs.build/en/20121/
cc @carmocca @justusschock @awaelchli