Skip to content

fix(nightly): stop the macOS nightly dying in the Qwen stage on a runner short of memory - #339

Merged
GeiserX merged 2 commits into
mainfrom
fix/nightly-macos-qwen
Oct 7, 2026
Merged

GeiserX merged 2 commits into
mainfrom
fix/nightly-macos-qwen

Conversation

@GeiserX

@GeiserX GeiserX commented Oct 7, 2026 •

Copy link
Copy Markdown
Owner

On GitHub's macOS runner the nightly died in the Qwen stage on three of the last four nights (runs 37111994427, 37296356046 and 37448592189) with qwen3-asr-1.7b is unavailable: The operation timed out. The night printed no summary and uploaded no latency table.

What the runs show:

  • The error comes from a FLEURS request in qwenRun, which uses the app's 120 s limit. The long-unit requests have 1,800 s, and the failing stage ended about 6 minutes after the previous server stopped. I ruled out a hidden 300 s limit in Bun's fetch: on Bun 1.4.2 a request to a server that waits 330 s gets its answer, both in-process and from a separate process with a 12 MB body.
  • The runner has 3 cores, 7 GB of memory and a paravirtual GPU, and it is short of memory. Two diagnostic dispatches logged the swap every minute. 2.7 GB of swap was in use before Qwen started, from the fp32 Parakeet the FLEURS stage never let go of. During the default-cache control only about 360 MB of swap was left. In a passing night, a 13 to 27 s clip took up to 94 s.
  • Before this, the warn lines that would say which request failed and why went nowhere: qwenRun and the long units passed no log.

The fix, all in scripts/eval/nightly.ts:

  • The FLEURS loop moves into fleursStage, and the recognizer is released (models.release()) before the next stage. A note records this process's memory before and after.
  • Each FLEURS request in the Qwen stage gets 600 s (QWEN_GATE.requestMs). The stage gates memory, WER and silence, not wall-clock time. The app's 120 s default is unchanged. A restart on the main server still fails the restarts row.
  • Every nightly Qwen engine logs a restart or a request it gave up on, with the time.

Evidence, dispatch 37554382699 on this branch (full night):

The macOS leg took about 2 h 8 min of its 150 min timeout.

Summary by CodeRabbit

  • Evaluation
    • Qwen evaluation requests now have a 10-minute timeout and timestamped logs.
    • FLEURS scoring and performance measurements are grouped into a dedicated stage, with memory usage recorded before and after recognizer release.

…requests room

On GitHub's macOS runner the fp32 recognizer sat in swap through the Qwen stage, and a FLEURS
request crossing the app's 120 s limit twice ended the night with no summary on three nights.
The nightly frees the recognizer, notes the process memory before and after, gives each clip
600 s, and logs any restart with its reason.
@coderabbitai

coderabbitai Bot commented Oct 7, 2026 •

Copy link
Copy Markdown

Review in Change Stack →

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration
  • Configuration used: Repository: GeiserX/akou/.coderabbit.yaml
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: 15782805-3314-49f0-8f9b-659b97ed4b65
📥 Commits

Reviewing files that changed from the base of the PR and between 39c8ebd and 68e7143.

📒 Files selected for processing (1)
  • scripts/eval/nightly.ts

Included review availability: This review used your included allowance. Your plan provides up to 1 included review per hour; 0 remain after this review.


📝 Walkthrough

Walkthrough

The nightly evaluation configures Qwen request timeouts and logging. It also moves FLEURS scoring and performance measurements into a stage, then releases the loaded models and records process memory.

Changes

Nightly evaluation

Layer / File(s) Summary
Qwen timeout and logging
scripts/eval/nightly.ts
QWEN_GATE adds a 600,000 ms request timeout. Qwen evaluations use that timeout and a timestamped logger.
FLEURS evaluation and cleanup
scripts/eval/nightly.ts
fleursStage evaluates English and Spanish utterances and records WER, latency percentiles, real-time factor, utterance counts, and audio duration. main calls the stage, releases loaded models, and records process memory.

Priority: ➖ Normal

Estimated code review effort: 3 (Moderate) | ~20 minutes

Change: Bug fix

Merge Risk: ⚪ Minimal · up to 68e71

