Skip to content

[Native] Separate the ggml engine's K/V storage from its sequence cache - #25006

Draft
metascroy wants to merge 1 commit into
offgraph-kv-publish-contextfrom
offgraph-kv-ggml-kv-pool
Draft

metascroy wants to merge 1 commit into
offgraph-kv-publish-contextfrom
offgraph-kv-ggml-kv-pool

Conversation

@metascroy

@metascroy metascroy commented Nov 13, 2026 •

Copy link
Copy Markdown
Contributor

Stack

Off-graph KV cache for the native ggml engine, through serving Muse Glimmer on it. Review bottom-up; each PR builds and passes its tests on its own.

Summary

GgmlSequenceCache owned its K/V tensors, their growth, and the row copies a regrow makes. The cell cache in the next PR needs the same storage, so it moves to GgmlKvPool, which the sequence cache now holds; the executor binds the pool's storage.

Each pool layer records:

  • its window, which groups layers that share a mask;
  • whether it's a ring, which decides whether attention reads all its rows or a prefix.

The lowering keys the read extent off ring rather than off the window. That's the same for the sequence cache, but lets a cell cache's windowed layers read a prefix. No change in behavior.

Test plan

  • Engine tests pass.
  • The runner still verifies golden samples of a sliding-window package and a Muse Glimmer slice.

Authored with Claude Code.

@pytorch-bot

pytorch-bot Bot commented Nov 13, 2026 •

Copy link
Copy Markdown

🔗 Helpful Links

🧪 See artifacts and rendered test results at hud.pytorch.org/pr/pytorch/executorch/25006

Note: Links to docs will display an error until the docs builds have been completed.

❌ 136 New Failures, 1 Cancelled Job, 7 Unrelated Failures, 10 Unclassified Failures

As of commit bf1b379 with merge base c7f7931 (image):

NEW FAILURES - The following jobs have failed:

UNCLASSIFIED FAILURES - DrCI could not classify the following jobs because the workflow did not run on the merge base. The failures may be pre-existing on trunk or introduced by this PR:

CANCELLED JOB - The following job was cancelled. Please retry:

FLAKY - The following jobs failed but were likely due to flakiness present on trunk:

This comment was automatically generated by Dr. CI and updates every 15 minutes.

@meta-cla meta-cla Bot added the CLA Signed This label is managed by the Facebook bot. Authors need to sign the CLA before a PR can be reviewed. label Nov 13, 2026
This was referenced Nov 13, 2026
GgmlSequenceCache owned its K/V tensors, their growth, and the row copies a
regrow makes. A cache of another layout needs the same storage, so it moves
to GgmlKvPool, which the sequence cache now holds; the executor binds the
pool's storage. Each pool layer records its window, which groups masks, and
whether it is a ring, which decides whether attention reads all its rows or
a prefix; the lowering keys off that rather than off the window. No change
in behavior.

This branch had an error being deployed

1 failed deployment
cadence — bf1b379b Deployed Nov 14, 2026 by metascroy via hifi1s-build / hifi1s #38307
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

CLA Signed This label is managed by the Facebook bot. Authors need to sign the CLA before a PR can be reviewed.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant