Skip to content

qwen35 session: #4274 headroom doubles a 32k turn to 65536 positions — 27B OOMs and silently falls back to CPU #4443

Open

Description

@noahgift

Regression in #4318 (0.69.4 batch), introduced by 90f8ec7 (#4274 fix). Found by the CRUX #4223 cells.

grown_capacity doubles MIN_CAPACITY until the turn fits, then clamps to self.context_length. That clamp is the GGUF's {arch}.context_length, which is 262144 for Qwen3.5, not the server's --context-length, so it never applies. A 32.8k-token turn now asks for 65536 positions, where the pre-fix code asked for exactly 32782.

Qwen3.5-27B Q4_K_M on an RTX 4090 (apr serve run --context-length 34816 --backend cuda --gpu-layers all, apr 0.69.4 90f8ec7, exe sha 3f67ab9d1d09):

[qwen35] batched prefill: 4106 tokens in 7032 ms (584 tok/s, chunk 512 rows, attention cuBLAS f32, from position 0)
warning: GPU (CUDA) qwen35 path rejected, falling back to CPU: a decode state for 65536 positions would not allocate: ... GPU memory allocation failed: CUDA driver error

After that the p32k request ran on the CPU and hit the 900 s client timeout. llamafile 0.10.6 finishes the same prompt in 15.6 s on the same GPU.

Two defects

  1. Headroom is an optimisation, yet failing to allocate it demotes the whole session to the CPU. The fix is to retry at exactly positions before falling back.
  2. The session clamps to the GGUF context rather than the server's --context-length. That is secondary, and plumbing the served context through fixes it.

Falsifier: 27B at p32k on the RC binary must print batched prefill: ~32.8k tokens ... from position 0 with no falling back to CPU line.

Activity

  1. added this to the 0.69.5 milestone on Sep 25, 2026
  2. added 2 commits that reference this issue on Sep 25, 2026
  3. noahgift commented on Sep 25, 2026

    @noahgift
    MemberAuthor

    e2e receipt — fix at c13a233 (in #4318 head dded9c7, quorum 3/3 PASS)

    Binary apr 0.69.5 (d1bb4d9f4), bin sha256 f0dcd183…. c13a233 changes only #[cfg(test)] code on top of d1bb4d9, so the release build is identical. Model: Qwen3.5-27B-Q4_K_M (gguf 84b5f7f1…) on an RTX 4090, gpu-layers resolved=64/64 (backend=cuda). Two runs, the second on a clean GPU (936 MiB foreign).

  4. added 3 commits that reference this issue on Sep 26, 2026
  5. modified the milestones: 0.69.5, 0.71.0 on Oct 4, 2026
  6. noahgift commented on Oct 14, 2026

    @noahgift
    MemberAuthor

    merged into #5312 (master ticket for epic #3994; triage rule 7b, 2026-10-14). It is a checklist row there; reopen this issue when work on it starts or its PR opens.

  7. noahgift commented on Oct 14, 2026

    @noahgift
    MemberAuthor

    Moved: this sub-ticket is now a row in #5325 (apr on GPU: refuse by name before OOM, never fall back to CPU silently), split out of #5312 by theme.

  8. modified the milestones: 0.71.0, 0.73.0 on Oct 27, 2026
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

    P1High priorityowner:la-0.71Owned by the 0.71 look-ahead slotsize:MK̂ 3-4 h

    Type

    No type

    Projects

    No projects

      Milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions