Lightning-AI / Lightning-AI/litgpt

Will CycleIterator forward to dataset on resume for pretrain?

Open
#1,386 3 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

When resuming finetuning, I see that the CycleIterator is forwarded to the dataset where the iteration is to continue from:

https://github.com/Lightning-AI/litgpt/blob/f3343784bbd192490e2a70aa5ef75c52608b1d35/litgpt/finetune/full.py#L208-L219

However, for pretrain, this does not exist and the training seems to resume from the begining:

https://github.com/Lightning-AI/litgpt/blob/f3343784bbd192490e2a70aa5ef75c52608b1d35/litgpt/pretrain.py#L217-L271

Can I check in this case, it looks like when resuming, the pretraining will start from the first dataset, and not forwarded?

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

Read the resume handling in litgpt/pretrain.py around lines 217-271 and compare it with litgpt/finetune/full.py around lines 208-219. Trace whether the pretraining CycleIterator is forwarded to the saved dataset position; done means the resume behavior is confirmed and, if incorrect, matches the finetuning behavior.

Written by the indexing model from the issue text.

Assessment

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

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.