Skip to content

[Native] Publish the context length with off-graph packages - #24955

Draft
metascroy wants to merge 1 commit into
offgraph-kv-shared-cache-geometryfrom
offgraph-kv-publish-context
Draft

metascroy wants to merge 1 commit into
offgraph-kv-shared-cache-geometryfrom
offgraph-kv-publish-context

Conversation

@metascroy

@metascroy metascroy commented Nov 12, 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

A serving runtime sizes its sessions from the context a package publishes, as MLX packages do with get_max_context_len, but native packages carried only the cache geometry. The off-graph export now also writes the model's max_position_embeddings under that name, or the export's --max_seq_length for a config without one. For an off-graph package this is the longest context the model supports; the runtime still sizes its own cache. The wrapper's cache_metadata() becomes metadata(), since it now carries more than the cache's geometry.

Test plan

test_export_hf_llm.py on transformers 5.0.0rc1 and 5.22.2. A full Muse Glimmer export publishes 131072.


Authored with Claude Code.

@pytorch-bot

pytorch-bot Bot commented Nov 12, 2026 •

Copy link
Copy Markdown

🔗 Helpful Links

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

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

❌ 134 New Failures, 7 Unrelated Failures, 10 Unclassified Failures

As of commit f7656ba 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:

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 12, 2026
@metascroy
metascroy force-pushed the offgraph-kv-shared-cache-geometry branch from 370c1ae to 03f97b0 Compare November 13, 2026 00:57
@metascroy
metascroy force-pushed the offgraph-kv-publish-context branch from 1119461 to 649456f Compare November 13, 2026 00:57
A serving runtime sizes its sessions from the context a package publishes,
as MLX packages do with get_max_context_len, but native packages carried
only the cache geometry. The off-graph export now also writes the model's
max_position_embeddings under that name. The wrapper's cache_metadata()
becomes metadata(), since it is no longer only the cache's.

This branch had an error being deployed

1 failed deployment
cadence — f7656ba0 Deployed Nov 14, 2026 by metascroy via hifi1s-build / hifi1s #38299
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