Skip to content

480 ODELIA call finalize_training also in swarm training - #502

Draft
oleschwen wants to merge 28 commits into
mainfrom
480-swarm-finalize_training-after-the-while-flareis_running-loop-never-runs-launcher-sigterms-the-subprocess
Draft

480 ODELIA call finalize_training also in swarm training#502
oleschwen wants to merge 28 commits into
mainfrom
480-swarm-finalize_training-after-the-while-flareis_running-loop-never-runs-launcher-sigterms-the-subprocess

Conversation

@oleschwen

@oleschwen oleschwen commented Jul 29, 2026

Copy link
Copy Markdown
Collaborator

Implemented call to finalize_training via callback so that the code is actually executed after training also in swarm training mode (which was, so far, implemented and intended to run, but was not executed in our swarm training setup).

Additionally, slightly extended test for output of 3DCNN local training (for consistency).

Builds on #491, should be reviewed and merged only afterwards.

…flareis_running-loop-never-runs-launcher-sigterms-the-subprocess
oleschwen added a commit that referenced this pull request Jul 29, 2026
Merge branch '480-swarm-finalize_training-after-the-while-flareis_running-loop-never-runs-launcher-sigterms-the-subprocess' into 372-odelia-include-evaluation-on-test-data-in-localswarm-training
Ultimate-Storm pushed a commit that referenced this pull request Jul 29, 2026
PR #502 ("WIP 480 ODELIA call finalize_training also in swarm training") is
actively being worked and takes a different, broader approach: it removes the
post-loop finalize entirely and reworks finalization in threedcnn_ptl.py, also
covering minimal_training_pytorch_cnn and the CI harness. Landing a competing
in-loop edit to the same shared main.py would duplicate that work and conflict.

This PR keeps only the deploy-test fixes, which no open PR touches.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
…flareis_running-loop-never-runs-launcher-sigterms-the-subprocess
@oleschwen oleschwen changed the title WIP 480 ODELIA call finalize_training also in swarm training 480 ODELIA call finalize_training also in swarm training Jul 30, 2026
@oleschwen
oleschwen marked this pull request as ready for review July 30, 2026 10:58
@oleschwen
oleschwen requested a review from Ultimate-Storm July 30, 2026 10:58

@Ultimate-Storm Ultimate-Storm left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Approved

Two non-blocking nits

  • Naming/coupling: GT_PredProb_Output_Callback now also performs checkpoint finalization and carries logger/model/checkpointing/path_run_dir/env_vars for that purpose. A future reader looking for "where does finalize happen" is unlikely to look in a class named for CSV export. A separate small FinalizeCheckpointsCallback would keep the responsibility obvious — happy for that to be a follow-up, not a blocker.
  • Per-round cost: finalize_training now runs every round rather than once. It's idempotent and mostly copies already-written checkpoints, but it does a shutil.copy of last.ckpt each round. Fine at current model sizes; worth remembering if checkpoints grow.

Context: I'd briefly opened a competing in-loop fix in #505 and reverted it once I saw this PR — #505 is now deploy-test-only, so there's no overlap.

@oleschwen

oleschwen commented Jul 31, 2026

Copy link
Copy Markdown
Collaborator Author

Good points, let me think about this some more before merging.
The name is indeed misleading, I was thinking ahead to #372 where finalize_training should also output PredProb (for the test data), but it does more, that's easy to fix or split in separate callbacks.
Calling finalize_training one per round is something I specifically wanted to avoid (also in the interest of not running inference on the test data multiple times). Apparently the callback is not the right mechanism for this purpose, and a test running only one round does not capture that it is called multiple times. See #480 (comment).

@oleschwen
oleschwen marked this pull request as draft July 31, 2026 11:50
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.

Swarm: finalize_training after the while flare.is_running() loop never runs (launcher SIGTERMs the subprocess)

2 participants