Reusing a LoRA fine-tuning output directory keeps stale merged weights

Aperta
#2,425 0 commenti 0 reazioni 0 assegnatari Vedi su GitHub

@CAOShurong ci sta già lavorando.

Dal 28/11/2026.

  • #2426 di @CAOShurong — aperta

Valutazione

Difficoltà
3/5
Tempo stimato
1-2 giorni
Idoneità per principianti
25/100
Tipo di issue
Bug
Chiarezza
Specificata chiaramente
Stato di attività
Ferma
Stack tecnologico
python, pytorch

Direzione di ricerca

Start with the litgpt finetune_lora and litgpt merge_lora entry points and inspect how final/lit_model.pth.lora and final/lit_model.pth are handled when --out_dir already exists. Reproduce with two different seeds using the same output directory, then compare the merged checkpoint against a fresh-directory control. Done means the final merged weights match the new adapter, while merge_lora still refuses to merge an already-merged checkpoint.

Scritto dal modello di indicizzazione a partire dal testo della issue.

Descrizione

Bug description

Running LoRA fine-tuning twice with the same output directory replaces final/lit_model.pth.lora and leaves final/lit_model.pth from the first run. The second run finishes with “LoRA weights have already been merged in this checkpoint.” A deployment that loads the final merged model silently loads the previous run's weights.

Reproduction
  1. Run litgpt finetune_lora BASE --out_dir OUT --seed 1.
  2. Run the same command with --seed 2, keeping BASE and OUT unchanged.
  3. Run seed 2 once more with a fresh output directory as a control.

On a tiny CPU model, the seed-2 adapter exactly matched the control, but the reused directory's merged weights were identical to seed 1. The maximum absolute difference between the two seed-2 merged checkpoints was 0.0029283.

Expected: the final merged weights match the new adapter. Standalone merge_lora should still skip re-merging a checkpoint it has already merged.

What operating system are you using?

Windows

LitGPT Version

main at 5341568a65e918a85cb284fac038de2157eebf3f, PyTorch 2.15.0+cpu.

Lingua principale
Python
Stelle
13.8k
Fork
1.6k
Metriche di merge delle PR
Nessuna PR unita negli ultimi 30g

Preparare l'ambiente

Apri in Codespaces

Avvia il container di sviluppo del progetto nel browser, con il tuo account GitHub.

Come iniziare

  1. Leggi tutta la issue e poi la guida ai contributi del progetto.
  2. Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
  3. Fai un fork del repository e lavora su un branch.
  4. Apri una pull request che faccia riferimento al numero della issue.

Altre issue di Lightning-AI/litgpt

Tutte le issue di Lightning-AI/litgpt

Issue simili

Altre issue su Python

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.