Repository navigation
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What does this PR do?
Keep each sampled item intact when
DistributedSamplerWrapperassigns zero or one item to a worker. For example:itemgetterreturns the item itself for one index, so a single batch becomes individual indices and the data loader raisesTypeError: 'int' object is not iterable. A scalar sampler also raises, and an empty assignment callsitemgetterwithout arguments. Yielding one item per assigned index handles all three cases and preserves the existing multi-item behavior.Added a runnable doctest and eight regression cases for scalar/batch samplers, padding, empty inputs and
drop_last. Six cases fail before the change. Sampler, dataloader and batching tests plus sampler doctests: 24 passed, one CUDA-only test skipped.pre-commit run -apasses.Also exercised
Brain.fitwith aDynamicBatchSamplerin two actual CPU/Gloo processes, using the shipped CTC example's data pipeline and eight speech recordings (18.96 seconds). With one four-utterance batch per worker, the baseline fails before the first update. The fix completes four updates per worker; losses, all 10 model-state tensors and all 27 optimizer tensors exactly match a control using explicitly assigned batches. This uses a recurrent-only GRU encoder to run DDP on CPU; it does not claim GPU or convergence validation.No new dependencies or API changes.
Before submitting
PR review
Reviewer checklist