feat(dynacell/eval): parent-side region timing in eval_timing.csv#459
Merged
alxndrkalinin merged 1 commit intoJun 4, 2026
Merged
Conversation
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>
Contributor
There was a problem hiding this comment.
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)×extractortiming around deep-feature extraction inside cache precompute flush. - Re-dump timings after
save_metricsso the save-phase timing is included in the finaleval_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
merged commit Jun 4, 2026
92a0bf4
into
dynacell-cellpose-watershed-eval
1 check passed
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.
Stacked on #449 (base =
dynacell-cellpose-watershed-eval).Cherry-picks
79d85d32fromeval-perf-refactor— the one change on thatumbrella branch with no patch-equivalent already in eval. Everything else on
eval-perf-refactorreached eval via the split PRs (#425/#426/#430/#433/#439/#441/#442).What it does
Wraps the four parent-side eval phases in
region_timerso they land ineval_timing.csvnext to the FOV-loop regions:parent_load_models,precompute_all,dataset_metrics,save_metrics_csvs— plus a per-
(gt|pred)×extractorprecompute_{side}_{kind}timer inpipeline_cache._flush_kind, and a seconddump_timings_csvinevaluate_modelso the save region survives the first dump.
Instrumentation only — no behavior change. The 262-line churn in
pipeline.pyis almost entirely the re-indent of thedataset_metricsblockunder its new
with-guard; the actual measurement points are six call sites.Conflict resolution
The original commit predates eval's divergence, so the
dataset_metricsblockconflicted. Resolved by rebuilding that block from eval HEAD's authoritative
content (verbatim, incl. the MIND-on-CPU note in
_compute_one) wrapped inregion_timer, rather than hand-merging the re-indent.Validation
py_compilepasses 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