[PR #323] [MERGED] GLM several conversations: ERR for a request whose admission fails to drain, and two STOP fixes #469

Closed
opened 2026-10-29 21:25:46 +07:00 by bsakaguchi · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/mw00/project-maya/pull/323
Author: @somnergy
Created: 10/20/2026
Status: ✅ Merged
Merged: 10/21/2026
Merged by: @mw00

Base: main ← Head: pr/scheduler-admission-fixes


📝 Commits (1)

  • b0bc877 GLM several conversations: ERR for a request whose admission fails to drain, and two STOP fixes

📊 Changes

1 file changed (+10 additions, -2 deletions)

View changed files

📝 src/program/generate.cpp (+10 -2)

📄 Description

What

Three fixes in the several-conversations scheduler (--parallel > 1, glm_pack_generate). No new setting; nothing a request computes changes.

  1. A failed drain at admission now answers the request being admitted. Before reading a new prompt, gen_admit drains the running requests (multi_drain, resolve_ready). When that failed (an engine error), multi_fail sent ERR <rid> to every running request but not to the new one: its GEN line had already been read, so its client waited for a DONE or ERR that never came. It now gets the same ERR <rid> <why>.
  2. STOP / PAUSE lines without a valid id are ignored. The reader compares a line's id with admitting_rid, which is -1 while no prompt is being read. STOP -1 therefore set stop_req, which every running request reads as its own stop, and all of them ended as cancelled. A line whose id does not parse or is negative is now dropped. The bundled server only sends positive ids; this guards the engine's stdin protocol for any other front end.
  3. A failed admission drops its control entry. A STOP <rid> that arrived while the request's prompt was being read stayed in the control map when the admission then failed (the prompt path returned an error). A finished request's end (gen_finish) already erases its entry; the failed admission now does the same. It only matters to a front end that reuses request ids.

How it was verified

The setup: 2x RTX PRO 5000 Blackwell 72 GB, GLM-5.3-Flash EXL3 3.1 bpw, split rows 4, --parallel 8 at 512K, KV streaming, int8 KV, greedy. main and this branch were built the same way with nvcc 13.4.

  • CI checks: the HIP-name check, the server tests and the installer and tools tests pass. The C++ tests on the GPU give the same pass/fail set as main.
  • Unchanged output: a workload where 4 greedy decoders run while a ~90K-token prompt is read gave identical text on main and on this branch. The workload includes the STOP paths this touches: a read cancelled 8 s in, a decoding request whose client disconnects mid-read, and a request queued behind the read.
  • Fix 2, before / after: one greedy request for 300 tokens, with one line written to the engine's stdin after ~40 tokens:
line main this branch
STOP -1 cancelled at 44 tokens 300 tokens
PAUSE -1 cancelled at 43 tokens 300 tokens
STOP x 300 tokens 300 tokens
  • Fixes 1 and 3: they need an engine error during the drain, or a failed admission with a pending STOP. No workload here triggers either, so they rest on the code; they are a few lines each.

The validation logs and a summary of them follow in a comment.


🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/mw00/project-maya/pull/323 **Author:** [@somnergy](https://github.com/somnergy) **Created:** 10/20/2026 **Status:** ✅ Merged **Merged:** 10/21/2026 **Merged by:** [@mw00](https://github.com/mw00) **Base:** `main` ← **Head:** `pr/scheduler-admission-fixes` --- ### 📝 Commits (1) - [`b0bc877`](https://github.com/mw00/project-maya/commit/b0bc8776aa48c44cf406c2d532f5c713132483f6) GLM several conversations: ERR for a request whose admission fails to drain, and two STOP fixes ### 📊 Changes **1 file changed** (+10 additions, -2 deletions) <details> <summary>View changed files</summary> 📝 `src/program/generate.cpp` (+10 -2) </details> ### 📄 Description ## What Three fixes in the several-conversations scheduler (`--parallel` > 1, `glm_pack_generate`). No new setting; nothing a request computes changes. 1. **A failed drain at admission now answers the request being admitted.** Before reading a new prompt, `gen_admit` drains the running requests (`multi_drain`, `resolve_ready`). When that failed (an engine error), `multi_fail` sent `ERR <rid>` to every running request but not to the new one: its `GEN` line had already been read, so its client waited for a `DONE` or `ERR` that never came. It now gets the same `ERR <rid> <why>`. 2. **`STOP` / `PAUSE` lines without a valid id are ignored.** The reader compares a line's id with `admitting_rid`, which is `-1` while no prompt is being read. `STOP -1` therefore set `stop_req`, which every running request reads as its own stop, and all of them ended as cancelled. A line whose id does not parse or is negative is now dropped. The bundled server only sends positive ids; this guards the engine's stdin protocol for any other front end. 3. **A failed admission drops its control entry.** A `STOP <rid>` that arrived while the request's prompt was being read stayed in the control map when the admission then failed (the prompt path returned an error). A finished request's end (`gen_finish`) already erases its entry; the failed admission now does the same. It only matters to a front end that reuses request ids. ## How it was verified The setup: 2x RTX PRO 5000 Blackwell 72 GB, GLM-5.3-Flash EXL3 3.1 bpw, split rows 4, `--parallel 8` at 512K, KV streaming, int8 KV, greedy. `main` and this branch were built the same way with nvcc 13.4. - **CI checks:** the HIP-name check, the server tests and the installer and tools tests pass. The C++ tests on the GPU give the same pass/fail set as main. - **Unchanged output:** a workload where 4 greedy decoders run while a ~90K-token prompt is read gave identical text on main and on this branch. The workload includes the STOP paths this touches: a read cancelled 8 s in, a decoding request whose client disconnects mid-read, and a request queued behind the read. - **Fix 2, before / after:** one greedy request for 300 tokens, with one line written to the engine's stdin after ~40 tokens: | line | main | this branch | |---|---|---| | `STOP -1` | cancelled at 44 tokens | 300 tokens | | `PAUSE -1` | cancelled at 43 tokens | 300 tokens | | `STOP x` | 300 tokens | 300 tokens | - **Fixes 1 and 3:** they need an engine error during the drain, or a failed admission with a pending STOP. No workload here triggers either, so they rest on the code; they are a few lines each. The validation logs and a summary of them follow in a comment. --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
bsakaguchi 2026-10-29 21:25:46 +07:00
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#469
No description provided.