Skip to content

Model weights reloaded per job #288

Closed

Description

@thcp

Location: separate.py:32
Severity: MED

Each job spawns python -m demucs, paying model load + torch init (~5–15 s) every time. The subprocess isolation is deliberate (kill-on-cancel, crash containment) and worth keeping — but the cost should be measured and visible (see logging §03) before deciding whether a persistent worker is ever justified.

From the health report. Part of #274 (Phase 3 — Performance).

Activity

  1. thcp commented on Jul 17, 2026

    @thcp
    CollaboratorAuthor

    Measured on real hardware

    Machine: Windows, NVIDIA RTX 3080 (driver 595.79). Same 220s track (mix.wav from a real job), 3 runs per device via separate() directly.

    Device Run separate_startup total separate() startup % of stage
    CPU 1 (cold) 20.2s 90.9s 22%
    CPU 2 (warm) 6.9s 82.8s 8%
    CPU 3 (warm) 6.8s 80.8s 8%
    GPU (cuda) 1 (cold) 7.3s 17.5s 42%
    GPU (cuda) 2 (warm) 5.0s 14.0s 36%
    GPU (cuda) 3 (warm) 4.8s 13.7s 35%

    (Cold = first invocation in the process/environment, paying disk-cache warm-up on top of the fixed model-load cost; warm = steady state.)

    Decision

    Per the plan: keep if startup is 5-15s of a 1-15min stage (CPU: yes, ~7s of ~85s, comfortably in that range); open a follow-up with a concrete design if it's >20% of separate time on GPU.

    GPU is 35-42% — well over the >20% trigger. On fast hardware, subprocess spawn + demucs/torch model load is no longer a rounding error, it's over a third of the actual GPU-bound work. Opening a follow-up issue for a persistent-worker design (keeps subprocess isolation's kill-on-cancel/crash-containment properties, but the interesting part is figuring out how the model survives across jobs without giving that up -- proposal there).

    Closing this issue -- the follow-up is the actionable next step. Data below to inform it.

  2. self-assigned this
    on Oct 1, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

performanceSpeed, memory, and resource efficiency

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions