Skip to content

measure(pipeline): record demucs startup cost per attempt - #307

Merged
thcp merged 1 commit into
mainfrom
measure/demucs-startup-cost
Jul 17, 2026
Merged

measure(pipeline): record demucs startup cost per attempt#307
thcp merged 1 commit into
mainfrom
measure/demucs-startup-cost

Conversation

@thcp

@thcp thcp commented Jul 17, 2026

Copy link
Copy Markdown
Collaborator

Summary

PR-3C of Phase 3 (Performance) -- a measurement task, not an optimization.

  • separate._run_demucs now records time.monotonic() at Popen and at the first stderr line that parses as a progress percentage, storing the delta as job.stage_timings["separate_startup"] (process spawn + demucs/model load, as opposed to actual separation work). One-line addition to the existing stderr read loop.
  • Flows into metadata.json and the completion log summary automatically, alongside the other stage timings from No per-stage timing telemetry #293 -- no new plumbing needed.

This does not address #288 by itself. It only produces the numbers needed to decide: once this ships, I'll run a few jobs on representative hardware (CPU and GPU) and post the measured separate_startup values to #288 with a decision -- keep the current subprocess-per-job model (expected: 5-15s of startup within a 1-15min separate stage isn't worth a persistent-worker architecture's added complexity), or open a follow-up with a concrete design if startup turns out to be a meaningful fraction of GPU separate time.

Subprocess isolation itself (kill-on-cancel via proc.terminate(), crash containment) is a design feature kept regardless of the outcome.

Test plan

  • New test in tests/test_separate_fallback.py: stage_timings["separate_startup"] is recorded on a successful run (using the existing stub-command harness, which already emits a 100%|separated progress line).
  • Full suite: 195 passed, 12 skipped
  • ruff check / ruff format --check clean

Records time from Popen to demucs's first progress line as
job.stage_timings["separate_startup"] -- process spawn + model load,
as opposed to actual separation work. Written to metadata.json and the
completion summary alongside the other stage timings (#293).

Measurement only: subprocess isolation (kill-on-cancel, crash
containment) is a design feature we keep. Once real numbers are in from
representative machines, #288 gets a decision comment -- keep the
subprocess-per-job model (expected, since startup should be 5-15s of a
1-15min stage) or open a follow-up if it's a meaningful fraction of
total separate time on GPU.
@thcp
thcp merged commit 5e8caeb into main Jul 17, 2026
8 checks passed
@thcp
thcp deleted the measure/demucs-startup-cost branch July 17, 2026 11:10
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