Skip to content

[Native] Load the first layers of a GGUF with --layers - #24947

Draft
metascroy wants to merge 1 commit into
offgraph-kv-transformers-compatfrom
offgraph-kv-gguf-layers
Draft

metascroy wants to merge 1 commit into
offgraph-kv-transformers-compatfrom
offgraph-kv-gguf-layers

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

--gguf excluded --layers, because every GGUF tensor must name a parameter and a truncated model has none for the later blocks. gguf_to_hf and load_gguf now take truncated=True to skip blocks past the model's last layer, and the export passes it when --layers is set. That exports a few layers of a large GGUF checkpoint to test the lowering quickly. Without the flag, a tensor that names no parameter still raises.

Test plan

  • test_gguf_hf.py: a truncated model skips later blocks and still rejects unknown names.
  • test_export_hf_llm.py: a 1-layer model loaded from a 2-layer GGUF matches the reference cut to one layer exactly.

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/24947

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

❌ 132 New Failures, 3 Cancelled Jobs, 7 Unrelated Failures, 10 Unclassified Failures

As of commit dbcb2e1 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 JOBS - The following jobs were 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 12, 2026
This was referenced Nov 12, 2026
--gguf excluded --layers because every GGUF tensor must name a parameter, and
a truncated model has none for the later blocks. gguf_to_hf and load_gguf now
take truncated=True to skip the blocks past the model's last layer, and the
export passes it when --layers is set. That exports a few layers of a large
GGUF checkpoint to test the lowering quickly. Without the flag, a tensor that
names no parameter still raises.

This branch had an error being deployed

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