Repository navigation
[DOC] Document checkpoint resuming on lightning 2.6 and use pytorch_forecasting Tuner in examples - #2464
[DOC] Document checkpoint resuming on lightning 2.6 and use pytorch_forecasting Tuner in examples#2464Elvand-Lie wants to merge 6 commits into
Conversation
Document weights_only=False for trusted v1 checkpoints on Lightning >=2.6. Cover resume, validate and test through ckpt_path with an integration test. Fixes sktime#2463
|
Check out this pull request on See visual diffs & provide feedback on Jupyter Notebooks. Powered by ReviewNB |
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #2464 +/- ##
=======================================
Coverage ? 88.80%
=======================================
Files ? 218
Lines ? 11688
Branches ? 0
=======================================
Hits ? 10380
Misses ? 1308
Partials ? 0
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
phoeenniixx
left a comment
There was a problem hiding this comment.
I think we just need to pass weights_only=False? That should be enough no?
Also, I feel this is something that should be mentioned in lightning docs rather than ours, no?
But I think we can mention it in our docs, but it should be in a more "visible" place than nb - maybe in models or somewhere?
|
I think passing It is not enough everywhere, though. On current
On Lightning docs: a plain On placement I do agree. The PR also adds a |
I meant do we need to pass Regarding I have a question here though - we wrapped the |
…casting Tuner Add a "Resuming from a checkpoint" section to the Models usage docs and reduce the FAQ entry to a pointer. Switch the README, Getting Started and Models examples to pytorch_forecasting.tuning.Tuner, as Lightning's Tuner.lr_find cannot pass weights_only and fails on v1 checkpoints with lightning 2.6.
|
The wrapper is still needed. Lightning 2.6.6 is the latest release; Updated in a690577:
|
phoeenniixx
left a comment
There was a problem hiding this comment.
Why do we have a test addition in a doc change PR?
|
The test checks the workflow documented here: resuming through It passes on The earlier review points are also addressed:
|
Fixes #2463. Related: #2000 and #2027.
Change
On Lightning >=2.6 with PyTorch >=2.6,
Trainer.fit(..., ckpt_path=...)rejects v1 checkpoints because the default weights-only loader cannot restore the fitted encoders, normalizers, losses and metrics they contain.ckpt_path, and passweights_only=Falsefor trusted checkpoints. The FAQ entry now points there; the stallion tutorial note stays.README.md, Getting Started and Models examples fromlightning.pytorch.tuner.Tunertopytorch_forecasting.tuning.Tuner. Lightning'sTuner.lr_findhas noweights_onlyargument and fails on these checkpoints; ours patches the loader ([BUG] Solve the unpickling error in weight Loading #2000). The tutorials already use it.Scope
Documentation, example imports and a test of an existing workaround. Runtime loading behavior is unchanged; default loading still fails without the explicit keyword. The
pytorch_forecasting.tuning.Tunerwrapper is still needed: in Lightning 2.6.6, the latest release,Tuner.lr_findhas noweights_onlyargument. v2 uses a separate representation and is out of scope. Only trusted checkpoints should be loaded this way, as unpickling can execute code.Validation
Lightning 2.6.6, PyTorch 2.14.1, Windows CPU:
1 passed); skipped on Lightning 2.5.6.weights_only=Falsepasses.Tuner.lr_findfails with the sameUnpicklingErrorandpytorch_forecasting.tuning.Tuner.lr_findpasses. TheLearningRateFindercallback fails even withtrainer.fit(..., weights_only=False). A plainLightningModulecheckpoint resumes with the default.0acb5a0: 201 passed and 5 skipped across a parallel run and serial retries of 23 environment failures (Tk backend, memory).Review focus
Placement of the note in the Models usage section, and whether the Tuner import changes belong in this PR.