Lightning-AI / Lightning-AI/litData
Allow a StreamingDataset to wrap around when running in a CombinedStreamingDataset
Nobody has claimed this yet.
- Dominant language
- Python
- Stars
- 614
- Forks
- 106
- Avg merge
- 15h 8m
- Merged PRs (30d)
- 22
Description
## 🚀 Feature
Consider adding the ability to _wrap_ around a StreamingDataset without issuing a StopIteration when combining datasets.
This is something we haven't ported from PackedDataset https://github.com/Lightning-AI/lit-llama/blob/main/lit_llama/packed_dataset.py#L190
### Motivation
This is useful to combine a smaller dataset with a very large one, so that we can make sure certain batches of data make it into the training process frequently enough, but without invalidating the epoch when the other datasets are multi-billion tokens in size.
### Pitch
Add a `wrap` property to a StreamingDataset that will not have it raise a StopIteration but just keep looping through the data.
### Alternatives
Add handling of this at the CombinedStreamingDataset level, so that each dataset raises StopIteration when it has to, but we don't invalidate the others. In both cases we need to decide what happens to `epoch` within the dataset.
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start by reading the StreamingDataset and CombinedStreamingDataset implementations, then compare their behavior with the linked PackedDataset wrap logic. Decide whether wrapping belongs on the individual dataset or the combined dataset, including how epoch should behave; done means a smaller dataset can repeat without raising StopIteration while combined iteration remains valid.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- python
- Domain
- data
- Issue type
- Feature
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100