Skip to content

Add DataLoader module and introduce custom StopTraining exception #1862

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

SurbhiJainUSC
Copy link
Collaborator

@SurbhiJainUSC SurbhiJainUSC commented Jun 23, 2025

Description

This PR introduces data_loader.py, a new module dedicated to encapsulating and streamlining the logic for loading and batching data for model training. This refactors data handling out of train.py, where it was previously imported by various trainers (e.g., sft_trainer, grpo_trainer, elastic_train). By centralizing this functionality, we significantly reduce the complexity of train.py and enhance overall code readability and maintainability. The DataLoader module now serves as a dedicated, modular, and efficient component for preparing training data.

Tests

E2E with train.py

Checklist

Before submitting this PR, please make sure (put X in square brackets):

  • I have performed a self-review of my code.
  • I have necessary comments in my code, particularly in hard-to-understand areas.
  • I have run end-to-end tests tests and provided workload links above if applicable.
  • I have made or will make corresponding changes to the doc if needed.

Copy link
Collaborator

@aireenmei aireenmei left a comment

Choose a reason for hiding this comment

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

LGTM! Thanks Surbhi for making this modularized and the unit tests!

@SurbhiJainUSC SurbhiJainUSC force-pushed the data_loader branch 2 times, most recently from 9359814 to 1ddc77b Compare June 25, 2025 18:50
@SurbhiJainUSC SurbhiJainUSC changed the title Add DataLoader Add DataLoader module and introduce custom StopTraining exception Jun 25, 2025
Copy link
Collaborator

@richjames0 richjames0 left a comment

Choose a reason for hiding this comment

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

LGTM - thanks!

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.

3 participants