Skip to content

glm: count the rows a paged prompt resume reuses - #2222

Closed
ashhart wants to merge 2 commits into
mainfrom
lead/glm-paged-cached
Closed

ashhart wants to merge 2 commits into
mainfrom
lead/glm-paged-cached

Conversation

@ashhart

@ashhart ashhart commented Nov 5, 2026

Copy link
Copy Markdown
Owner

GLM-5.3-Flash on CUDA with TF_GLM_KV_SHARE now counts the rows a paged prompt resume reuses, so cached_tokens and prompt_tokens_cached_total show it (#1899). On main a resume through pool pages reported 0 cached, so a client couldn't see its prompt was cached.

The prefix plan's start goes to the stream where the plan is made, and opening clears the count before that plan so the seat no longer overwrites it. Counts only: nothing about what's reused or how changes. The host test fails with the line removed. Host tests only; no GPU run. With #2203's clamp, this finishes what #1899 asked for on the guard and counter, and the doubling itself didn't reproduce on main.

TF_GLM_KV_SHARE resumes a prompt on the KV pool's pages, but the
stream's cached count stayed 0 when the pages were adopted without a
state restore, so the reply's cached_tokens and
prompt_tokens_cached_total missed the reuse. The prefix plan's from is
now written to the stream where the plan is made, before the seat can
overwrite it; the lane host's prefilled credits the same number. A host
test resumes a second pass on the pages and asserts the cached rows,
which is 0 before this change. Nothing about what is reused or how
changes.
@ashhart
ashhart marked this pull request as draft November 5, 2026 04:19
@ashhart

ashhart commented Nov 5, 2026

Copy link
Copy Markdown
Owner Author

Closing this draft. A review found that it either changes nothing or reports recomputed tokens as cached, and #2211 removes the file it edits. #1899's counter gets redone against the shared store once #2211 lands.

@ashhart ashhart closed this Nov 5, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant