-
Notifications
You must be signed in to change notification settings - Fork 161
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 MultiNodeWeightedSampler tests #1426
Conversation
🔗 Helpful Links🧪 See artifacts and rendered test results at hud.pytorch.org/pr/pytorch/data/1426
Note: Links to docs will display an error until the docs builds have been completed. ✅ No FailuresAs of commit 029221d with merge base daafee4 ( This comment was automatically generated by Dr. CI and updates every 15 minutes. |
@@ -86,13 +87,15 @@ def test_multi_node_weighted_batch_sampler_zero_weights( | |||
weights={f"ds{i}": 10 * i for i in range(self._num_datasets)}, | |||
) | |||
|
|||
def test_multi_node_weighted_sampler_first_exhausted(self) -> None: | |||
@parameterized.expand(range(10)) | |||
def test_multi_node_weighted_sampler_first_exhausted(self, seed) -> None: | |||
"""Test MultiNodeWeightedSampler with stop criteria FIRST_DATASET_EXHAUSTED""" | |||
mixer = self._setup_multi_node_weighted_sampler( |
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.
one tiny nit: can you make this node = self._setup_multi_node_weighted_sampler(
here as well as in other places we call _setup_multi_node_weighted_sampler, thanks!
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! Thanks for the fix!
Due to the stochastic nature of the MultiNodeWeightedSampler and the way StopIteration is called when multiple datasets are involved, some test results are dependent on the OS/seed. Trying to fix seed and change testing conditions with this PR.