Live optimization progress display in auto3d run - #108
Merged
Conversation
Thread an optional progress callback from main()/WorkflowOrchestrator down to the
FIRE loop so the optimizer can report per-step counts without coupling the math
layers to multiprocessing:
- n_steps emits {step,total,converged,dropped,active} (via the extracted
optimization_counts, shared with print_stats) on the existing istep % 10 sync
cadence + a final event, only when a callback is supplied.
- ensemble_opt / optimizing forward an opaque progress_cb; optim_rank_wrapper
builds a job-tagging closure over an unbounded Manager progress queue.
- WorkflowOrchestrator gains an optional progress_callback. When set,
_run_pipeline creates the progress queue and runs a supervise-and-drain loop
(forwarding events while workers run, then joining with the same exit-code
checks); when None, the existing blocking-join path runs unchanged.
Strictly opt-in: with no callback (every library/test caller) the pipeline
behaves exactly as before -- no queue, no emits, no extra syncs. Test stubs that
mock the optimizer/orchestrator/ensemble_opt gain the new optional parameter.
Interactive runs now render a Rich Live panel (converged/active/dropped/step) fed by the optimizer progress events, replacing the static spinner. OptimizationDisplay.update_from_jobs aggregates the latest per-job event (sums counts, shows the furthest step) so a single optimizer renders its own progress and multi-GPU shows a sensible aggregate. --quiet/--json pass no callback, so stdout stays clean for piping; the render path is fully guarded so a display error can never abort a run. Adds unit tests for the count helper and display aggregation, and CLI tests asserting the callback is forwarded (interactive) and withheld (quiet).
isayev
added a commit
that referenced
this pull request
Jul 11, 2026
Live optimization progress display in auto3d run
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.
Wires the unused
OptimizationDisplayinto interactiveauto3d run, replacing the static spinner with a live panel (converged/active/dropped/step). The hard part is that optimization runs in spawned worker processes while the main process blocks injoin(); this pushes per-step counts out over a process-safe channel and renders them in the main process.Design — strictly opt-in, risk confined to
auto3d runprogress_callbackthreadedmain()→WorkflowOrchestrator→ workers. WhenNone(every Python-API caller, tests, and--quiet/--json), the pipeline behaves byte-for-byte as before — no progress queue, plain blocking joins, no extra GPU syncs. The spawn/CUDA isolation and "Done"-sentinel logic are untouched on the default path._run_pipelinecreates an unboundedManager().Queue(), the worker builds a job-tagging closure, andn_stepsemits{step,total,converged,dropped,active}(via the extractedoptimization_counts, shared withprint_stats) on the existingistep % 10cadence. The main process runs a supervise-and-drain loop, forwarding events to a RichLivepanel, then joins with the same exit-code checks.Review
An independent concurrency/correctness review found no Critical/Major issues — deadlock-safety confirmed (liveness-driven loop, unbounded synchronous Manager queue, guarded puts, sentinels intact) and default-path invariance confirmed. Two Minor cosmetic notes on multi-chunk/multi-GPU percent aggregation are scoped by the docstrings (chunk-level totals were deferred).
Fast gate: 681 passed (+12 new: count helper, display aggregation, callback forwarding); ruff clean on
src/. Guarded so a render error can never abort a run.This is the last item from the CLI review backlog.