Skip to content

music-server: don't black-list Auto after a silent exit - #128

Closed
ramishi wants to merge 1 commit into
timoncool:mainfrom
ramishi:fix/auto-fallback-after-silent-exit
Closed

ramishi wants to merge 1 commit into
timoncool:mainfrom
ramishi:fix/auto-fallback-after-silent-exit

Conversation

@ramishi

@ramishi ramishi commented Oct 20, 2026 •

Copy link
Copy Markdown

Don't black-list Auto after an engine exit that didn't name a device fault

Closes #127
Related: #129 (health probe restarts the engine mid-job, which is what triggers the silent exit this PR handles)

What this changes

One logic line in crates/music-server/src/lib.rs, in the loop that watches
the engine and restarts it when it stops answering, plus a comment that
explains the reasoning:

- if describes_device_failure(&log) || died_silently(&log) {
+ if describes_device_failure(&log) {

died_silently treats "no error-looking word anywhere in the log" as evidence
of a device failure. It fires equally for an OOM-killer SIGKILL, an external
pkill, Studio's own wait_until_healthy timeout on a slow cold start, and
a crash that hasn't flushed its last line. Any of those would add the current
device to failed_devices and remove it from the Auto chain for the rest of
the Studio session.

describes_device_failure already covers the real device faults — cuda error, ggml_cuda_compute_forward, fatal: self-test, devicelost, vk::,
etc. The || clause was strictly broadening the definition without adding any
device-fault signal.

Why it matters

  • On Linux, hardware::hardware().cuda is always None
    (crates/music-server/src/hardware.rs:109), so EngineOptions.backend
    cannot be set to explicit Cuda. Auto is the only GPU path.
  • EngineOptions::device_chain (same file, around line 715) skips devices in
    failed_devices. Once Auto is blacklisted, every subsequent start in the
    session runs on CPU.
  • The engine log records the demotion as
    Auto failed on this machine; leaving it for this session, which reads as
    a hardware failure to a user who hasn't read the source.

The observed effect on a healthy NVIDIA GPU: after one silent engine exit,
songs take roughly 3x longer and there is no UI-visible error explaining why.

Repro

  1. Start Studio with the default Auto backend on an NVIDIA GPU.
  2. kill -9 $(pgrep -f 'yue-server' | head -1).
  3. Next log lines from Studio:
    [studio] the engine stopped answering; restarting it
    [studio] Auto failed on this machine; leaving it for this session
    ...
    [Load] KV backend: CPU (CPU threads: N)
    [studio] computing on the processor
    
  4. Every engine start after that runs on CPU until Studio is restarted.

Scope

One logic line plus a comment update (5 insertions, 3 deletions in one file).
died_silently is left in place because lost_job_reason at
lib.rs:7861 still calls it, and its unit test at lib.rs:9032 still pins
it. Removing the function and the test together would be a nicer cleanup but
is out of scope for the smallest change that fixes the bug.

Verification

  • cargo test -p music-server --release --lib: 335 passed, 0 failed.
  • Reproduced before the patch: kill -9 on a running engine, next start on
    CPU, log contains Auto failed on this machine.
  • Verified after the patch: same kill -9, next start logs
    [Load] KV backend: CUDA0 (CPU threads: N) and Studio stays on Auto.
  • End-to-end 20-second song on RTX 4070 Ti SUPER: NAR step time drops from
    ~11 s (CPU) to ~22 s (CUDA), full pipeline from 697 s to under 6 minutes.

Follow-up

The health probe at lib.rs:8417 uses a 500 ms timeout, which is shorter
than a single NAR step on this engine. Studio restarts the engine mid-job,
and before this patch that restart demoted the session to CPU. After this
patch, the restart stays on CUDA — the job is still lost, but the session
recovers.

Reducing how often the silent exit happens in the first place is tracked
separately in #129. Raising the probe timeout, pausing probing while a job
is running, or making the engine's /health non-blocking would each reduce
the frequency; the maintainer can pick the direction.

The || died_silently clause treated 'no error-looking word anywhere in
the log' as evidence of a device failure. Any ambiguous engine exit -
OOM, external SIGKILL, Studio's own startup timeout - was
unrecoverably blacklisting Auto for the rest of the session.

describes_device_failure already covers real device faults (cuda
error, ggml_cuda_compute_forward, fatal: self-test, devicelost, vk::,
etc.), so removing the || clause does not lose any device-fault
signal. The died_silently function itself is kept because
lost_job_reason and its unit test still use it.

Closes timoncool#127.
@ramishi

ramishi commented Oct 20, 2026

Copy link
Copy Markdown
Author

Tracking issue for the underlying cause (health probe timing out during long NAR steps and killing the engine mid-job, which is what triggers the silent exit this PR handles) is #129 — filed separately because there are three viable fix directions (raise the probe timeout, skip probing during active jobs, or make the engine's /health non-blocking) and I'd rather not guess at which one the maintainer wants.

Fixing #129 would reduce how often this PR's failure mode is triggered at all. This PR just makes the resulting failure mode recoverable.

timoncool added a commit that referenced this pull request Oct 20, 2026
…on the card after an exit that names no device failure (#127, PR #128 by ramishi); the create form keeps its name, style and lyrics across restarts (ACE #54); LoRA training and karaoke CUDA on Linux read what the card runs (#126 by boiler)
@timoncool

Copy link
Copy Markdown
Owner

Thank you! Taken into 3.7.0 (and into MiniMax Music3 Studio and ACE-Step Studio, which share the code), with #129 fixed beside it: https://github.com/timoncool/YuE2-Studio/releases/tag/v3.7.0

@timoncool timoncool closed this Oct 20, 2026
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.

Auto permanently falls back to CPU after any ambiguous engine exit

2 participants