Repository navigation
megatron grpo data_shuffle - #9310
Conversation
There was a problem hiding this comment.
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.
| if self.dataset_shuffle is not None: | ||
| self.train_dataloader_shuffle = self.dataset_shuffle |
There was a problem hiding this comment.
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.
| 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 |
fix #9199