Skip to content

Worker is OOM-killed re-loading the same workflow with changed arguments: #98's release path is keyed on workflow change, so it never fires #150

Description

@dkackman

tool/endpoint: run_workflow — worker model-cache cleanup (the path added in #98)

repro: two consecutive run_workflow calls on the same workflow, second one with different arguments, in one worker lifetime. Server 0.4.0-beta.4 on lem, 2026-09-14.

  1. run_workflow(workflow_path="templates/minimax/video-with-audio", arguments={prompt: <...>, num_frames: 345})
    → job 7e79975811b4, succeeded, 07:21:15 → 07:39:41 (18.4 min).
  2. run_workflow(workflow_path="templates/minimax/video-with-audio", arguments={prompt: <...>, num_frames: 345, width: 1344, height: 768, num_inference_steps: 20, lora_scale: 0.0})
    → job 6891c929368e, failed at 74 s: Worker process died: killed by SIGKILL (typically the out-of-memory killer).
  3. Immediately re-run step 2 byte-identically → job c503e366abaf cleared the load phase at 102.7 s and ran on for 8.7 min (it later died of an unrelated CUDA OOM from my resolution choice — not this bug).

expected: job 2 either reuses the cached models or releases them before reloading, as #98's fix does.

actual: it did neither. Full event trace of job 6891c929368e:

0   0.0s  job_status queued
1   0.0s  job_status running
2   0.0s  log        MiniMaxH3
3   0.0s  log        Executing workflow: MiniMaxH3
4   0.0s  run_start
5   0.0s  workflow_start
6   0.0s  step_start
7   0.0s  phase loading  MiniMaxAI/MiniMax-H3
8   0.0s  phase loading  pipeline: MiniMaxAI/MiniMax-H3
9  74.1s  job_status failed

There is no Released cached models: line, and no Workflow changed - releasing cached models... line — the two that #98 added. Job 1, by contrast, emitted both:

2  0.0s  log  Workflow changed - releasing cached models...
3  ...   log  Released cached models: host RSS 1229 MB, 61128 MB available (17 MB returned to the OS)

So job 1 started from a clean worker (1.2 GB RSS, 61 GB available) and succeeded. Job 2 ran the
same workflow name, so the workflow-switch cleanup never fired — and then entered
phase loading / pipeline: MiniMaxAI/MiniMax-H3 anyway, i.e. it re-loaded while the previous
load was still resident, and was killed 74 s in.

hypothesis (stated as such): the cleanup in #98 is keyed on the workflow changing. A
same-workflow rerun whose arguments force a reload — here lora_scale, num_inference_steps
and the canvas all changed — takes the reload path without the release path. #98 measured the
H3 reference-to-video worker at 49,761 MB RSS with models held; a second load on top of
that on a box with ~61 GB available is the whole margin. I could not observe RSS at kill time,
so the trigger (same-workflow reload with no release) is what the events prove; the doubling is
inference.

why this is not #98 and not a regression of it. #98's repro is cross-family residue
(LTX then H3) and its fix is the workflow-switch path, which by construction cannot fire here —
job 2 never changed workflow. #98 is correctly closed status:verified; its fix is present and
demonstrably working in job 1's log lines above. This is the adjacent hole in the same
mechanism. Filing separately per that issue's own invitation: "If a stock run still gets
OOM-killed after a different family ran before it, reopen with the job ids and the Released cached models: line from the later job."
— the point here being that the later job has no
such line at all
, which is the finding.

cost of the bug: silent to an agent. The kill arrives as a bare SIGKILL tool result with
nothing to distinguish "your arguments are too big" from "the worker was full"; I initially
mis-attributed it to my own resolution choice. It cost a ~45-minute retry to separate the two.

possible directions (deliberately not picking one — the worker-lifetime policy looks like a
design call):

At minimum, an event line when a reload happens with models already resident would make this
diagnosable from one job instead of three.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't workingowner:testerTester's turn to actstatus:verifiedTester confirmed the fix via a real MCP call

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions