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

Implement ConcatThenSplitIterDataset in PyGrain. #744

Closed
wants to merge 0 commits into from

Conversation

copybara-service[bot]
Copy link

@copybara-service copybara-service bot commented Feb 21, 2025

Implement ConcatThenSplitIterDataset in PyGrain.

The algorithm concatenates elements in a buffer. When they don't fit anymore,
the remainder element is split, and the packed buffer is added to the output.
A notable optimization is that we can directly pass elements that already have
the desired sequence length to the output, as they are already packed.

The state is checkpointed everytime the buffer is empty or contains only one
remainder element. In order to restore any state, we restore to the last
checkpoint and then advance packing until the state is restored.

@copybara-service copybara-service bot force-pushed the test_729106464 branch 11 times, most recently from 2d82b1b to 6582295 Compare February 27, 2025 09:09
@copybara-service copybara-service bot closed this Feb 27, 2025
@copybara-service copybara-service bot deleted the test_729106464 branch February 27, 2025 09:24
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.

0 participants