mirror of
https://github.com/Niko1221/Strata.git
synced 2026-12-03 19:03:30 +07:00
[GH-ISSUE #4585] [Engine] Opt-in: keep the conversation already read when a request switches the control vector on or off #2075
Labels
No labels
needs-format
pull-request
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
Niko1221/Strata#2075
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Originally created by @dinolupo on GitHub (Oct 29, 2026).
Original GitHub issue: https://github.com/Niko1221/Strata/issues/4585
Area
[Engine]
What do you want to do?
Switch a loaded control vector on and off between turns of one conversation without the engine reading the whole conversation again.
Today a request whose
experimental_speed_projectiondiffers from the previous one drops the live session and its checkpoints (src/program/generate.cpp:14427-14430at46c152a1,live_ok = false; checks.clear();), and the conversation cache only offers entries saved in the same state (ConversationCache::best(..., cvec),include/strata/core/conversation_cache.hpp:312). That is the right default: switched off, the output is token for token the stock model's (docs/DETAILS.md, "Experimental speed projection").Some users want the other behavior, the one antirez's ds4 has with
/steer: the scale changes between turns and the session is kept. The cells already read keep the state they were read with, only the new tokens get the new state. A typical use is steering the start of a conversation and then switching the vector off for the rest, or the other way round, on a long agent context.Proposed behavior, opt-in, default unchanged (name up to you; locally I called it
--dir-steering-keep-cache):Without the option nothing changes: same cache keys, same drops, same output.
I have this working as a local patch on engine 0.1.45 (two files,
generate.cpponly for this part, about 30 lines). Onmainthe same idea also has to cover the paths added since then: the slot checkpoint move (STRATA_SLOT_CKPT_MOVE), borrowed checkpoints and the async park drops (drops_allincludeswant_cvec != cvec_cached). I would keep all of them on the current rule (own state only) and change just the live session and whole parked conversations.Tradeoffs
cvec_set_enabled: the switch still happens between requests.Related: #4465 / #4466 (
cvec auto) want the same thing for the automatic gate ("No re-prefill when the gate flips"), and list as an open point that steered decode rows end up in a stock-tagged cache. This proposal is the explicit, user-chosen version for the plaintrue/falseswitch, and does not depend onauto. If you prefer one mechanism for both, I am happy to align with whatever stamp you choose there.Measured (local patch on engine 0.1.45, 2× Pascal: GTX 1080 Ti 11 GB + GTX 1070 8 GB, Swift 1.5 IQ2_XS pack, a project-mode vector on layers 4-44, 22/10/2026):
main.Not measured yet: prefill time saved per switch. For scale, on this machine a 15K-token prompt takes about 95-98 s to read (v0.2.7.1, median of 3, temperature 0), which is what every switch costs today on a long conversation.
If the scope is fine, I would open one PR against
mainwith the option, a server-level test (three turns on/off/off: resume reported in the log, prefill limited to the new message; same conversation without the option = today's behavior) and a line in DETAILS.md.What do you do today instead?
A locally patched engine on 0.1.45. On the released engine the only choices are paying a full re-read at every switch, or running two engines (one with the vector, one without), which doubles memory and does not share the conversation.
@Niko1221 commented on GitHub (Nov 5, 2026):
Thanks for taking the time to report this.
Strata has changed a lot since this was opened, and 0.2.11 is out now, so many older reports no longer apply. We're closing issues older than a week that have had no new reports in the last week. Closed here does not mean rejected.
To reopen it takes about two minutes:
/reopen. A check runs and either reopens the issue or lists what is still missing.The rules are in CONTRIBUTING.md.