[PR #232] GLM prompt: short prompts from 8 tokens take the batched path on one GPU (was 32) - agent turns -34% prompt time #410

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

Original Pull Request: https://github.com/mw00/project-maya/pull/232

State: closed
Merged: Yes


On one GPU, a prompt of 8 tokens or more now goes through the batched prompt path; the threshold was 32. A split keeps 32, and STRATA_GLM_PREFILL_MIN still overrides it.

Agent sessions send many short follow-up turns. Those are often between 8 and 32 tokens, and with the old threshold they went through the token path one step per token.

Measured on Maya-S24, one V100 32 GB, cooled runs. The test is the later turns of a session that keeps 13.5K tokens of history, each adding a short user turn (tools/glm_turns.py, added here).

This branch, rebased on main 3650d0d:

STRATA_GLM_PREFILL_MIN Prompt ms per turn (3 turns)
32 (old default) 1,108 / 658 / 536
8 (new default) 529 / 406 / 578

Earlier runs on my branch (two rounds): 1,041 / 648 / 521 and 1,055 / 641 / 531 ms at 32, against 488 / 405 / 577 and 514 / 392 / 578 at 8. A threshold of 4 behaved like 8, and 16 was worse (502 / 716 / 540).

tools/glm_turns.py PACK_DIR [BINARY] reproduces the measurement and passes the STRATA_GLM_* environment through.

**Original Pull Request:** https://github.com/mw00/project-maya/pull/232 **State:** closed **Merged:** Yes --- On one GPU, a prompt of 8 tokens or more now goes through the batched prompt path; the threshold was 32. A split keeps 32, and `STRATA_GLM_PREFILL_MIN` still overrides it. Agent sessions send many short follow-up turns. Those are often between 8 and 32 tokens, and with the old threshold they went through the token path one step per token. **Measured** on Maya-S24, one V100 32 GB, cooled runs. The test is the later turns of a session that keeps 13.5K tokens of history, each adding a short user turn (`tools/glm_turns.py`, added here). This branch, rebased on main 3650d0d: | `STRATA_GLM_PREFILL_MIN` | Prompt ms per turn (3 turns) | |---|---| | 32 (old default) | 1,108 / 658 / 536 | | 8 (new default) | **529 / 406 / 578** | Earlier runs on my branch (two rounds): 1,041 / 648 / 521 and 1,055 / 641 / 531 ms at 32, against 488 / 405 / 577 and 514 / 392 / 578 at 8. A threshold of 4 behaved like 8, and 16 was worse (502 / 716 / 540). `tools/glm_turns.py PACK_DIR [BINARY]` reproduces the measurement and passes the `STRATA_GLM_*` environment through.
bsakaguchi 2026-10-29 21:25:06 +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#410
No description provided.