Repository navigation
Resume training from a checkpoint or an MLflow run - #6
Merged
Merged
Conversation
- Experiment.ckpt_path is passed to Trainer.fit; the resume_training fiddler sets it, restoring the full training state (max_time is then the total budget), and optionally keeps logging into an existing MLflow run. - mlcast train --config mlflow:<run id, runs:/<id> or run URL> downloads the run's config and latest checkpoint (highest step=N) and resumes it; set:/fiddler: overrides still apply on top. Falls back to the local <experiment_id>/<run_id>/checkpoints for runs without uploaded checkpoints. - use_mlflow_logger uploads every checkpoint to the run (log_model='all'). - The config artifact is now config/config.yaml rather than a temp name. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This was referenced Oct 18, 2026
leifdenby
added a commit
that referenced
this pull request
Oct 19, 2026
Uploading every checkpoint (log_model='all', added in #6) crashed a continuation of the DMI ConvGRU run at its first validation: mlflow.dmidev.org cut the connection on the ~770 MB upload (SSLEOFError, 7 retries over ~9 min) and Lightning's MLFlowLogger let the error stop training. - use_mlflow_logger(upload_checkpoints=False): upload is now opt-in. - ResilientMLFlowLogger turns a failed checkpoint upload into a warning and marks the checkpoint as handled so later saves don't retry it. Used by use_mlflow_logger, and resume_training switches configs saved with plain MLFlowLogger (e.g. log_model='all' from #6-era runs) over to it. - resume_training no longer forces log_model='all'. Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Lets a run be continued instead of restarted, e.g. to train the DMI ConvGRU run
intrigued-sow-455beyond its 22 h.What it adds
Experiment.ckpt_path, passed toTrainer.fit(ckpt_path=...)(Lightning 2.x has no Trainer-level resume argument). Restores weights, optimizer, LR scheduler, step counter and themax_timetimer, somax_timeis the total budget.resume_trainingfiddler (ckpt_path, optionalmlflow_run_id): sets the above; with a run id the MLflow logger keeps logging into that run, so the metric curves continue.mlcast train --config mlflow:<run>: accepts a run id,runs:/<id>or the run URL from the MLflow UI (which also gives the tracking server). Downloads the run'sconfig/*.yamland its latest checkpoint (higheststep=N) into.mlcast-resume/<run_id>/, seeds the config from the YAML and appliesresume_training; yourset:/fiddler:overrides apply on top.use_mlflow_loggernow setslog_model="all", so every checkpoint is uploaded to the run as it is saved (~770 MB each for the 5-block ConvGRU) and runs can be resumed from any machine. For runs from before this, the local<experiment_id>/<run_id>/checkpointsis used.config/config.yaml(it was a random temp-file name, although the log message already saidconfig/config.yaml), so a resumed run replaces it instead of adding a second YAML.Example
Testing
tests/config/test_mlflow_resume.py(22 tests): run-reference parsing, latest-checkpoint choice from artifacts and the local fallback, reuse of an existing download, the fiddler,Experiment.runpassingckpt_path, CLI token extraction. Full suite: 169 passed, 5 skipped.--config mlflow:<run>withmax_epochs=2downloaded the step-20 checkpoint, Lightning restored all states, and training continued to step 40 in the same MLflow run, uploading the new checkpoint.docs/config_diagram.svgis unchanged: regenerating it locally gives the same labels; only the local Graphviz (12.2.1 vs CI's 2.43.0) renders differently, so that hook was skipped for the commit.🤖 Generated with Claude Code