Repository navigation
test(python): exercise the fixed batch sampler in the distributed loader test - #11737
Merged
Xuanwo merged 1 commit intoDec 2, 2026
Conversation
…der test Problem The integration worker passes a row count and batch size to the dataset scan sampler, so it fails before checking any DataLoader batches. Solution Construct ShardedFixedBatchSampler, the index-batch iterator expected by the DataLoader and the existing assertions. Result The worker can compare each returned ID and check the total per rank.
Contributor
There was a problem hiding this comment.
✅ Gate recommendation: approve.
The fixed sampler matches the worker’s index-batch contract and restores its existing ID and per-rank count assertions. Local verification: 120 sampler tests passed, and the worker passed with one and two Gloo ranks. CUDA/NCCL was unavailable.
Xuanwo
approved these changes
Dec 2, 2026
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.
Problem
The distributed DataLoader test fails before it loads a batch because it constructs the dataset scan sampler with fixed index-batch arguments.
Solution
Use
ShardedFixedBatchSamplerin the test worker. The existing assertions compare the returned IDs with the sampler indices and check each rank's total.Result
All 121 sampler tests passed. The worker's assertions also passed with two Gloo ranks. CUDA/NCCL was unavailable on this host.
Fixes #11736