Skip to content
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

feat: use SequentialSampler if curriculum_sampling is enabled with sample_packing #2235

Conversation

v-dicicco
Copy link
Contributor

Description

The curriculum_sampling flag introduced in #1567 (cc @winglian) preserves dataset ordering by disabling shuffling, which simplifies experimenting with curriculum learning strategies. However, the flag is ignored if we use sample_packing. This PR sets the sampler to a SequentialSampler if the curriculum_sampling flag is enabled.

How has this been tested?

I've verified that the DataLoader created in this way correctly yields batches with consecutive samples packed together. However, I'm not 100% sure whether other parameters of MultipackBatchSampler need adjustment if we potentially don't have a shuffled dataset (e.g., packing_efficiency_estimate).

Please note that MultipackBatchSampler is already used with a SequentialSampler in _get_eval_sampler().

@v-dicicco v-dicicco changed the title Use SequentialSampler if curriculum_sampling is enabled with sample_packing feat: Use SequentialSampler if curriculum_sampling is enabled with sample_packing Jan 5, 2025
@v-dicicco v-dicicco changed the title feat: Use SequentialSampler if curriculum_sampling is enabled with sample_packing feat: sse SequentialSampler if curriculum_sampling is enabled with sample_packing Jan 5, 2025
@v-dicicco v-dicicco changed the title feat: sse SequentialSampler if curriculum_sampling is enabled with sample_packing feat: use SequentialSampler if curriculum_sampling is enabled with sample_packing Jan 5, 2025
@NanoCode012
Copy link
Collaborator

This is a good catch!

I don't think the other params of Multipack should be impacted from this, but pinging @winglian to double check.

Copy link
Collaborator

@winglian winglian left a comment

Choose a reason for hiding this comment

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

looks good to me! thanks!

@winglian winglian added this pull request to the merge queue Jan 9, 2025
Merged via the queue into axolotl-ai-cloud:main with commit 6553683 Jan 9, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants