[PR #2832] [CLOSED] serve: STRATA_WARM_PROMPT (off) reads one synthetic prompt before READY #4289

Closed
opened 2026-11-07 15:34:36 +07:00 by bsakaguchi · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/Niko1221/Strata/pull/2832
Author: @gopinath87607
Created: 10/17/2026
Status: ❌ Closed

Base: main ← Head: prefill-warm-prompt


📝 Commits (1)

  • 5abf08c serve: STRATA_WARM_PROMPT (off) reads one synthetic prompt before READY

📊 Changes

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

View changed files

📝 docs/DETAILS.md (+11 -0)
📝 src/program/generate.cpp (+135 -0)

📄 Description

What this changes

STRATA_WARM_PROMPT=N (--serve, off by default): one synthetic prompt of N tokens (32 if you ask for less) is read
through the whole part chain before the engine says READY, so a session's first request does not pay what only a
session's first prompt pays — 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. STRATA_GLM_WARM_PROMPT is accepted as the same
knob.

The synthetic ids are spread over the vocabulary (100 + (i * 131) % 20000), so the routes are not one expert's. It
takes the same loan a request takes (the slots the prompt path is laid out in go non-resident and are refilled from
the arena afterwards), and every participant's state is zeroed before and after it, so no conversation can see it. A
prompt path that cannot run prints why and the first prompt pays it; the start never fails because of it.

From the Maya checkout (project-maya), local commit cc58309 (2026-10-14).

What it leaves alone

Unset or 0 (the default), the whole block is skipped and the engine says READY exactly as before. Nothing outside
the block changes; this is by construction.

Measurements

  • Reported on 4× RTX 5080 16 GB (2026-10-17, blange48; not run by us): it does what it says. Linux, layer split
    12,24,36, Qwen3.8-Flash-Next IQ3_S, --batch 8 --batch-groups 4 (v0.1.45 + this PR + #2673), one run per case,
    warm page cache. Time to READY: 102 s unset vs 101 s at STRATA_WARM_PROMPT=512. First request (a ~325-token
    prompt), time to first token: 1.00 s unset vs 0.72 s at 512. Later requests were unaffected.
  • The Maya checkout's issue #8 reported 95–133 ms/token on a first prompt against 23–44 warm — that checkout's number
    on its rig.
  • On this engine the knob is how you measure it: the first request's time to first token, or its PP line, with the
    variable set and unset is the A/B.
  • The report's build also carried #2673, whose different-greedy-answers issue is being looked at there; this PR was
    off in those comparisons, so it does not look involved.
  • What the report does not cover: our own hardware (we have not run it), more than one run per case, or a start with
    a cold page cache.

Checks

  • Default path: unset = off by construction (wn = 0 skips the block).
  • Build: src/program/generate.cpp compiles clean against this branch's headers with the build's own flags
    (-fsyntax-only; one pre-existing unused-variable warning in unrelated code). The development branch that also
    carries the change built fully with ninja (CUDA 13.2).
  • HIP / SYCL: not compiled here (no toolchain on the machine). generate.cpp carries no per-backend code, so both
    builds compile the same change.
  • On a start: the engine prints strata serve: warming the prompt path with a N-token prompt before READY.

🤖 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/Niko1221/Strata/pull/2832 **Author:** [@gopinath87607](https://github.com/gopinath87607) **Created:** 10/17/2026 **Status:** ❌ Closed **Base:** `main` ← **Head:** `prefill-warm-prompt` --- ### 📝 Commits (1) - [`5abf08c`](https://github.com/Niko1221/Strata/commit/5abf08cb453a039e3187aa3d444c39784920f282) serve: STRATA_WARM_PROMPT (off) reads one synthetic prompt before READY ### 📊 Changes **2 files changed** (+146 additions, -0 deletions) <details> <summary>View changed files</summary> 📝 `docs/DETAILS.md` (+11 -0) 📝 `src/program/generate.cpp` (+135 -0) </details> ### 📄 Description ## What this changes `STRATA_WARM_PROMPT=N` (`--serve`, off by default): one synthetic prompt of N tokens (32 if you ask for less) is read through the whole part chain **before the engine says READY**, so a session's first request does not pay what only a session's first prompt pays — 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. `STRATA_GLM_WARM_PROMPT` is accepted as the same knob. The synthetic ids are spread over the vocabulary (`100 + (i * 131) % 20000`), so the routes are not one expert's. It takes the same loan a request takes (the slots the prompt path is laid out in go non-resident and are refilled from the arena afterwards), and every participant's state is zeroed before and after it, so no conversation can see it. A prompt path that cannot run prints why and the first prompt pays it; the start never fails because of it. From the Maya checkout (`project-maya`), local commit `cc58309` (2026-10-14). ## What it leaves alone Unset or `0` (the default), the whole block is skipped and the engine says READY exactly as before. Nothing outside the block changes; this is by construction. ## Measurements - **Reported on 4× RTX 5080 16 GB (2026-10-17, blange48; not run by us): it does what it says.** Linux, layer split 12,24,36, Qwen3.8-Flash-Next IQ3_S, `--batch 8 --batch-groups 4` (v0.1.45 + this PR + #2673), one run per case, warm page cache. Time to READY: **102 s unset vs 101 s** at `STRATA_WARM_PROMPT=512`. First request (a ~325-token prompt), time to first token: **1.00 s unset vs 0.72 s** at 512. Later requests were unaffected. - The Maya checkout's issue #8 reported 95–133 ms/token on a first prompt against 23–44 warm — that checkout's number on its rig. - On this engine the knob is how you measure it: the first request's time to first token, or its `PP` line, with the variable set and unset is the A/B. - The report's build also carried #2673, whose different-greedy-answers issue is being looked at there; this PR was off in those comparisons, so it does not look involved. - What the report does not cover: our own hardware (we have not run it), more than one run per case, or a start with a cold page cache. ## Checks - **Default path:** unset = off by construction (`wn = 0` skips the block). - **Build:** `src/program/generate.cpp` compiles clean against this branch's headers with the build's own flags (`-fsyntax-only`; one pre-existing unused-variable warning in unrelated code). The development branch that also carries the change built fully with ninja (CUDA 13.2). - **HIP / SYCL:** not compiled here (no toolchain on the machine). `generate.cpp` carries no per-backend code, so both builds compile the same change. - **On a start:** the engine prints `strata serve: warming the prompt path with a N-token prompt before READY`. 🤖 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-11-07 15:34:36 +07:00
Sign in to join this conversation.
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
Niko1221/Strata#4289
No description provided.