Repository navigation
fix(streaming): count per-worker batches in dataloader length - #939
Merged
Merged
Conversation
hoobnn
requested review from
bhimrazy,
deependujha,
dhedey,
pwgardipee and
tchaton
as code owners
October 3, 2026 06:20
Co-authored-by: Codex <codex@openai.com> Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
hoobnn
force-pushed
the
bugfix/402_worker-batch-count
branch
from
October 3, 2026 06:21
8c0ca6b to
8f1727c
Compare
|
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #939 +/- ##
=====================================
Coverage 82% 82%
=====================================
Files 72 72
Lines 16432 16445 +13
=====================================
+ Hits 13491 13505 +14
+ Misses 2941 2940 -1 🚀 New features to boost your workflow:
|
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.
Before submitting
What does this PR do?
Fixes #402.
The original report (
shuffle=False) was resolved by #449, which aligns per-worker item counts tobatch_size. #876'sWindowShuffleassigns whole chunks to workers, so each worker can again end with its own partial batch andlen(StreamingDataLoader)undercounts. For example, 10 samples withchunk_size=5,batch_size=4and 2 workers yield 4 batches, butlen(loader)reports 3. Progress bars or loops that stop afterlen(loader)batches silently drop samples.For
StreamingDataset, compute the length from each worker's assigned intervals, counting its trailing partial batch unlessdrop_lastis set.CombinedStreamingDatasetandParallelStreamingDatasetare unchanged.Validation
Added a regression test over
num_workers(0, 2),drop_lastand shuffle mode (none, window) that compareslen(loader)with the batches actually yielded; it fails onmainforWindowShufflewith 2 workers and passes with this change.I used OpenAI Codex and Claude Code to investigate the issue, write the fix and tests, and run the checks. I reviewed the code and this description myself.
PR 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 🙃
Assisted by Claude Code