[GH-ISSUE #351] After ~68 requests the server answers 'exceeds the context (0)' to every request, until restarted (v1.1.20, 4x3090) #140

Closed
opened 2026-10-29 21:21:29 +07:00 by bsakaguchi · 1 comment
Owner

Originally created by @jorgermp on GitHub (Oct 21, 2026).
Original GitHub issue: https://github.com/mw00/project-maya/issues/351

After ~68 requests the server starts answering prompt (...) + max tokens (...) exceeds the context (0) to every request, until it is restarted

Version: v1.1.20 (commit 35bb2b2), GLM-5.3-Flash Maya-S24 (IQ2_XXS, 3 shards), 4x RTX 3090, layer split auto, --max-context 131072, --parallel default (1), CUDA 12.8, driver 595.84, Linux.

Related to but distinct from #314 (that one was requests leaving the queue; this one is the slot's context going to zero).

What happens

I generate 164 HumanEval+ samples serially, one request at a time, max_tokens=1024, temperature=0, enable_thinking: false, reasoning_effort: "off". Nothing concurrent, no client ever disconnects.

The first 68 requests succeed. From the 69th on, every single request fails with the same 400:

prompt (93 tokens) + max tokens (1024) exceeds the context (0); requests are ...

The processing order is unambiguous:

requests   1- 68: oooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooo   (all OK)
requests  69-164: XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX   (all fail)

It never recovers. The client keeps asking, the server keeps answering context (0).

Why this looks like a slot leak and not a size problem

  • The prompt is 93 tokens and --max-context is 131072. There is no arithmetic under which 93 + 1024 exceeds 131072.
  • The reported context is 0, not a small number or a negative. The slot reports having no context at all.
  • Immediately before the failures the same server answered 68 requests with the same prompt size and the same max_tokens.
  • A freshly started server does the same 164 requests until exactly the same point, so it is a count of requests, not a clock or a particular input.
  • Thinking is disabled (enable_thinking: false, reasoning_effort: "off"), so it is not the thinking budget consuming the slot.

context (0) reads like the KV slot's size being read after it was released — a second use of a freed slot, or a slot counter that stops advancing once it wraps.

What v1.1.20 already fixed, and what it did not

I tested v1.1.20 specifically because #314's fix (a request whose client went away now leaves the queue at once) sounded like the same failure mode. It is not: in my run no client ever went away, no request timed out, and the queue never filled. The server is healthy and responsive — it just refuses everything with context (0).

Reproduction

Any serial loop of ~70+ completions against one server. Mine:

for task in human_eval_plus_tasks:              # 164 of them, one at a time
    client.chat.completions.create(
        model="glm-5.3-flash", temperature=0.0, max_tokens=1024,
        messages=[{"role": "user", "content": prompt}],
        extra_body={"enable_thinking": False, "reasoning_effort": "off"})

Config: --glm-pack <pack> --max-context 131072 --expert-cache auto --prefill auto --kv-streaming on --expert-profile <bin>, layer_split: "auto" on 4 GPUs.

Note on --kv-streaming on

I have not yet tested whether turning --kv-streaming off changes the threshold. If it helps you narrow it down I can re-run the same loop with it off, with --parallel 2, or with a smaller --max-context, and send the exact request number where it flips — just say which variant is most useful.

Side note (may be unrelated)

During the same run one GPU fell off the bus (Xid 79, then Xid 154 requiring a node reboot). It was the GPU furthest down the layer split. It may be my hardware (this box had PCIe link errors before, now fixed by forcing Gen3), but I mention it in case the split's hand-off could surface a device error as a slot failure.

Happy to run anything you want on this machine and send back full logs.

Originally created by @jorgermp on GitHub (Oct 21, 2026). Original GitHub issue: https://github.com/mw00/project-maya/issues/351 ## After ~68 requests the server starts answering `prompt (...) + max tokens (...) exceeds the context (0)` to every request, until it is restarted **Version:** v1.1.20 (commit `35bb2b2`), GLM-5.3-Flash Maya-S24 (IQ2_XXS, 3 shards), 4x RTX 3090, layer split `auto`, `--max-context 131072`, `--parallel` default (1), CUDA 12.8, driver 595.84, Linux. Related to but distinct from #314 (that one was requests leaving the queue; this one is the slot's context going to zero). ### What happens I generate 164 HumanEval+ samples serially, one request at a time, `max_tokens=1024`, `temperature=0`, `enable_thinking: false`, `reasoning_effort: "off"`. Nothing concurrent, no client ever disconnects. The first **68 requests succeed**. From the 69th on, **every single request** fails with the same 400: ``` prompt (93 tokens) + max tokens (1024) exceeds the context (0); requests are ... ``` The processing order is unambiguous: ``` requests 1- 68: oooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooo (all OK) requests 69-164: XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX (all fail) ``` It never recovers. The client keeps asking, the server keeps answering `context (0)`. ### Why this looks like a slot leak and not a size problem - The prompt is **93 tokens** and `--max-context` is **131072**. There is no arithmetic under which 93 + 1024 exceeds 131072. - The reported context is **0**, not a small number or a negative. The slot reports having no context at all. - Immediately before the failures the same server answered 68 requests with the same prompt size and the same `max_tokens`. - A freshly started server does the same 164 requests until exactly the same point, so it is a count of requests, not a clock or a particular input. - Thinking is disabled (`enable_thinking: false`, `reasoning_effort: "off"`), so it is not the thinking budget consuming the slot. `context (0)` reads like the KV slot's size being read after it was released — a second use of a freed slot, or a slot counter that stops advancing once it wraps. ### What v1.1.20 already fixed, and what it did not I tested v1.1.20 specifically because #314's fix (a request whose client went away now leaves the queue at once) sounded like the same failure mode. It is not: in my run no client ever went away, no request timed out, and the queue never filled. The server is healthy and responsive — it just refuses everything with `context (0)`. ### Reproduction Any serial loop of ~70+ completions against one server. Mine: ```python for task in human_eval_plus_tasks: # 164 of them, one at a time client.chat.completions.create( model="glm-5.3-flash", temperature=0.0, max_tokens=1024, messages=[{"role": "user", "content": prompt}], extra_body={"enable_thinking": False, "reasoning_effort": "off"}) ``` Config: `--glm-pack <pack> --max-context 131072 --expert-cache auto --prefill auto --kv-streaming on --expert-profile <bin>`, `layer_split: "auto"` on 4 GPUs. ### Note on `--kv-streaming on` I have not yet tested whether turning `--kv-streaming` off changes the threshold. If it helps you narrow it down I can re-run the same loop with it off, with `--parallel 2`, or with a smaller `--max-context`, and send the exact request number where it flips — just say which variant is most useful. ### Side note (may be unrelated) During the same run one GPU fell off the bus (`Xid 79`, then `Xid 154` requiring a node reboot). It was the GPU furthest down the layer split. It may be my hardware (this box had PCIe link errors before, now fixed by forcing Gen3), but I mention it in case the split's hand-off could surface a device error as a slot failure. Happy to run anything you want on this machine and send back full logs.
Author
Owner

@mw00 commented on GitHub (Oct 23, 2026):

Fixed in v1.1.25. The cause was on our side: when the engine died (here most likely with the GPU that fell off the bus) and its restart failed, the server's idea of the context was left at 0, so every later request failed its size check before the next restart was even tried. Now each request tries to start the engine again, or reports why it cannot. Thank you for the very clear report!

<!-- gh-comment-id:6360199052 --> @mw00 commented on GitHub (Oct 23, 2026): Fixed in [v1.1.25](https://github.com/mw00/project-maya/releases/tag/v1.1.25). The cause was on our side: when the engine died (here most likely with the GPU that fell off the bus) and its restart failed, the server's idea of the context was left at 0, so every later request failed its size check before the next restart was even tried. Now each request tries to start the engine again, or reports why it cannot. Thank you for the very clear report!
Sign in to join this conversation.
No labels
pull-request
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
mw00/project-maya#140
No description provided.