Skip to content

[fix]fix dataloader: honor min_batch_size when device_mesh is None#229

Open
kevssim wants to merge 2 commits into
modelscope:mainfrom
kevssim:fix_last_step
Open

[fix]fix dataloader: honor min_batch_size when device_mesh is None#229
kevssim wants to merge 2 commits into
modelscope:mainfrom
kevssim:fix_last_step

Conversation

@kevssim

@kevssim kevssim commented Jun 18, 2026

Copy link
Copy Markdown
Collaborator

PR type

  • Bug Fix
  • New Feature
  • Document Updates
  • More Models or Datasets Support

PR information

DeviceMeshSampler / DeviceMeshIterableFetchermin_batch_size 检查嵌在 if device_mesh: 分支里,导致客户端 DataLoader(无 device_mesh)时 min_batch_size 完全失效,短尾 batch 仍会被 yield。

@gemini-code-assist gemini-code-assist Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Comment thread src/twinkle/dataloader/device_mesh_fetcher.py
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant