[PR #238] STRATA_GLM_WARM_PROMPT (off) runs one synthetic prompt before READY, so a session's first request doesn't pay the first-prompt cost (issue #8) #416

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

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

State: closed
Merged: No


What this changes

STRATA_GLM_WARM_PROMPT=N (off by default; N at least 32): with --serve, one synthetic prompt of N tokens runs through the whole part chain before the server prints READY. It exists for issue #8: the first prompt of every session read 95-133 ms/token against 23-44 warm. The first chunk carries every kernel's first launch, the prompt path's own allocations and the tiers' first reads, and no later prompt pays any of it.

The warm prompt costs about one chunk of the smallest part's size - a few seconds to ~15 s on a four-way split of a big model, beside the tiers' own 90-151 s warm-up at a start. Its ids are spread over the vocabulary so the routes are not one expert's. The state is zeroed right after it, so no conversation can see it (a request with no slot in use resets before its own prompt anyway), and glm fast: the prompt path is warm (N tokens in X ms, Y ms/token) marks it.

0 or unset is off. The default stays 0 because whether it wins is exactly what the first-prompt A/B with the knob on and off decides; the knob is how that is measured.

What it leaves alone

Default off: a server started without the variable behaves exactly as before and no synthetic prompt runs. Requests, the API and the config are untouched.

Measurements

From issue #8, the motivation: the first prompt of every session read 95-133 ms/token against 23-44 warm on the same conversation, the first request after a fresh start against later ones. The cost is one chunk of the smallest part, a few seconds to ~15 s here, beside the tiers' 90-151 s warm-up. This branch does not claim a win: the A/B with the knob on and off is the measurement it enables.

Checks

  • src/program/generate.cpp compiles clean with the build's own flags (nvcc 13.2, compute_86 + compute_120).
  • python3 tools/check_hip_compat.py passes.
  • Not run in this branch's preparation; the first-prompt A/B is the check.

🤖 Generated with Claude Code

**Original Pull Request:** https://github.com/mw00/project-maya/pull/238 **State:** closed **Merged:** No --- ## What this changes `STRATA_GLM_WARM_PROMPT=N` (**off by default**; `N` at least 32): with `--serve`, one synthetic prompt of `N` tokens runs through the whole part chain before the server prints READY. It exists for issue #8: the first prompt of every session read **95-133 ms/token against 23-44 warm**. The first chunk carries every kernel's first launch, the prompt path's own allocations and the tiers' first reads, and no later prompt pays any of it. The warm prompt costs about one chunk of the smallest part's size - a few seconds to ~15 s on a four-way split of a big model, beside the tiers' own 90-151 s warm-up at a start. Its ids are spread over the vocabulary so the routes are not one expert's. The state is zeroed right after it, so no conversation can see it (a request with no slot in use resets before its own prompt anyway), and `glm fast: the prompt path is warm (N tokens in X ms, Y ms/token)` marks it. `0` or unset is off. The default stays 0 because whether it wins is exactly what the first-prompt A/B with the knob on and off decides; the knob is how that is measured. ## What it leaves alone Default off: a server started without the variable behaves exactly as before and no synthetic prompt runs. Requests, the API and the config are untouched. ## Measurements From issue #8, the motivation: the first prompt of every session read **95-133 ms/token against 23-44 warm** on the same conversation, the first request after a fresh start against later ones. The cost is one chunk of the smallest part, a few seconds to ~15 s here, beside the tiers' 90-151 s warm-up. This branch does not claim a win: the A/B with the knob on and off is the measurement it enables. ## Checks - `src/program/generate.cpp` compiles clean with the build's own flags (nvcc 13.2, compute_86 + compute_120). - `python3 tools/check_hip_compat.py` passes. - Not run in this branch's preparation; the first-prompt A/B is the check. 🤖 Generated with [Claude Code](https://claude.com/claude-code)
bsakaguchi 2026-10-29 21:25:09 +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#416
No description provided.