mirror of
https://github.com/mw00/project-maya.git
synced 2026-12-03 19:04:50 +07:00
[PR #657] DS4: a checkpoint at every turn (MAYA_DS4_CKPTS), so an edit or a branch back reads on from there #653
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#653
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/657
Author: @mgabor3141
Created: 10/29/2026
Status: 🔄 Open
Base:
main← Head:ds4-turn-checkpoints📝 Commits (1)
e8fdaf8DS4: a checkpoint at every turn (MAYA_DS4_CKPTS, 16): the state where each turn starts, taken at the start of a prompt that continues an earlier one and before each user or tool-result message inside a prompt read in a run of chunks, kept in the model (per conversation under --parallel) and in the slot, at least 512 tokens apart, the newest 4 kept past the cap; an edited message or a branch back some turns reads on from there instead of the anchor. 4x RTX 3090, 26K conversation: edit 24.2 -> 12.3 s, back to turn 3/5 11.5/18.0 -> 0.6 s, from a slot or the folder 15.9/23.4 -> 0.6 s; decode and prompt speed unchanged (#606)📊 Changes
4 files changed (+214 additions, -74 deletions)
View changed files
📝
docs/SETTINGS.md(+1 -0)📝
src/ds4/ds4_main.cpp(+7 -2)📝
src/ds4/ds4_model.cu(+196 -72)📝
src/ds4/ds4_model.hpp(+10 -0)📄 Description
Closes #606.
A DeepSeek conversation can be resumed only at its last prompt's end, the position before it, or the anchor. An edited message or a client going back some turns therefore re-reads everything from the anchor or token 0.
This keeps the state where each turn starts as well, up to
MAYA_DS4_CKPTS(default 16, max 64,0off), in the model and in the slot.slot_takealready picks the latest usable checkpoint, so nothing changes there.<|User|>token (user messages and tool results). The mid-read marks are off when YOCO cuts rows.--parallel: kept per conversation (moved byseq_park/seq_unpark).Results: 4x RTX 3090, Maya-S, main (v1.1.36),
--parallel 2,MAYA_DS4_SLOT_KEEP=1. The test conversation has 6 turns of about 4K tokens, each giving a code. Each branch asks for all codes so far.Every answer listed the right codes on both builds. Without the patch, each case resumed at the anchor.
Compatibility:
0, no turn checkpoints are taken, but the last-row snapshot now goes through the same capture path, so it isn't bit-for-bit the old code.🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.