Skip to content

feat(dynacell/eval): parent-side region timing in eval_timing.csv#459

Merged
alxndrkalinin merged 1 commit into
dynacell-cellpose-watershed-evalfrom
dynacell-eval-parent-timing
Jun 4, 2026
Merged

feat(dynacell/eval): parent-side region timing in eval_timing.csv#459
alxndrkalinin merged 1 commit into
dynacell-cellpose-watershed-evalfrom
dynacell-eval-parent-timing

Conversation

@alxndrkalinin

Copy link
Copy Markdown
Collaborator

Stacked on #449 (base = dynacell-cellpose-watershed-eval).

Cherry-picks 79d85d32 from eval-perf-refactor — the one change on that
umbrella branch with no patch-equivalent already in eval. Everything else on
eval-perf-refactor reached eval via the split PRs (#425/#426/#430/#433/#439/#441/#442).

What it does

Wraps the four parent-side eval phases in region_timer so they land in
eval_timing.csv next to the FOV-loop regions:
parent_load_models, precompute_all, dataset_metrics, save_metrics_csvs
— plus a per-(gt|pred)×extractor precompute_{side}_{kind} timer in
pipeline_cache._flush_kind, and a second dump_timings_csv in evaluate_model
so the save region survives the first dump.

Instrumentation only — no behavior change. The 262-line churn in
pipeline.py is almost entirely the re-indent of the dataset_metrics block
under its new with-guard; the actual measurement points are six call sites.

Conflict resolution

The original commit predates eval's divergence, so the dataset_metrics block
conflicted. Resolved by rebuilding that block from eval HEAD's authoritative
content (verbatim, incl. the MIND-on-CPU note in _compute_one) wrapped in
region_timer, rather than hand-merging the re-indent.

Validation

py_compile passes on both files; diff vs eval HEAD is exactly the 4 wraps +
redump + precompute timer (no behavior change); ruff check/format clean.

🤖 Generated with Claude Code

Wrap the four parent-side phases in evaluate_predictions / evaluate_model
with region_timer so they land in eval_timing.csv alongside the FOV-loop
regions: parent_load_models (load_eval_models + init_cache_contexts),
precompute_all (precompute_deep_features + flush_manifest), dataset_metrics
(the cross-FOV aggregation block), and save_metrics_csvs (save_metrics).

evaluate_model now re-dumps the timing CSV after save_metrics so the save
region survives the first dump inside evaluate_predictions. Add a finer
precompute_{side}_{kind} timer inside pipeline_cache._flush_kind to split
the precompute_all envelope across (gt|pred) x (dinov3|dynaclr|celldino).

Instrumentation only - no behavior change. Most of the pipeline.py line
count is the re-indent of the dataset_metrics block under its new with-
guard; the actual added measurement points are six call sites.

Lets future benchmarks attribute the ~55s of "parent overhead" in the
PR #429 perf report (PERF_PR429_BENCHMARK.md) to specific phases.

(cherry picked from commit 79d85d3268eadf005e6b0a7c50f7e9bcfe21b677 on
eval-perf-refactor; dataset_metrics rebuilt onto the eval branch's diverged
block, preserving the MIND-on-CPU note in _compute_one.)

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>

Copilot AI 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.

Pull request overview

Adds additional eval timing instrumentation for parent-side phases so they are captured in eval_timing.csv alongside existing per-FOV/per-T regions.

Changes:

  • Wrap parent-side phases in region_timer: model loading, deep-feature precompute, dataset-level feature metrics aggregation, and metrics CSV saving.
  • Add per-(gt|pred)×extractor timing around deep-feature extraction inside cache precompute flush.
  • Re-dump timings after save_metrics so the save-phase timing is included in the final eval_timing.csv.

Reviewed changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated no comments.

File Description
applications/dynacell/src/dynacell/evaluation/pipeline.py Adds parent-side timing regions and re-dumps timing CSV after saving metrics.
applications/dynacell/src/dynacell/evaluation/pipeline_cache.py Times per-kind feature extraction during precompute flush (features_from_crops).

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@alxndrkalinin
alxndrkalinin merged commit 92a0bf4 into dynacell-cellpose-watershed-eval Jun 4, 2026
1 check passed
@alxndrkalinin
alxndrkalinin deleted the dynacell-eval-parent-timing branch June 4, 2026 21:31
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.

2 participants