Skip to content

Make checkpoint upload to MLflow opt-in and non-fatal - #10

Merged
leifdenby merged 1 commit into
dev/dmi-convgru-trainingfrom
fix/checkpoint-upload-optional
Oct 19, 2026
Merged

leifdenby merged 1 commit into
dev/dmi-convgru-trainingfrom
fix/checkpoint-upload-optional

Conversation

@leifdenby

Copy link
Copy Markdown

The continuation run intrigued-sow-455-from-step83299 crashed at its first validation (step 88,299, ~40 min in):

MLFlowLogger.after_save_checkpoint -> log_artifact(.../epoch=1-step=88299/epoch=1-step=88299.ckpt)
SSLEOFError: EOF occurred in violation of protocol  (7 retries over ~9 min)
mlflow.exceptions.MlflowException: ... Max retries exceeded

Cause: #6 turned on log_model="all", so every ~770 MB checkpoint is uploaded inside the training loop. mlflow.dmidev.org (or its proxy) cuts the connection on uploads that size (none of the run's checkpoint uploads succeeded; large PNGs were already getting 413s), and Lightning's MLFlowLogger lets the error stop training. My end-to-end test used a local file store, which has no size limit.

Fix

  • use_mlflow_logger(upload_checkpoints=False): upload is opt-in again.
  • ResilientMLFlowLogger (new, src/mlcast/loggers.py): a failed checkpoint upload is logged as a warning, and the checkpoints it covered are marked as handled so later saves don't retry them (each attempt blocks training for minutes of HTTP retries). The file is already on local disk.
  • resume_training no longer forces upload on, and switches the logger of any config (including ones saved by Resume training from a checkpoint or an MLflow run #6-era runs with plain MLFlowLogger and log_model="all") to ResilientMLFlowLogger.
  • Resuming still works without uploads via the local <experiment_id>/<run_id>/checkpoints fallback (same machine).

Testing

  • New tests: upload opt-in, resilient logger warns once and doesn't retry on a failing log_artifact, old configs get the resilient logger with their upload setting kept. Full suite: 180 passed, 5 skipped.

To make cross-machine resume possible with this server, the upload size limit on mlflow.dmidev.org would need raising.

🤖 Generated with Claude Code

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>
@leifdenby
leifdenby requested a review from arjj8 October 19, 2026 05:18
@leifdenby
leifdenby merged commit a47204b into dev/dmi-convgru-training Oct 19, 2026
5 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant