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

Adding Batching After Every Block #484

Merged

Conversation

eshwarprasadS
Copy link
Contributor

The Problem:

Resolves #480, related to #424

Key Changes Implemented

Re-batch After Each Block:

After processing the dataset through a block, split it into batches based on the current batch_size (reuses ._split_dataset within class Pipeline)

Sequential Execution for Each Block:

Process batches sequentially within each block, and does not spawn any more threads of execution.

Recombine Batch Outputs:

Combine the processed batches back into a single dataset before sending it to the next block. (reuses concatenate_datasets())

@mergify mergify bot added testing Relates to testing ci-failure labels Jan 16, 2025
Signed-off-by: eshwarprasadS <[email protected]>
Signed-off-by: eshwarprasadS <[email protected]>
@eshwarprasadS eshwarprasadS force-pushed the RHELAI-2756-batch-after-every-block branch from d94c659 to 2b999bf Compare January 16, 2025 19:47
@mergify mergify bot removed the ci-failure label Jan 16, 2025
@mergify mergify bot added the ci-failure label Jan 17, 2025
@bbrowning
Copy link
Contributor

Let's make sure we pull the jinja template change into a separate PR so that we can track/merge that fix separately from this batching change.

@eshwarprasadS
Copy link
Contributor Author

Let's make sure we pull the jinja template change into a separate PR so that we can track/merge that fix separately from this batching change.

Got it, will revert that change, so it can be addressed separately.

@mergify mergify bot added ci-failure and removed ci-failure labels Jan 20, 2025
@bbrowning
Copy link
Contributor

@eshwarprasadS If you need to reproduce the ruff errors locally that happened during the CI run, see https://github.com/instructlab/sdg/blob/d59731f2eb4c1dec66549d0ce4bf031ead8d7088/CONTRIBUTING.md#running-code-formatting-and-linting-checks-locally on how to do that. Basically, tox -e ruff -- check if your local dev environment is setup properly.

Signed-off-by: eshwarprasadS <[email protected]>
@mergify mergify bot removed the ci-failure label Jan 20, 2025
@aakankshaduggal aakankshaduggal requested a review from a team January 20, 2025 23:23
Copy link
Contributor

@bbrowning bbrowning left a comment

Choose a reason for hiding this comment

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

Just a small question around how we check if batching is enabled, but otherwise the logic looks good to me and the new tests look great. Thanks for the thoroughness in fixing and testing this!

src/instructlab/sdg/pipeline.py Outdated Show resolved Hide resolved
@nathan-weinberg nathan-weinberg changed the title RHELAI-2756 Adding Batching After Every Block Adding Batching After Every Block Jan 21, 2025
@nathan-weinberg
Copy link
Member

@eshwarprasadS Please don't include references to RHEL AI Jira tickets in PRs - changed the title of this one

Copy link
Contributor

@bbrowning bbrowning 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 - thanks for getting this fix in!

@mergify mergify bot added the one-approval label Jan 21, 2025
Copy link
Member

@khaledsulayman khaledsulayman left a comment

Choose a reason for hiding this comment

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

LGTM!

@mergify mergify bot merged commit 8191c2a into instructlab:main Jan 21, 2025
22 checks passed
@mergify mergify bot removed the one-approval label Jan 21, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
testing Relates to testing
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Configured batch_size not used to re-split output samples from each Pipeline Block
4 participants