-
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
Use callable object for patching dataloaders #971
Use callable object for patching dataloaders #971
Conversation
Do we need tests for this? |
Getting a very unhelpful error, will keep investigating
|
Update: now if you pass your dataloaders to
Not sure what a change of this level warrants in terms of testing and documentation for pl. Please let me know! I added a gpu-ddp test for passing all the loaders to fit() and confirmed that this branch allows the test to pass |
this is awesome! will pr review in a few hours! |
i think ddp in colab needs the spawn flag or something |
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, just curious if simple functools
would help too which does very similar wrapping
from functools import partial
dataloader = partial(dataloader)
|
Co-Authored-By: Jirka Borovec <Borda@users.noreply.github.com>
Co-Authored-By: Jirka Borovec <Borda@users.noreply.github.com>
* Use callable object for patching dataloaders * Add test for ddp with dataloaders passed to fit() * Update pytorch_lightning/trainer/trainer.py Co-Authored-By: Jirka Borovec <Borda@users.noreply.github.com> * Update pytorch_lightning/trainer/trainer.py Co-Authored-By: Jirka Borovec <Borda@users.noreply.github.com> Co-authored-by: Jirka Borovec <Borda@users.noreply.github.com>
* Update README.md * Update README.md * Use callable object for patching dataloaders (#971) * Use callable object for patching dataloaders * Add test for ddp with dataloaders passed to fit() * Update pytorch_lightning/trainer/trainer.py Co-Authored-By: Jirka Borovec <Borda@users.noreply.github.com> * Update pytorch_lightning/trainer/trainer.py Co-Authored-By: Jirka Borovec <Borda@users.noreply.github.com> Co-authored-by: Jirka Borovec <Borda@users.noreply.github.com> * merge load functions * update tests * fix documentation warnings * fix line too long * fix line too long * print deprecation warning Co-Authored-By: Jirka Borovec <Borda@users.noreply.github.com> * move tags_csv argument to end of signature * fix typo, update version numbers * fix line too long * add typing as requested * update changelog Co-authored-by: William Falcon <waf2107@columbia.edu> Co-authored-by: Sho Arora <sho854@gmail.com> Co-authored-by: Jirka Borovec <Borda@users.noreply.github.com>
* Use callable object for patching dataloaders * Add test for ddp with dataloaders passed to fit() * Update pytorch_lightning/trainer/trainer.py Co-Authored-By: Jirka Borovec <Borda@users.noreply.github.com> * Update pytorch_lightning/trainer/trainer.py Co-Authored-By: Jirka Borovec <Borda@users.noreply.github.com> Co-authored-by: Jirka Borovec <Borda@users.noreply.github.com>
* Update README.md * Update README.md * Use callable object for patching dataloaders (Lightning-AI#971) * Use callable object for patching dataloaders * Add test for ddp with dataloaders passed to fit() * Update pytorch_lightning/trainer/trainer.py Co-Authored-By: Jirka Borovec <Borda@users.noreply.github.com> * Update pytorch_lightning/trainer/trainer.py Co-Authored-By: Jirka Borovec <Borda@users.noreply.github.com> Co-authored-by: Jirka Borovec <Borda@users.noreply.github.com> * merge load functions * update tests * fix documentation warnings * fix line too long * fix line too long * print deprecation warning Co-Authored-By: Jirka Borovec <Borda@users.noreply.github.com> * move tags_csv argument to end of signature * fix typo, update version numbers * fix line too long * add typing as requested * update changelog Co-authored-by: William Falcon <waf2107@columbia.edu> Co-authored-by: Sho Arora <sho854@gmail.com> Co-authored-by: Jirka Borovec <Borda@users.noreply.github.com>
Before submitting
What does this PR do?
Fixes #968 .
Changes how we patch dataloaders when passed to
trainer.fit()
so that it's pickleablePR review
Anyone in the community is free to review the PR once the tests have passed.
If we didn't discuss your PR in Github issues there's a high chance it will not be merged.
Did you have fun?
Make sure you had fun coding 🙃