Skip to content

[Native] Map Muse Glimmer GGUF tensors onto its HF model - #24949

Draft
metascroy wants to merge 1 commit into
offgraph-kv-ggml-q5kfrom
offgraph-kv-mg-gguf
Draft

metascroy wants to merge 1 commit into
offgraph-kv-ggml-q5kfrom
offgraph-kv-mg-gguf

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

Maps Muse Glimmer GGUF tensors onto the Hugging Face MuseGlimmerForConditionalGeneration parameters under model.language_model.

  • Names: gguf-py has no tensor map for the muse-glimmer architecture, so gguf_hf gets an explicit table, for architectures without one. The attn_q_norm / attn_k_norm tensors are skipped: the HF QK norm has no weight. llama.cpp's converter stores the query scale HF reads from the config (qk_scale_factor) as attn_q_norm and ones as attn_k_norm, so load_gguf checks them against the config (check_config_tensors) instead of dropping them silently.
  • Conversion: undoes llama.cpp's Q/K row permutation, as for Llama, and the 1 it adds to the four centered decoder norms. The final norm is a plain gain and stays as stored.

Test plan

  • test_gguf_hf.py: names, conversions, and the QK norm check on a tiny Muse Glimmer. Needs a transformers with Muse Glimmer; skips otherwise.
  • The real GGUF's QK norms pass the check in all 52 layers (attn_q_norm = 3.87); a config with another scale is rejected.
  • On the first four layers of Muse-Glimmer-30B-KQuant-17GB-Q4_K_M.gguf, HF with this mapping matches Muse Glimmer's own model and GGUF loader to 4.9e-5 at FP32, with the same top token at every position. Dropping the Q/K un-permute or the norm offset breaks it (max errors 7.5 and 13.8).

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

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

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

As of commit ebd18ef 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
gguf_hf takes tensor names from gguf-py's tensor map, which has no entry for
Muse Glimmer's muse-glimmer architecture, so add a table from its GGUF names
to the Hugging Face MuseGlimmerForConditionalGeneration parameters under
model.language_model. The all-ones attn_q_norm/attn_k_norm tensors are
skipped: the HF QK norm has no weight.

The conversion undoes llama.cpp's Q/K row permutation, as for Llama, and the
1 it adds to the four centered decoder norms; the final norm is a plain gain
and stays as stored. Checked on the first four layers of
Muse-Glimmer-30B-KQuant-17GB-Q4_K_M.gguf against Muse Glimmer's own model and
GGUF loader: FP32 logits agree to 5e-5.

The tests need a transformers with Muse Glimmer and skip otherwise.

This branch had an error being deployed

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