mirror of
https://github.com/mw00/project-maya.git
synced 2026-12-03 21:08:26 +07:00
[PR #253] [MERGED] GLM: keep the snapshot as a checkpoint when the next turn starts right after it - an edit of the last message after a short reply 21.5 -> 1.0 s #427
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#427
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/253
Author: @merbanan
Created: 10/17/2026
Status: ✅ Merged
Merged: 10/20/2026
Merged by: @mw00
Base:
main← Head:pr/ckpt-turn📝 Commits (1)
1019221glm: keep the previous prompt's snapshot as a checkpoint when the new turn starts right after it📊 Changes
5 files changed (+102 additions, -2 deletions)
View changed files
📝
include/strata/core/glm_model.hpp(+7 -0)📝
src/core/glm_fast_path.cu(+74 -0)📝
src/core/glm_model.cu(+1 -0)📝
src/core/glm_multi.cu(+1 -0)📝
src/program/generate.cpp(+19 -2)📄 Description
The gap: a prompt that continues from the snapshot and opens its last turn (
<|user|>/<|observation|>) within 512 tokens of it gets no conversation checkpoint at that turn, becauseckpt_markswants 512 fresh tokens before a mark. A short reply puts the turn mark that close to the snapshot. Editing that last message (or regenerating with a changed message) then reads the whole conversation from token 0.The fix: in that case the snapshot itself (the previous prompt but its last token, a few tokens before the turn) is kept as a checkpoint. It is copied from VRAM to host RAM on a side thread while the new prompt runs. The snapshot stays intact until that prompt's
snapshot_save, which waits for the copy, as dockpt_save/ckpt_restore/slot_load/seq_bind/ teardown. The copy costs the prompt nothing.STRATA_GLM_CKPT_TURN=0turns it off.Measured on this branch (v1.1.15 + this), one V100, GLM-5.3-Flash Maya-S24, two rounds
Setup: a 13.5K-token chat, a 16-token reply, then a 6.4K-token turn (A2). Then:
🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.