mirror of
https://github.com/mw00/project-maya.git
synced 2026-12-03 21:08:26 +07:00
[PR #126] [CLOSED] Keep and share cached conversation state #355
Labels
No labels
pull-request
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
mw00/project-maya#355
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?
📋 Pull Request Information
Original PR: https://github.com/mw00/project-maya/pull/126
Author: @ksanislo
Created: 10/12/2026
Status: ❌ Closed
Base:
main← Head:pr-keep-context📝 Commits (10+)
26db976multi bench: every sequence against its own run alone4c45af1Slots load whatever split wrote themdad8783multi: a paused request's snapshot checks its own pictures, not the last GEN'sb8f3c7cserve: per-request progress records; a request's own DONE via the engine's thread-local5e2497aMonitor: several answers at once show each one's phase and counte01115aMonitor: a Conversations card for several at once; the live rate comes down when output stops8112fa4Monitor: the hero's decode, prefill and context are the totals nowdd3a658Monitor: the Conversations card keeps the last ones that ended70fb159multi: the prompt being read has its own cancel flag; a failure resets only the failed requests' contextsb42362aPrompt path: a cancelled prompt keeps what it read📊 Changes
16 files changed (+2184 additions, -398 deletions)
View changed files
📝
docs/SETTINGS.md(+5 -2)📝
include/strata/core/glm_model.hpp(+51 -0)📝
include/strata/hip_compat/cuda_runtime.h(+1 -0)📝
serve/server.py(+243 -84)📝
serve/telemetry.py(+1 -1)📝
serve/test_fair.py(+2 -2)📝
serve/test_server.py(+116 -12)📝
serve/web/app.css(+25 -1)📝
serve/web/app.js(+119 -20)📝
serve/web/index.html(+7 -1)📝
src/core/glm_fast_path.cu(+148 -63)📝
src/core/glm_fast_state.hpp(+5 -0)📝
src/core/glm_model.cu(+60 -7)📝
src/core/glm_multi.cu(+657 -6)📝
src/core/glm_prefill.cu(+228 -87)📝
src/program/generate.cpp(+516 -112)📄 Description
A conversation's state was lost more often than it had to be: a cancelled prompt threw away what it read and the
conversation it had restored; a cancelled or dropped answer left a kept state that no next prompt continued (it held
the reply's opening token); a restart onto a different layer split dropped every kept conversation; and conversations
that share a long start (an agent's sessions) each read it again. In five commits:
the free VRAM at start).
one chunk boundary, and that state becomes the conversation's snapshot.
cp=<n>); the engine keeps a shared slot there.gt=<n>, the generation prompt's tokens; thenext request continues the conversation whether the answer was kept, dropped or cancelled.
their instructions before a per-session part), and a log line naming the closest kept prefix when nothing is reused.
Measured (Maya-S, 4x T4): a 38K-token prompt cancelled after 10 s kept 12288 tokens, the retry read only the rest;
a 5.5K-token system prompt with another task: 1.3 s instead of 15.2 s (1.2-1.5 s instead of ~17 s beside a decoding
conversation); an answer cancelled after 955 tokens - the next turn took back 27071 tokens and read 44; a conversation
kept under the split [0,11)[11,21)[21,33)[33,45) came back under [0,13)[13,24)[24,35)[35,45) (6022 tokens, 0.2 s).
Seen live with OpenCode: sessions share their first 7239 tokens; a rewritten history diverged at token 119185 of 132056.
Tests: serve
PrefixCheckpoint(cp, gt, detection, reaching the engine).🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.