Lightning-AI / Lightning-AI/litgpt

[Bug] Pretraining on sample-data throws StopIteration in initialization

Open
#838 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
Python
Stars
13.7k
Forks
1.5k
Avg merge
15h 37m
Merged PRs (30d)
1

Description

Hi, I followed your instructions precisely and set up the environment and data but because of the dataset sizes in the sample dataset an error occurs.
the arvix data set (and others) is small (8 bins after pre-processing), and therefore when it is sharded to 4, each one is of size 2 which is smaller then the _n_chunks is set to 4 therefore the linked line throws an error : https://github.com/Lightning-AI/lit-gpt/blob/c81f7a9ff379a0453c83a4fd79a764698ed1fea9/lit_gpt/packed_dataset.py#L170

for my use case I'm using the sample dataset only to test that the system is set-up correctly and therefore I implemented a hacky-fix:
https://github.com/Lightning-AI/lit-gpt/blob/c81f7a9ff379a0453c83a4fd79a764698ed1fea9/lit_gpt/packed_dataset.py#L48
remove the indexing from this line, meaning replace it with:
`python filenames = self._filenames`

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start in lit_gpt/packed_dataset.py at the linked lines around filename selection and chunk initialization, then reproduce pretraining with the sample dataset described in the issue. Confirm that initialization handles shards smaller than _n_chunks without StopIteration, and verify that sample-data pretraining completes initialization successfully.

Written by the indexing model from the issue text.

Assessment

Tech stack
python
Domain
machine-learning
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
42/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.