Skip to content

megatron grpo data_shuffle - #9310

Merged
hjh0119 merged 1 commit into
modelscope:mainfrom
hjh0119:mg-grpo-shuffle
May 11, 2026
Merged

hjh0119 merged 1 commit into
modelscope:mainfrom
hjh0119:mg-grpo-shuffle

Conversation

@hjh0119

@hjh0119 hjh0119 commented May 11, 2026

Copy link
Copy Markdown
Collaborator

fix #9199

@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 modifies the argument handling for Megatron GRPO by removing the restriction that required dataset_shuffle to be true. It introduces logic to synchronize train_dataloader_shuffle with the dataset_shuffle value. Feedback indicates that the current assignment could unintentionally overwrite user-specified values for train_dataloader_shuffle because of default values, and suggests using a logical AND to respect both configuration flags.

Comment on lines +309 to +310
if self.dataset_shuffle is not None:
self.train_dataloader_shuffle = self.dataset_shuffle

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.

high

The current implementation unconditionally overwrites train_dataloader_shuffle with dataset_shuffle. Since dataset_shuffle defaults to True in RLHFMegatronArgumentsMixin, this will override and ignore a user-specified --train_dataloader_shuffle false when rlhf_type is grpo.

To respect both configuration flags, it is safer to use a logical AND operation, ensuring that shuffling is disabled if either flag is set to False.

Suggested change
if self.dataset_shuffle is not None:
self.train_dataloader_shuffle = self.dataset_shuffle
if self.dataset_shuffle is not None:
self.train_dataloader_shuffle = self.train_dataloader_shuffle and self.dataset_shuffle

@hjh0119
hjh0119 merged commit 6af9614 into modelscope:main May 11, 2026
1 of 3 checks passed
@hjh0119
hjh0119 deleted the mg-grpo-shuffle branch May 11, 2026 11:43
Jintao-Huang pushed a commit that referenced this pull request May 17, 2026
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.

[BUG] dataset_shuffle=false is not supported for Megatron GRPO

2 participants