This change only affects the nightly evaluation script. It raises the Qwen request timeout and frees model memory after the FLEURS stage, which should reduce macOS runner timeouts. No merge-blocking risk was found.

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 66.67% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 6 functions across 1 files. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (4 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title clearly describes the main change: stabilizing the Qwen stage in the macOS nightly run under memory constraints. It is somewhat long, but remains specific and relevant.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
  • Fix all pre-merge checks with AI
✨ Finishing Touches 💡 1
📝 Generate docstrings 💡
  • Commit to this branch
  • Create a new PR
🧪 Generate unit tests (beta)
  • Commit to this branch
  • Create a new PR
  • Autopilot · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@GeiserX
GeiserX merged commit 36a2237 into main Oct 7, 2026
29 checks passed
@GeiserX
GeiserX deleted the fix/nightly-macos-qwen branch October 7, 2026 03:23
GeiserX added a commit that referenced this pull request Oct 7, 2026
…S night's slow Qwen requests (#352)

The macOS nightly is red again (#349, run 37606036081). The Qwen stage gave up with `qwen3-asr-1.7b is unavailable: The operation timed out.` #339 gave FLEURS requests 600 s, and the night still died.

## Why #339 did not help

The request that fails is not a FLEURS clip. It is in the long unit, which already had a 30-minute limit. The order of `llama-server … exited` lines in the log shows this. The stage stops four servers in order (the 150-request run, the default-cache control, the long unit cut into pieces, the long unit uncut). On every red night the failure comes after the first two:

| run | control server stopped | first failure | gave up |
|---|---|---|---|
| 37111994427 (10-03) | 10:22:23 | 10:33:27 | 10:39:44 (+377 s) |
| 37296356046 (10-05) | 11:43:03 | 11:51:58 | 11:58:16 (+378 s) |
| 37448592189 (10-06) | 11:57:22 (the cut long unit passed, 12:02:43) | 12:13:15 | 12:19:34 (+379 s) |
| 37606036081 (10-07, with #339) | 12:00:48 | 12:11:35 | 12:17:56 (+381 s) |

The retry fails between 377 and 381 s after the restart on every night. That is a fixed clock, and none of the engine's limits (120, 600 or 1,800 s) matches it.

The clock is Bun's own. `fetch` gives up on a response that sends nothing for about 360 s. On Bun 1.4.2 a request to a server that answers after 420 s failed with `TimeoutError: The operation timed out.` after 360.3 s, with a 0 MB body and with a 12 MB one, even though its `AbortSignal.timeout` was 1,800 s. That is the same message an `AbortSignal` timeout gives. #339's check waited 330 s, which is under the limit. llama-server sends nothing until the whole answer is ready. A long-unit request on the 3-core runner can take more than 6 minutes. The retry then gives up after about 15 s of model load plus 360 s. A llama-server start of Qwen3-ASR-1.7B Q8_0 reached `/health` in 13 to 16 s on an Apple silicon Mac that was short of memory.

## The fix

- `QwenEngine` passes `timeout: false` to `fetch`. The caller's `timeoutMs` and its abort signal are now the only clocks on a request. The app's 120 s default does not change, so a dictation or a call's final pass behaves as before. Only a limit above 360 s (the nightly's 600 s and 30 minutes) now holds for its full length.
- The macOS leg's job limit goes from 150 to 200 minutes, and the Linux and Windows legs keep 150. A passing night took 128 minutes, and on 10-07 the long unit started 15 minutes later than on that night. Once the slow requests can finish, the old limit would end the night before the dictation stage.
- `QWEN_GATE.requestMs`'s comment no longer says FLEURS requests ended those nights.

There is no retry and no "unavailable on this runner" verdict. A real hang still fails at the engine's own limit, and a restart still fails the `restarts` row.

## Evidence

- New test, `a request waits its whole timeoutMs`: the engine runs in a child process with `BUN_CONFIG_HTTP_IDLE_TIMEOUT=1`, which makes Bun give up on a silent response after about 8 s, against a fake llama-server that answers after 10 s. Before the fix it failed with the night's own error: `qwen3-asr-1.7b is unavailable: The operation timed out.` after 16.1 s, once per attempt. With the fix it passes in 10.3 s, with one request.
- The 18 test files that use the fake llama-server or the Qwen engine: 220 pass, 0 fail. `check:static` is clean.
- A full night on this branch is running: https://github.com/GeiserX/akou/actions/runs/37677751848

Refs #349. The `report` job closes it on the next green night on main.
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.

1 participant