-
Notifications
You must be signed in to change notification settings - Fork 509
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
[EZ] Pass seed to data sampler. #2266
base: main
Are you sure you want to change the base?
Conversation
We currently hardcode zero. I assume this is not intentional.
🔗 Helpful Links🧪 See artifacts and rendered test results at hud.pytorch.org/pr/pytorch/torchtune/2266
Note: Links to docs will display an error until the docs builds have been completed. This comment was automatically generated by Dr. CI and updates every 15 minutes. |
Getting the seed from Tagging @andrewkho for thoughts on setting the seed in |
@RdoubleA I might be misunderstanding the code but I thought |
Ah my bad, you're right. It's returning the global seed not the local seed. In that case this should be ok |
@EugenHotaj actually we might need to do something like this to get the seed directly from the config and maintaining BC with existing configs: |
@RdoubleA done |
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #2266 +/- ##
===========================================
- Coverage 65.34% 23.97% -41.37%
===========================================
Files 358 358
Lines 21207 21207
===========================================
- Hits 13857 5084 -8773
- Misses 7350 16123 +8773 ☔ View full report in Codecov by Sentry. |
@RdoubleA I'm not sure what's happening with the
Doesn't seem like it would be related to these changes (or maybe surfacing some latent bug), but any idea what's going on? |
^ @RdoubleA any thoughts on the failure I mentioned above? |
@EugenHotaj Sorry I've been meaning to investigate this more. I do think it's related to changing the seed though, the failing test is using DCP's resume from checkpoint. DCP was only recently added, so my guess is it's not setting the seed correctly when resuming training. Will update here once I debug more. |
Hey @EugenHotaj I just took a look at this. Unfortunately haven't pinpointed the cause of the test failing (yet), but one other wrench for you: |
Quick update on the deadlock: I noticed it only occurs for the 8B model and not the 7B one, and for the 8B config we shard a couple extra layers by default. So by commenting out this line the test actually passes on your PR. I am not exactly sure why this sharding by itself is OK, but combining it with the seed is not. I've been digging around the DCP code a bit and found that by setting |
@ebsmothers thanks for taking a look!
Good point, will verify this -- my assumption was that this would return |
We currently hardcode zero. I assume this is not intentional.
Context
What is the purpose of this PR? Is it to
Please link to any issues this PR addresses.
Changelog
What are the changes made in this PR?
Test 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 tests
pytest tests -m integration_test
UX
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