Add Muse Glimmer 30B text decoder support - #180
Conversation
Meta's on-device agentic model (Apache 2.0). Architecture features: - Local/Global attention: [S,S,S,G] repeating (39+13 layers) - CenteredRMSNorm (1+weight) for layer norms, plain RMSNorm for final norm - Weight-less RMSNorm on embeddings - QK norm (shared RMSNorm on Q/K per-head) + qk_scale_factor on Q - Gated attention: sigmoid(gate_proj(x)) * attn_output - Extreme GQA: 32Q / 2KV (16:1 ratio) - Per-layer RoPE control (global layers skip RoPE) - output_multiplier (0.196) and logit softcapping (20.0) Evaluated: word_ppl = 7.71 (FP16), ~8.4 (INT4).
|
I guess this design doesn't provide the memory savings of Sliding Window Attention right? Maybe we can do what @Lewis300 & I have been doing for a different model:
Also, did we test this for quality at the largest supported context? (We have seen issues on some models at very large contexts, just wanna ensure it doesn't happen on this one) |
|
(An updated chain-of-thought parser will follow up) The model produces agentic output, for example: Where Is the actual message to the user |
| class _MuseGlimmerTextConfig(PretrainedConfig): | ||
| model_type = "muse_glimmer_text" | ||
|
|
||
| class _MuseGlimmerConfig(PretrainedConfig): | ||
| model_type = "muse_glimmer" |
There was a problem hiding this comment.
why have both of these?
There was a problem hiding this comment.
The VLM support will come separately. We are currently only extracting the text portion.
…ults The test_export_contract iterates _get_registry() and calls AutoConfig.for_model(model_type) for each key. Our registry has "muse_glimmer_text" as the internal key, which needs its own AutoConfig registration with sensible defaults so the test can instantiate a minimal model for contract validation.
RoPE: Pre-compute frequencies in float32 and pass via freqs= param to the composite op. Without this, positions >32K overflow fp16 angle precision and produce garbage output. Config: Make layer_types/layer_rope_theta auto-scale to match num_hidden_layers in the test config, preventing crashes when the export contract test overrides num_hidden_layers.
|
SWA memory savings: Will be a follow up. We currently store all 52 layers share a single growing KV cache. The SWA dual-cache pattern (bounded sliding cache for local layers + growing cache for global layers) is a planned follow-up. The infrastructure already exists on main (StateKind enum, 2-4 state support in both engines) but not tested on this model yet. Memory impact at 128K: currently ~8GB (full cache for all layers). With SWA dual-cache: ~2-3GB (75% savings since 39/52 layers only need 2048 slots). Quality at max context:
This required a RoPE precision fix (pre-computing frequencies in float32 to avoid fp16 angle overflow at positions >32K) which is included in the last commits. |
| | Model | Compression | Precision | word_ppl | | ||
| |-------|-------------|-----------|----------| | ||
| | 30B | none | FP16 | 7.71 | | ||
| | 30B | INT4 | FP16 | ~8.4 | |
There was a problem hiding this comment.
Any reason this is approximate? We can perhaps add the actual PPL?
| - **Logit softcapping**: `tanh(logits/20) * 20`. | ||
| - SwiGLU MLP, no attention bias. | ||
|
|
||
| ## Evaluation Results |
There was a problem hiding this comment.
nit: we can move this section towards the end of this page and re-format to be consistent with other model cards..
Summary
Add Meta's Muse Glimmer 30B — on-device agentic model (Apache 2.0).
First model in the codebase with gated attention, CenteredRMSNorm, QK norm,
and local/global attention pattern with per-layer RoPE control.
Architecture
1 + weight) for layer norms; plain RMSNorm for final normsigmoid(gate_proj(x)) * attn_outputEvaluation
Long-Context Validation (128K)
Needle-in-a-haystack retrieval passes at all context sizes:
Changes
models/macos/muse_glimmer.py— model implementation (~350 LOC)models/registry.py— registry entry + AutoConfig registrationmodel_registry.py— export presettests/.../test_muse_glimmer.py— 11 unit testsmodels/muse_glimmer/README.md— documentationTest plan