[PR #285] [MERGED] glm fast: warm up the prompt path before READY #444

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

📋 Pull Request Information

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

Base: main ← Head: pr/warm-prompt


📝 Commits (1)

  • 5626b9a glm fast: STRATA_GLM_WARM_PROMPT (default 0 = off, 32 or more) runs one synthetic prompt through the whole part chain before READY, so a session's first request does not pay what only a session's first prompt pays (issue #8: 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. It costs about one chunk of the smallest part's size (a few seconds to ~15 s here, 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, and 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). The default stays 0: whether it wins is what the first-prompt A/B with the knob on and off decides, and the knob is how that is measured

📊 Changes

2 files changed (+30 additions, -0 deletions)

View changed files

📝 docs/SETTINGS.md (+1 -0)
📝 src/program/generate.cpp (+29 -0)

📄 Description

Why this PR was recreated. The original (#238) was opened from the gopinath87607/ewaste-maya fork. Deleting that fork deleted its branches, and GitHub closes every pull request whose branch lived in a deleted fork - a closed PR whose source branch is gone cannot be reopened. This is the same work from a new fork (gopinath87607/project-maya), rebased onto current main (v1.1.16 renamed the settings to MAYA_*; that rename is resolved in docs/SETTINGS.md and the code still reads the STRATA_* spelling the alias sets). It replaces the closed #238, which was closed by the fork's deletion, not by a maintainer.


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


🔄 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/285 **Author:** [@gopinath87607](https://github.com/gopinath87607) **Created:** 10/20/2026 **Status:** ✅ Merged **Merged:** 10/20/2026 **Merged by:** [@mw00](https://github.com/mw00) **Base:** `main` ← **Head:** `pr/warm-prompt` --- ### 📝 Commits (1) - [`5626b9a`](https://github.com/mw00/project-maya/commit/5626b9ae8ddff164d109a649a34dc3d526736eaa) glm fast: STRATA_GLM_WARM_PROMPT (default 0 = off, 32 or more) runs one synthetic prompt through the whole part chain before READY, so a session's first request does not pay what only a session's first prompt pays (issue #8: 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. It costs about one chunk of the smallest part's size (a few seconds to ~15 s here, 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, and 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). The default stays 0: whether it wins is what the first-prompt A/B with the knob on and off decides, and the knob is how that is measured ### 📊 Changes **2 files changed** (+30 additions, -0 deletions) <details> <summary>View changed files</summary> 📝 `docs/SETTINGS.md` (+1 -0) 📝 `src/program/generate.cpp` (+29 -0) </details> ### 📄 Description > **Why this PR was recreated.** The original (#238) was opened from the `gopinath87607/ewaste-maya` fork. Deleting that fork deleted its branches, and GitHub closes every pull request whose branch lived in a deleted fork - a closed PR whose source branch is gone cannot be reopened. This is the same work from a new fork (`gopinath87607/project-maya`), rebased onto current `main` (v1.1.16 renamed the settings to `MAYA_*`; that rename is resolved in `docs/SETTINGS.md` and the code still reads the `STRATA_*` spelling the alias sets). It replaces the closed #238, which was closed by the fork's deletion, not by a maintainer. --- ## 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) --- <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:30 +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#444
No description provided.