[fix]fix dataloader: honor min_batch_size when device_mesh is None#229
[fix]fix dataloader: honor min_batch_size when device_mesh is None#229kevssim wants to merge 2 commits into
Conversation
There was a problem hiding this comment.
Code Review
This pull request refactors device_mesh_fetcher.py and device_mesh_sampler.py to enforce the minimum batch size check independently of the device_mesh configuration. However, the review feedback highlights a critical issue where min_batch_size is not passed during the instantiation of DeviceMeshIterableFetcher in dataloader.py, causing custom minimum batch sizes to be ignored for iterable datasets. It is recommended to explicitly pass this parameter during instantiation.
Important
The consumer version of Gemini Code Assist on GitHub is being sunset. Starting June 18, 2026, new organization installations will be blocked, and all code review activity will officially cease on July 17, 2026.
For more details on the timeline and next steps, please review the Help Documentation.
PR type
PR information
DeviceMeshSampler/DeviceMeshIterableFetcher把min_batch_size检查嵌在if device_mesh:分支里,导致客户端DataLoader(无device_mesh)时min_batch_size完全失效,短尾 batch 仍会被 yield。