-
Notifications
You must be signed in to change notification settings - Fork 683
Add support for StatefulDataLoader
#2410
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 support for StatefulDataLoader
#2410
Conversation
🔗 Helpful Links🧪 See artifacts and rendered test results at hud.pytorch.org/pr/pytorch/torchtune/2410
Note: Links to docs will display an error until the docs builds have been completed. ✅ No FailuresAs of commit c7decd7 with merge base 952078e ( This comment was automatically generated by Dr. CI and updates every 15 minutes. |
22e007c to
fe0380d
Compare
| batch_size=cfg.batch_size, | ||
| collate_fn=collate_name, | ||
| dataloader_state_dict=( | ||
| ckpt_dict[training.DATALOADER_KEY] |
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.
should check if this key even exists for BC
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.
This might just have to break BC b/c without this, the user will not be able to successfully resume training at any point.
| num_replicas=1, | ||
| rank=0, | ||
| shuffle=shuffle, | ||
| seed=0, |
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.
so how is seed passed to StatefulDataLoader in this case?
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #2410 +/- ##
===========================================
- Coverage 63.87% 23.16% -40.72%
===========================================
Files 368 379 +11
Lines 21873 22706 +833
===========================================
- Hits 13971 5259 -8712
- Misses 7902 17447 +9545 ☔ View full report in Codecov by Sentry. |
Context
What is the purpose of this PR? Is it to
This PR adds support for the
StatefulDataLoaderclass from the PyTorch library torchdata.FAQs
StatefulDataLoadercreates a batched random sampler of it's own so there's no need for us to be creating a new one in this context. Less code means my life is easier.Changelog
What are the changes made in this PR?
StatefulDataloaderand replace it's usage in the_setup_datamethodTest plan
Please make sure to do each of the following if applicable to your PR. If you're unsure about any one of these just ask and we will happily help. We also have a contributing page for some guidance on contributing.
pre-commit install)pytest testspytest tests -m integration_testUX
If your function changed a public API, please add a dummy example of what the user experience will look like when calling it.
Here is a docstring example
and a tutorial example