model : add Meta Muse Glimmer 30B support (port of llama.cpp#26841) - #123
Open
bchap1n wants to merge 6 commits into
Open
model : add Meta Muse Glimmer 30B support (port of llama.cpp#26841)#123bchap1n wants to merge 6 commits into
bchap1n wants to merge 6 commits into
Conversation
Port of upstream llama.cpp 62bf73d (PR ggml-org#26841). Adds the muse-glimmer architecture: RMS norms with the conversion-time weight+1 fold, interleaved [L,L,L,G] sliding-window attention with per-layer RoPE, QK-norm (weights synthesized at conversion to absorb qk_scale_factor), an attention output gate around SDPA, SwiGLU dense FFN with post-norms, final logit tanh softcap, and logit-scale output multiplier. The 52-layer variant maps to the 30B model type. Per-layer residuals are exposed for DFlash drafts (LLM_KV_TARGET_LAYERS).
Port of upstream llama.cpp 62bf73d (PR ggml-org#26841). Adds convert_hf_to_gguf.py support for the MuseGlimmerForConditionalGeneration target, the MuseGlimmerVisionModel mmproj, and the MuseGlimmerAssistantModel DFlash drafter (converted with --target-model-dir, exposing dflash.block_size and dflash.target_layers), plus the MODEL_ARCH.MUSE_GLIMMER tensor set, HF tensor-name mappings for the vision tower, and the muse-glimmer vision projector type.
Port of upstream llama.cpp 62bf73d (PR ggml-org#26841). Adds the 50-block ViT vision encoder with 2D RoPE, sparse block-diagonal window attention (every 4th and last layer global), pixel-shuffle downsample, and the 3-layer adapter MLP, plus a dynamic image preprocessor that picks the patch grid closest to the input aspect ratio under the per-image token cap.
Port of upstream llama.cpp 62bf73d (PR ggml-org#26841). Renders assistant turns as "<|start|>assistant to=<recipient><|message|>" messages (chain-of-thought to=self terminated by <|eom|>, final answer to=user terminated by <|eot|>) with a PEG parser and ATEM tool-call grammar.
Port of upstream llama.cpp 62bf73d (PR ggml-org#26841). Target prefill may carry token IDs or multimodal embeddings. Both produce the target-layer features that seed the draft KV cache, so skipping embedding batches left a hole in the draft cache and the next injection failed to initialize. Only skip batches that carry neither tokens nor embeddings.
- docs/speculative.md: Muse Glimmer DFlash example; embedding-bearing target prefill seeds the draft KV cache, so image prompts draft normally - docs/beellama-features.md: Muse Glimmer joins the KVarN SWA supported models - CHANGELOG.md: Unreleased entry for the port and the DFlash prefill fix
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Overview
Ports upstream llama.cpp Muse Glimmer support (ggml-org#26841, commit
62bf73d25) into BeeLlama so KVarN, DFlash, and the multimodal pipeline work with Muse Glimmer models out of the box. The port is a faithful cherry-pick of the merged upstream change — every muse-glimmer source file is byte-identical to upstream master — adapted only where the fork's tree has diverged (chat/speculative integration points). BeeLlama docs are updated per CONTRIBUTING.md.Model support
muse-glimmerarchitecture: 52-layer 30B (and smaller) variants, 131072-token context, interleaved[L,L,L,G]sliding-window attention (window 2048), QK-norm withqk_scale_factorfolded at conversion time, attention output gate (sigmoid) around SDPA, SwiGLU dense FFN with post-norms, final-logit tanh softcap, logit-scale output multiplier. Per-layer residuals are exposed for DFlash drafts (dflash.target_layers)."<|start|>assistant to=<recipient><|message|>"messages (chain-of-thoughtto=selfterminated by<|eom|>, final answerto=userterminated by<|eot|>), with a PEG parser and ATEM tool-call grammar.convert_hf_to_gguf.pyfor the target, vision (mmproj), and DFlash drafter (MuseGlimmerAssistantModel, converted with--target-model-dirso it inherits the target tokenizer and emitsdflash.block_size/dflash.target_layers).Additional information
Verification — local RTX 3090 rig
Hardware: RTX 3090 24 GiB (sm_86), Windows 11, CUDA 13.2, Release,
-DGGML_CUDA=ON -DGGML_CUDA_FA=ON -DGGML_CUDA_FA_ALL_QUANTS=ON -DGGML_CUDA_KVARN=ON, commit8ec951db0(binaryb11161-8ec951db0).Model files (K-quant GGUFs converted from the HF checkpoints, local):
muse-glimmer-30B-kquant-17gb.gguf— 30B, 52 layers, ctx 131072,[L,L,L,G]SWA pattern, Q4_K Medium, 15.59 GiB, 27.85 B paramsdflash-kquant.gguf— DFlash drafter, 5 layers,block_size16,target_layers[2,14,26,38,50], 2.6 Bmmproj-kquant.gguf— vision encoder, 50-block ViT, patch 14, merge 2, projection 6656, 1.9 BFull-stack server command (verified end to end):
finish=stop; correct chain-of-thought plus final answerkvarn5/kvarn4engaged (type_k/type_vin llama-bench; logenabling structured KVarN cache type kvarn_k5v4_g128); SWA override pairkvarn3/kvarn3also verifiedllama-bench(30B Q4_K,-p 512 -n 64 -t 1 -fa on):kvarn5/kvarn4q5_0/q4_1KVarN runs at parity with f16 on this model; DFlash roughly doubles decode throughput.
Tests
test-llama-archscoversLLM_ARCH_MUSE_GLIMMER(SWA-pattern GGUF path) and runs on the Linux CI; the test is excluded from Windows builds (NOT WIN32 OR NOT BUILD_SHARED_LIBS).test-chat-templateandtest-chat-peg-parserpass locally.Commits
model : add Muse Glimmer architecturegguf-py : add Muse Glimmer conversion and tensor mappingsmtmd : add Muse Glimmer vision encodercommon : add Muse Glimmer chat templatespeculative : seed DFlash draft cache on embedding prefilldocs : document Muse Glimmer supportRequirements
62bf73d25), byte-identical in the muse-glimmer sources and reviewed by the author