[GH-ISSUE #5078] [Engine] strata tune auto reports "503 worker refused the request" when the engine aborts (CUDA OOM in prefill), and each experiment's crash fails the whole tune #2365

Closed
opened 2026-11-04 01:58:44 +07:00 by bsakaguchi · 5 comments
Owner

Originally created by @yudhanjaya on GitHub (Nov 3, 2026).
Original GitHub issue: https://github.com/Niko1221/Strata/issues/5078

Environment

  • Strata 0.1.56 (control and engine 0.1.56-linux-x86_64-cuda-cuda13)
  • Linux 7.0.0, Ryzen 7 5800X3D, 62 GiB RAM
  • GPUs: RTX 3080 10 GB (helper, on a slow link, 2.8 GB/s) and RTX 4080 SUPER 16 GB (main). About 2.2 GB of the 4080 SUPER is used by the desktop.
  • Model: Qwen3.8-Flash-Next IQ3_XXS, context 131072, --kv int8, vision on CPU

What happened
strata tune auto <iq3_xxs launch config> --mode quick fails during the baseline measurement with:

Your current settings could not be measured: the worker refused the request (503): ... "the engine stopped unexpectedly (exit code -6); the next request restarts it"

Cause, from --work-dir logs
The engine log ends with:

ggml-cuda (strata mmq): out of memory: cudaMalloc(&p, size)
  in alloc at .../src/prefill/ggml_cuda_host.cu:127

Just before it, strata serve reported "687 MiB of VRAM free with everything loaded", then "the layer split planned to keep 796 MiB free here after loading; 150 MiB are free, so 646 MiB went to something the plan did not count". The next prefill allocation then failed.

Problems

  1. Misleading error. The user sees a generic "503 worker refused the request". The real cause, a CUDA OOM, is only in the engine log, and that log is overwritten by the next launch. The worker's hint says "usually running out of RAM... check dmesg", which points the wrong way for a VRAM abort (exit -6).
  2. Default VRAM reserve is too small for this setup. The reserve defaults to 512 MiB, and tune auto doesn't add one. With a desktop on the main GPU, the baseline aborts. The same config works with --vram-reserve-mib 2304 set in the launch preset's extra.
  3. One crashing experiment fails the whole run. After the baseline passed, the --trim-stage-weights candidate's engine died during load, and the user saw the same 503 message. The cause is unclear: the log stops at "GPU 0: NVIDIA GeForce RTX 3080" with no error. The 3080 showed only 3.71 GiB free at that point, against 5.28 GiB earlier, so the previous engine's VRAM may not have been released yet (unconfirmed).
  4. --work-dir is not the default, so by default the crash evidence is lost.

Suggested fixes

  • Surface the engine's last error line (for example the CUDA OOM) in the tune and worker error, instead of only the 503 text.
  • Detect abort exit codes like -6 and suggest a larger --vram-reserve-mib, not RAM.
  • Make tune auto raise the reserve on GPUs that also run a desktop, or warn when free VRAM after load is below the plan.
  • Treat a crashing experiment as "failed, skipped" and continue, as already happens for spec3 ("left the PC with too little free memory"), and wait for VRAM to be released between engine restarts.
  • Keep the failed engine's log by default.

Repro

strata tune auto <iq3_xxs launch config>.json --mode quick --boot-timeout 1800 --work-dir <dir> --no-save
Originally created by @yudhanjaya on GitHub (Nov 3, 2026). Original GitHub issue: https://github.com/Niko1221/Strata/issues/5078 **Environment** - Strata 0.1.56 (control and engine `0.1.56-linux-x86_64-cuda-cuda13`) - Linux 7.0.0, Ryzen 7 5800X3D, 62 GiB RAM - GPUs: RTX 3080 10 GB (helper, on a slow link, 2.8 GB/s) and RTX 4080 SUPER 16 GB (main). About 2.2 GB of the 4080 SUPER is used by the desktop. - Model: Qwen3.8-Flash-Next IQ3_XXS, context 131072, `--kv int8`, vision on CPU **What happened** `strata tune auto <iq3_xxs launch config> --mode quick` fails during the baseline measurement with: > Your current settings could not be measured: the worker refused the request (503): ... "the engine stopped unexpectedly (exit code -6); the next request restarts it" **Cause, from `--work-dir` logs** The engine log ends with: ``` ggml-cuda (strata mmq): out of memory: cudaMalloc(&p, size) in alloc at .../src/prefill/ggml_cuda_host.cu:127 ``` Just before it, `strata serve` reported "687 MiB of VRAM free with everything loaded", then "the layer split planned to keep 796 MiB free here after loading; 150 MiB are free, so 646 MiB went to something the plan did not count". The next prefill allocation then failed. **Problems** 1. **Misleading error.** The user sees a generic "503 worker refused the request". The real cause, a CUDA OOM, is only in the engine log, and that log is overwritten by the next launch. The worker's hint says "usually running out of RAM... check dmesg", which points the wrong way for a VRAM abort (exit -6). 2. **Default VRAM reserve is too small for this setup.** The reserve defaults to 512 MiB, and `tune auto` doesn't add one. With a desktop on the main GPU, the baseline aborts. The same config works with `--vram-reserve-mib 2304` set in the launch preset's `extra`. 3. **One crashing experiment fails the whole run.** After the baseline passed, the `--trim-stage-weights` candidate's engine died during load, and the user saw the same 503 message. The cause is unclear: the log stops at "GPU 0: NVIDIA GeForce RTX 3080" with no error. The 3080 showed only 3.71 GiB free at that point, against 5.28 GiB earlier, so the previous engine's VRAM may not have been released yet (unconfirmed). 4. **`--work-dir` is not the default**, so by default the crash evidence is lost. **Suggested fixes** - Surface the engine's last error line (for example the CUDA OOM) in the tune and worker error, instead of only the 503 text. - Detect abort exit codes like -6 and suggest a larger `--vram-reserve-mib`, not RAM. - Make `tune auto` raise the reserve on GPUs that also run a desktop, or warn when free VRAM after load is below the plan. - Treat a crashing experiment as "failed, skipped" and continue, as already happens for `spec3` ("left the PC with too little free memory"), and wait for VRAM to be released between engine restarts. - Keep the failed engine's log by default. **Repro** ``` strata tune auto <iq3_xxs launch config>.json --mode quick --boot-timeout 1800 --work-dir <dir> --no-save ```
Author
Owner

@github-actions[bot] commented on GitHub (Nov 3, 2026):

Thanks for the issue. To keep the tracker readable, every item needs an area prefix in the title and the parts of the issue form filled in. This one is missing:

  • Start the title with its area: [Engine], [GUI], [TUI], [Benchmark], [Docs] or [Other], then a short description. Example: "[Engine] decode stops after 2 minutes".

Edit the issue (title and description) and this note goes away on its own. If it is still missing parts in 5 days it will be closed, which is not a rejection: fix it and comment /reopen.

Details: CONTRIBUTING.md

<!-- gh-comment-id:6599319394 --> @github-actions[bot] commented on GitHub (Nov 3, 2026): Thanks for the issue. To keep the tracker readable, every item needs an area prefix in the title and the parts of the issue form filled in. This one is missing: - [ ] Start the title with its area: [Engine], [GUI], [TUI], [Benchmark], [Docs] or [Other], then a short description. Example: "[Engine] decode stops after 2 minutes". Edit the issue (title and description) and this note goes away on its own. If it is still missing parts in 5 days it will be closed, which is not a rejection: fix it and comment `/reopen`. Details: [CONTRIBUTING.md](https://github.com/Niko1221/Strata/blob/main/CONTRIBUTING.md)
bsakaguchi changed title from [GH-ISSUE #5078] strata tune auto reports "503 worker refused the request" when the engine aborts (CUDA OOM in prefill), and each experiment's crash fails the whole tune to [GH-ISSUE #5078] [Engine] strata tune auto reports "503 worker refused the request" when the engine aborts (CUDA OOM in prefill), and each experiment's crash fails the whole tune 2026-11-07 14:37:34 +07:00
bsakaguchi 2026-11-07 14:37:34 +07:00
Author
Owner

@github-actions[bot] commented on GitHub (Nov 4, 2026):

Thanks, this follows the format now.

<!-- gh-comment-id:6620182468 --> @github-actions[bot] commented on GitHub (Nov 4, 2026): Thanks, this follows the format now.
Author
Owner

@yudhanjaya commented on GitHub (Nov 4, 2026):

Reproduced three more times on the same rig with a different model:

Repro, Strata 0.1.56 (control + engine 0.1.56-linux-x86_64-cuda-cuda13): RTX 3080 10 GB (helper) + RTX 4080 SUPER 16 GB (main), 62 GiB RAM,
Qwen3.8-Flash-Next IQ3_S, 131072 context, --kv int8, DFlash2. strata tune auto on that launch setup (quick) ended on the baseline
three times: "the worker refused the request (503): the engine stopped unexpectedly (exit code -6)". For the first the logs were already gone; for the other two
the engine log is the same as in the report above: CUDA1: 168 MiB of VRAM free with everything loaded - LOW ... add --vram-reserve-later-mib 1300, then
ggml-cuda (strata mmq): out of memory: cudaMalloc(&p, size) in ggml_cuda_host.cu:127, on the next
request after the decode measurements (the prompt-speed request, as far as I can tell). Decode itself ran at 80-87 tok/s up to that point.

Findings:

  1. The worker (serve.server) stays up when its engine dies and restarts it on the next request. So the tuner cannot use the worker's exit
    state to tell a crash; the engine log is the only place that says why. (The worker's own hint, "usual cause is running out of RAM", was wrong here.)
  2. strata tune auto --goal room:2304 is meant to add --vram-reserve-mib 2304, but it only does so when the engine's --help lists the flag.
    --help on 0.1.56 does not list --vram-reserve-mib (the string is in the binary, and a launch config that passes it starts fine), so the reserve was
    dropped without a message and the next run crashed the same way. This is the same cause as #4652. Its probe set is
    dimension_flags() | arm_flags(), and --vram-reserve-mib is a dimension in tuning.py, so I expect that PR to fix --goal room:N as well
    (not tested: I have not run it). My branch does not try to fix the flag list; it only says so when a requested reserve was not applied.

With the reserve put into the setup's arguments by hand (--vram-reserve-mib 2304), the same tune completed in about 11 minutes.

I have fixes for the points above on a local branch, not pushed yet (engine log decides the cause and quotes the engine's own advice; failed tunes keep their logs by default; a reserve that was asked for and not applied is reported). I will open a PR for this and link it here; the larger tuner changes I am working on I will raise in a separate [TUI] issue first.

Not fixed yet from the original list: a crashing candidate still stops the search when it is an out-of-memory (autotune.py: "the search stopped (nothing was retried)").

<!-- gh-comment-id:6635528503 --> @yudhanjaya commented on GitHub (Nov 4, 2026): Reproduced three more times on the same rig with a different model: **Repro, Strata 0.1.56 (control + engine `0.1.56-linux-x86_64-cuda-cuda13`)**: RTX 3080 10 GB (helper) + RTX 4080 SUPER 16 GB (main), 62 GiB RAM, Qwen3.8-Flash-Next IQ3_S, 131072 context, `--kv int8`, DFlash2. `strata tune auto` on that launch setup (quick) ended on the baseline three times: "the worker refused the request (503): the engine stopped unexpectedly (exit code -6)". For the first the logs were already gone; for the other two the engine log is the same as in the report above: `CUDA1: 168 MiB of VRAM free with everything loaded - LOW ... add --vram-reserve-later-mib 1300`, then `ggml-cuda (strata mmq): out of memory: cudaMalloc(&p, size)` in `ggml_cuda_host.cu:127`, on the next request after the decode measurements (the prompt-speed request, as far as I can tell). Decode itself ran at 80-87 tok/s up to that point. **Findings:** 1. The worker (`serve.server`) stays up when its engine dies and restarts it on the next request. So the tuner cannot use the worker's exit state to tell a crash; the engine log is the only place that says why. (The worker's own hint, "usual cause is running out of RAM", was wrong here.) 2. `strata tune auto --goal room:2304` is meant to add `--vram-reserve-mib 2304`, but it only does so when the engine's `--help` lists the flag. `--help` on 0.1.56 does not list `--vram-reserve-mib` (the string is in the binary, and a launch config that passes it starts fine), so the reserve was dropped without a message and the next run crashed the same way. This is the same cause as #4652. Its probe set is `dimension_flags() | arm_flags()`, and `--vram-reserve-mib` is a dimension in `tuning.py`, so I expect that PR to fix `--goal room:N` as well (not tested: I have not run it). My branch does not try to fix the flag list; it only says so when a requested reserve was not applied. With the reserve put into the setup's arguments by hand (`--vram-reserve-mib 2304`), the same tune completed in about 11 minutes. I have fixes for the points above on a local branch, not pushed yet (engine log decides the cause and quotes the engine's own advice; failed tunes keep their logs by default; a reserve that was asked for and not applied is reported). I will open a PR for this and link it here; the larger tuner changes I am working on I will raise in a separate [TUI] issue first. Not fixed yet from the original list: a crashing candidate still stops the search when it is an out-of-memory (autotune.py: "the search stopped (nothing was retried)").
Author
Owner

@yudhanjaya commented on GitHub (Nov 4, 2026):

The fixes for the points above are now on a branch of my fork, for review: tuner-clarity (compare with main: 5 commits, based on the current main, no conflicts).

The commits for this issue:

  • c3d70693: an out-of-memory baseline is classified as OOM and says what to lower; a stopped or failed tune (SIGTERM, SIGHUP, an exception) leaves a result instead of a status stuck on "running".
  • 0c26e53f: a crashed engine is explained by its own log (the CUDA out-of-memory line and the engine's own advice); a failed tune keeps the engine and worker logs by default and drops the run configs that hold the API key.
  • 80f8cda8: the log decides even though the worker stays up; a reserve that was asked for and not applied is reported.

This is not a PR yet. I will send it as one if the maintainers are happy with it, or split or rework it as you prefer.

Validation: 320 tests in tests/tuning pass on the bundled Python 3.12; four real tunes on one Linux CUDA rig (the first three hit this issue, the fourth completed once the reserve was in the setup). Not run: other backends, Windows, macOS, the desktop app's JavaScript tests. The path inside auto() that handles an unexpected exception has no automated test (it needs a real profile and engine); the signal handling and the log-keeping helpers do.

<!-- gh-comment-id:6636220103 --> @yudhanjaya commented on GitHub (Nov 4, 2026): The fixes for the points above are now on a branch of my fork, for review: [`tuner-clarity`](https://github.com/yudhanjaya/Strata/tree/tuner-clarity) ([compare with main](https://github.com/Niko1221/Strata/compare/main...yudhanjaya:tuner-clarity): 5 commits, based on the current `main`, no conflicts). The commits for this issue: - [`c3d70693`](https://github.com/yudhanjaya/Strata/commit/c3d70693): an out-of-memory baseline is classified as OOM and says what to lower; a stopped or failed tune (SIGTERM, SIGHUP, an exception) leaves a result instead of a status stuck on "running". - [`0c26e53f`](https://github.com/yudhanjaya/Strata/commit/0c26e53f): a crashed engine is explained by its own log (the CUDA out-of-memory line and the engine's own advice); a failed tune keeps the engine and worker logs by default and drops the run configs that hold the API key. - [`80f8cda8`](https://github.com/yudhanjaya/Strata/commit/80f8cda8): the log decides even though the worker stays up; a reserve that was asked for and not applied is reported. This is not a PR yet. I will send it as one if the maintainers are happy with it, or split or rework it as you prefer. Validation: 320 tests in `tests/tuning` pass on the bundled Python 3.12; four real tunes on one Linux CUDA rig (the first three hit this issue, the fourth completed once the reserve was in the setup). Not run: other backends, Windows, macOS, the desktop app's JavaScript tests. The path inside `auto()` that handles an unexpected exception has no automated test (it needs a real profile and engine); the signal handling and the log-keeping helpers do.
Author
Owner

@Niko1221 commented on GitHub (Nov 5, 2026):

Hello yudhanjaya,

Thank you for the report. In Strata 0.2.11, when the engine aborts during a tuning experiment, the error from the worker carries the last error lines of the engine log, an allocation failure is reported as out of memory, and one aborting candidate fails that candidate alone instead of the whole tune. If the base run itself aborts, the native line is named. Three of your points are not changed in this release: a bigger default VRAM reserve, keeping the engine log by default, and waiting for VRAM release between restarts. If tuning still stops at the first crash on 0.2.11, please send the tune result and the engine log.

The Strata project

<!-- gh-comment-id:6658446056 --> @Niko1221 commented on GitHub (Nov 5, 2026): Hello yudhanjaya, Thank you for the report. In Strata 0.2.11, when the engine aborts during a tuning experiment, the error from the worker carries the last error lines of the engine log, an allocation failure is reported as out of memory, and one aborting candidate fails that candidate alone instead of the whole tune. If the base run itself aborts, the native line is named. Three of your points are not changed in this release: a bigger default VRAM reserve, keeping the engine log by default, and waiting for VRAM release between restarts. If tuning still stops at the first crash on 0.2.11, please send the tune result and the engine log. The Strata project
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
Niko1221/Strata#2365
No description provided.