[PR #4928] [Engine] long --lookup-max-t windows over a layer split (opt-in, single conversation) #5253

Open
opened 2026-11-07 16:33:50 +07:00 by bsakaguchi · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/Niko1221/Strata/pull/4928
Author: @lyesrock
Created: 11/1/2026
Status: 🔄 Open

Base: main ← Head: f-qwen-lookup


📝 Commits (3)

  • d344d13 [Engine] allow long --lookup-max-t windows over a layer split (opt-in, single conversation)
  • 2106226 [Engine] STRATA_SPLIT_LONG_LOOKUP=1 also sizes the split hand-off for 16 rows and lets the draft policy keep the 9..16 lookup sizes; without the knob the split stays byte-identical to upstream
  • 91479d5 [Engine] STRATA_SPLIT_LONG_LOOKUP=1 also lets the staged verifier run the two-token-group layout past 8 rows (guard at verify.cpp:3257); off side byte-identical

📊 Changes

2 files changed (+20 additions, -6 deletions)

View changed files

📝 src/core/verify.cpp (+4 -2)
📝 src/program/generate.cpp (+16 -4)

📄 Description

The problem

On a two-GPU layer split, --lookup-max-t long prompt-lookup windows never run: three places clamp a
split to kVerifyNarrowT rows - the argument clamp at serve start, the draft policy's size mask in the
request loop, and a verifier guard ("windows past 8 tokens need one stage"). On 2x Tesla P40 (IQ3_S,
ctx 262144) that caps recopies at ~7 accepted tokens a window (20K-token code recopy: 60.3 tok/s),
while the same feature on one card - and on this box's older engine with its STRATA_LOOKUP=1 - ran
~14 tokens a window at 67-75 tok/s.

The approach

One opt-in knob, STRATA_SPLIT_LONG_LOOKUP=1 (single conversation: --batch <= 1, no
--pipeline-windows). Off, every path stays byte-identical to upstream. Four places, one per clamp:

  1. the argument clamp: o.spec may stay past kVerifyNarrowT when the knob is on;
  2. the split's hand-off buffers size to kVerifyLongT rows (and set_handoff_rows follows);
  3. the draft policy keeps its 9..16 window sizes on a single-conversation split;
  4. the verifier guard at src/core/verify.cpp:3257 yields: the two-token-group layout a long window
    runs as needs nothing else across stages - the hand-off is read and published whole-window.

Validation (2x Tesla P40, sm_61, CUDA 12.9, engine built from this branch)

Passed: start logs window sizes 1,2,3,4,5,8,12,16 and "long lookup windows ON over the layer split";
code recopy 1,744 tokens: 70.7-73.0 tok/s at 14.4-15.0 accepted a window vs 7.0 (102-105 windows
instead of ~195); 157,395-token recopy: 64.1 vs 61.1 (+5 %) at 14.4 vs 6.75; agent session decode
+6.5 %; the standard suite (chat/4K/16K) within run-to-run noise; greedy verbatim copies byte-identical
(6,014 chars in/out, every round); knob off reproduces the upstream numbers.

Live traffic since (same box, this build in serve, 100 real requests after start): 971 suffix-draft
windows at 10.5 offered tokens a window, 96 % accepted - past the upstream cap of 8 in everyday
use, not only in probes; copy-heavy requests decoded 60-72 tok/s against 40-45 for non-repeating
content, with the policy correctly keeping short windows there. One operational note: a request right
after a start reads short while the draft policy learns the long sizes; judge steady state.

Not run: correctness suites (speed only), HIP/SYCL/Metal builds, --batch or --pipeline-windows
paths (the gate refuses them). A first probe right after a start reads short while the policy learns -
judge the steady state. On one RTX 5090 the same feature (upstream, no this branch) is worth +19 % on
recopies: the win scales with how cheap a 16-row pass is on the card.


🔄 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/4928 **Author:** [@lyesrock](https://github.com/lyesrock) **Created:** 11/1/2026 **Status:** 🔄 Open **Base:** `main` ← **Head:** `f-qwen-lookup` --- ### 📝 Commits (3) - [`d344d13`](https://github.com/Niko1221/Strata/commit/d344d13889d81ec81a0ce9a5375c0c21a70184da) [Engine] allow long --lookup-max-t windows over a layer split (opt-in, single conversation) - [`2106226`](https://github.com/Niko1221/Strata/commit/21062269e99b08d68c147f6b9478a12e7b9fc380) [Engine] STRATA_SPLIT_LONG_LOOKUP=1 also sizes the split hand-off for 16 rows and lets the draft policy keep the 9..16 lookup sizes; without the knob the split stays byte-identical to upstream - [`91479d5`](https://github.com/Niko1221/Strata/commit/91479d510f3d505d94e778b3ddd4826b146bd1ac) [Engine] STRATA_SPLIT_LONG_LOOKUP=1 also lets the staged verifier run the two-token-group layout past 8 rows (guard at verify.cpp:3257); off side byte-identical ### 📊 Changes **2 files changed** (+20 additions, -6 deletions) <details> <summary>View changed files</summary> 📝 `src/core/verify.cpp` (+4 -2) 📝 `src/program/generate.cpp` (+16 -4) </details> ### 📄 Description ### The problem On a two-GPU layer split, `--lookup-max-t` long prompt-lookup windows never run: three places clamp a split to `kVerifyNarrowT` rows - the argument clamp at serve start, the draft policy's size mask in the request loop, and a verifier guard ("windows past 8 tokens need one stage"). On 2x Tesla P40 (IQ3_S, ctx 262144) that caps recopies at ~7 accepted tokens a window (20K-token code recopy: 60.3 tok/s), while the same feature on one card - and on this box's older engine with its `STRATA_LOOKUP=1` - ran ~14 tokens a window at 67-75 tok/s. ### The approach One opt-in knob, `STRATA_SPLIT_LONG_LOOKUP=1` (single conversation: `--batch <= 1`, no `--pipeline-windows`). Off, every path stays byte-identical to upstream. Four places, one per clamp: 1. the argument clamp: `o.spec` may stay past `kVerifyNarrowT` when the knob is on; 2. the split's hand-off buffers size to `kVerifyLongT` rows (and `set_handoff_rows` follows); 3. the draft policy keeps its 9..16 window sizes on a single-conversation split; 4. the verifier guard at `src/core/verify.cpp:3257` yields: the two-token-group layout a long window runs as needs nothing else across stages - the hand-off is read and published whole-window. ### Validation (2x Tesla P40, sm_61, CUDA 12.9, engine built from this branch) Passed: start logs `window sizes 1,2,3,4,5,8,12,16` and "long lookup windows ON over the layer split"; code recopy 1,744 tokens: 70.7-73.0 tok/s at **14.4-15.0 accepted a window vs 7.0** (102-105 windows instead of ~195); 157,395-token recopy: 64.1 vs 61.1 (**+5 %**) at 14.4 vs 6.75; agent session decode +6.5 %; the standard suite (chat/4K/16K) within run-to-run noise; greedy verbatim copies byte-identical (6,014 chars in/out, every round); knob off reproduces the upstream numbers. Live traffic since (same box, this build in serve, 100 real requests after start): 971 suffix-draft windows at **10.5 offered tokens a window, 96 % accepted** - past the upstream cap of 8 in everyday use, not only in probes; copy-heavy requests decoded 60-72 tok/s against 40-45 for non-repeating content, with the policy correctly keeping short windows there. One operational note: a request right after a start reads short while the draft policy learns the long sizes; judge steady state. Not run: correctness suites (speed only), HIP/SYCL/Metal builds, `--batch` or `--pipeline-windows` paths (the gate refuses them). A first probe right after a start reads short while the policy learns - judge the steady state. On one RTX 5090 the same feature (upstream, no this branch) is worth +19 % on recopies: the win scales with how cheap a 16-row pass is on the card. --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
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#5253
No description provided.