Skip to content

feat: support multiple dataloader for grpo#1698

Merged
yuki-97 merged 19 commits intomainfrom
yukih/multiple-dataloader
Feb 27, 2026
Merged

feat: support multiple dataloader for grpo#1698
yuki-97 merged 19 commits intomainfrom
yukih/multiple-dataloader

Conversation

@yuki-97
Copy link
Contributor

@yuki-97 yuki-97 commented Dec 24, 2025

Closes #1603.

Usage

uv run examples/run_grpo.py \
    --config examples/configs/grpo_multiple_datasets.yaml \
    grpo.num_prompts_per_step=32 \
    data.use_multiple_dataloader=true \
    data.num_prompts_per_dataloader=16 \
    data.custom_dataloader=examples.custom_dataloader.custom_dataloader.example_custom_dataloader

More details at https://github.com/NVIDIA-NeMo/RL/blob/yukih/multiple-dataloader/docs/guides/grpo.md#multiple-dataloaders.

Test Result

  1. num_prompts_per_dataloader=16 will get 16 prompts from each dataset in every step. The data distribution of the two train datasets will change comparing to using single dataloader, so the train reward curve will have some difference, this is expected.
      use_multiple_dataloader: true
      num_prompts_per_dataloader: 16
      custom_dataloader: examples.custom_dataloader.custom_dataloader.example_custom_dataloader
      train:
        - dataset_name: OpenMathInstruct-2
          split_validation_size: 0.05 # use 5% of the training data as validation data
          seed: ${grpo.seed} # seed for train/validation split when split_validation_size > 0
        - dataset_name: DeepScaler
      validation:
        - dataset_name: AIME2024
          repeat: 16
        - dataset_name: DAPOMathAIME2024
    image
  2. This test is using two same OpenMathInstruct-2 dataset, so the data distribution won't change and the train reward curve could match.
      use_multiple_dataloader: true
      num_prompts_per_dataloader: 16
      custom_dataloader: examples.custom_dataloader.custom_dataloader.example_custom_dataloader
      train:
        - dataset_name: OpenMathInstruct-2
        - dataset_name: ResponseDataset
          data_path: nvidia/OpenMathInstruct-2
          input_key: problem
          output_key: expected_answer
          split: train_1M
      validation:
        - dataset_name: AIME2024
          repeat: 16
        - dataset_name: DAPOMathAIME2024
    image

Summary by CodeRabbit

  • New Features

    • Added support for multiple dataloaders in GRPO training with customizable dataloader configuration.
    • Introduced configuration options: use_multiple_dataloader, num_prompts_per_dataloader, and custom_dataloader.
  • Documentation

    • Added comprehensive guide section documenting multiple dataloader setup, configuration parameters, and usage examples.
  • Known Limitations

    • Multiple dataloaders not yet supported with async GRPO.

@RayenTian RayenTian force-pushed the yukih/multiple-dataloader branch from c552901 to af8ff6e Compare January 2, 2026 05:53
@RayenTian RayenTian added the CI:L1 Run doctests, unit tests, and functional tests label Jan 2, 2026
@yuki-97 yuki-97 force-pushed the yukih/multiple-dataloader branch from 69aecd5 to 82d11f5 Compare January 5, 2026 10:32
@yuki-97 yuki-97 linked an issue Jan 9, 2026 that may be closed by this pull request
@yuki-97 yuki-97 force-pushed the yukih/multiple-dataset branch from d9836a6 to 8577efb Compare January 12, 2026 03:08
@yuki-97 yuki-97 force-pushed the yukih/multiple-dataset branch 2 times, most recently from 74a26c0 to a990378 Compare January 26, 2026 06:08
@yuki-97 yuki-97 force-pushed the yukih/multiple-dataset branch from d1d8e05 to c570a05 Compare February 2, 2026 05:23
Base automatically changed from yukih/multiple-dataset to main February 3, 2026 01:47
@yuki-97 yuki-97 force-pushed the yukih/multiple-dataloader branch from 82d11f5 to 33b5f16 Compare February 4, 2026 14:56
@yuki-97 yuki-97 changed the base branch from main to yukih/nemogym-dataset February 4, 2026 14:57
@yuki-97 yuki-97 changed the base branch from yukih/nemogym-dataset to main February 5, 2026 03:18
@yuki-97 yuki-97 force-pushed the yukih/multiple-dataloader branch from 2017229 to 3979a21 Compare February 5, 2026 03:29
@yuki-97 yuki-97 changed the title [don't merge] support multiple dataloader feat: support multiple dataloader for grpo Feb 5, 2026
@yuki-97 yuki-97 added CI:L1 Run doctests, unit tests, and functional tests and removed CI:L1 Run doctests, unit tests, and functional tests labels Feb 5, 2026
@github-actions github-actions bot added the documentation Improvements or additions to documentation label Feb 5, 2026
@yuki-97 yuki-97 marked this pull request as ready for review February 5, 2026 09:58
@yuki-97 yuki-97 requested review from a team as code owners February 5, 2026 09:58
@yuki-97 yuki-97 added CI:L1 Run doctests, unit tests, and functional tests and removed CI:L1 Run doctests, unit tests, and functional tests labels Feb 5, 2026
Signed-off-by: Yuki Huang <yukih@nvidia.com>
Signed-off-by: Yuki Huang <yukih@nvidia.com>
Signed-off-by: Yuki Huang <yukih@nvidia.com>
Signed-off-by: Yuki Huang <yukih@nvidia.com>
Signed-off-by: Yuki Huang <yukih@nvidia.com>
Signed-off-by: Yuki Huang <yukih@nvidia.com>
Signed-off-by: Yuki Huang <yukih@nvidia.com>
Signed-off-by: Yuki Huang <yukih@nvidia.com>
Signed-off-by: Yuki Huang <yukih@nvidia.com>
Signed-off-by: Yuki Huang <yukih@nvidia.com>
Signed-off-by: Yuki Huang <yukih@nvidia.com>
Signed-off-by: Yuki Huang <yukih@nvidia.com>
Signed-off-by: Yuki Huang <yukih@nvidia.com>
Signed-off-by: Yuki Huang <yukih@nvidia.com>
Signed-off-by: Yuki Huang <yukih@nvidia.com>
Signed-off-by: Yuki Huang <yukih@nvidia.com>
@yuki-97 yuki-97 force-pushed the yukih/multiple-dataloader branch from 2ec95c3 to 39272a2 Compare February 27, 2026 01:28
@yuki-97 yuki-97 added CI:L1 Run doctests, unit tests, and functional tests and removed CI:L1 Run doctests, unit tests, and functional tests labels Feb 27, 2026
@yuki-97 yuki-97 requested a review from RayenTian February 27, 2026 01:29
Copy link
Contributor

@RayenTian RayenTian left a comment

Choose a reason for hiding this comment

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

Thanks for your hard work!

@yuki-97 yuki-97 enabled auto-merge (squash) February 27, 2026 06:57
@yuki-97 yuki-97 merged commit a5f73db into main Feb 27, 2026
41 of 42 checks passed
@yuki-97 yuki-97 deleted the yukih/multiple-dataloader branch February 27, 2026 11:28
seonjinn pushed a commit that referenced this pull request Mar 8, 2026
Signed-off-by: Yuki Huang <yukih@nvidia.com>
Signed-off-by: ruit <ruit@nvidia.com>
Co-authored-by: ruit <ruit@nvidia.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

CI:L1 Run doctests, unit tests, and functional tests documentation Improvements or additions to documentation

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Support multiple dataloader for grpo

3 participants