Skip to content

[Native] Export Muse Glimmer through the native backend - #24951

Draft
metascroy wants to merge 1 commit into
offgraph-kv-verify-without-tokenizerfrom
offgraph-kv-mg-export
Draft

metascroy wants to merge 1 commit into
offgraph-kv-verify-without-tokenizerfrom
offgraph-kv-mg-export

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

Exports Muse Glimmer through the native backend.

  • Model class: Transformers builds Muse Glimmer only as MuseGlimmerForConditionalGeneration, not through AutoModelForCausalLM. That class carries a vision tower and scans input_ids for image and video tokens, which the ggml engine can't run. The export builds it with AutoModelForImageTextToText and exports MuseGlimmerTextLM instead: its language model and LM head under their HF parameter names, with the output multiplier and logit soft cap.
  • --layers: also truncates its per-layer layer_rope_theta.
  • Cache: it exports only with --offgraph_cache, which carries its sliding windows.
python -m executorch.backends.native.examples.hf_llm.export_hf_llm \
  --model <meta-models/Muse-Glimmer-30B dir> \
  --gguf Muse-Glimmer-30B-KQuant-17GB-Q4_K_M.gguf \
  --offgraph_cache --output mg.ptn

Test plan

  • test_export_hf_llm.py: off-graph golden samples of a tiny Muse Glimmer match HF's full multimodal model; one update_and_attend per layer and no aten.eq. Skips without a transformers that has Muse Glimmer.
  • Full 52-layer model (Q4_K_M, transformers 5.22.2): exports in ~3 min to a 15.6 GB .ptn with every weight packed. Its golden samples pass on Metal (max logit error 0.04–0.20) and CPU (0.43–0.62). Greedy continuation of "The capital of France is": " Paris. It is the". About 24 decode steps/s on an M4 Max.

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

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 9093078 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
export_hf_llm loads models with AutoModelForCausalLM, which has no Muse
Glimmer: Transformers builds it only as MuseGlimmerForConditionalGeneration,
with a vision tower and a scan of input_ids for image and video tokens that
the ggml engine cannot run. Build it with AutoModelForImageTextToText and
export MuseGlimmerTextLM instead: its language model and LM head under their
Hugging Face parameter names, with the output multiplier and logit soft cap.
--layers also truncates its per-layer layer_rope_theta. It exports only with
--offgraph_cache, which carries its sliding windows.

With --gguf, a GGUF checkpoint loads through the muse-glimmer mapping. The
first four layers of Muse-Glimmer-30B-KQuant-17GB-Q4_K_M.gguf export with
every weight packed, and their golden samples pass on the ggml engine on CPU
and Metal. The test needs a transformers with Muse Glimmer and skips
otherwise.

This branch had an error being deployed

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