measure(pipeline): record demucs startup cost per attempt - #307
Merged
Conversation
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.
5 tasks
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.
Summary
PR-3C of Phase 3 (Performance) -- a measurement task, not an optimization.
separate._run_demucsnow recordstime.monotonic()atPopenand at the first stderr line that parses as a progress percentage, storing the delta asjob.stage_timings["separate_startup"](process spawn + demucs/model load, as opposed to actual separation work). One-line addition to the existing stderr read loop.metadata.jsonand 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_startupvalues 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
tests/test_separate_fallback.py:stage_timings["separate_startup"]is recorded on a successful run (using the existing stub-command harness, which already emits a100%|separatedprogress line).195 passed, 12 skippedruff check/ruff format --checkclean