Skip to content

Add Muse Glimmer 30B support - #475

Merged
justinchuby merged 14 commits into
mainfrom
justinchuby/muse-glimmer-support
Aug 12, 2026
Merged

justinchuby merged 14 commits into
mainfrom
justinchuby/muse-glimmer-support

Conversation

@justinchuby

@justinchuby justinchuby commented Aug 11, 2026 •

Copy link
Copy Markdown
Member

Summary

  • add strongly typed Muse Glimmer text/vision config extraction and registry entries
  • implement the gated Muse text decoder, mixed sliding/full attention, dynamic packed vision tower, pixel shuffle adapter, projector, and multimodal embedding mixer
  • export Muse Glimmer as decoder, vision encoder, and embedding ONNX models with text-only checkpoint support
  • add tiny text/full-multimodal parity coverage plus real 30B BF16 L4/L5 golden references pinned to 97c77dff50b2797bcc558fa2d909761dbc575c59
  • enable CUDA Graph capture by default for autoregressive decoder sessions, keep one-shot multimodal sessions uncaptured, and retain an explicit per-decoder opt-out for incompatible models
  • lower all Muse norms to fused ONNX RMSNormalization and residual SkipSimplifiedLayerNormalization operators

Validation

  • 3655 passed, 48 skipped - full non-integration suite
  • 149 passed - ORT GenAI config and export regression suite
  • tiny Hugging Face vs ONNX text and full vision -> embedding -> decoder numerical parity
  • full-size 30B decoder, vision encoder, and embedding graph construction
  • L4 real-weight BF16 CUDA prefill passed on NVIDIA H200
  • L5 real-weight BF16 CUDA 30-token greedy generation passed on NVIDIA H200
  • real 30B INT4 CUDA text and image generation passed with decoder CUDA Graph capture and shared KV-cache buffers enabled
  • full 30B BF16 CUDA graph contains 209 RMSNormalization and 104 SkipSimplifiedLayerNormalization nodes, with no decomposed ReduceMean/Pow norm path

The golden case is skipped in CI because the checkpoint is about 60 GB and requires a large-memory GPU; its committed references and local L4/L5 path remain fully runnable.

justinchuby and others added 2 commits August 11, 2026 01:33
Add strongly typed Muse Glimmer text fields, model-specific vision extraction, and representative tiny graph fixtures for both text and multimodal model types.

Co-authored-by: Copilot <[email protected]>
Signed-off-by: justinchuby <[email protected]>
Implement the gated Muse text decoder, dynamic packed vision tower, adapter and embedding pipeline, then register the three-model export task. Add synthetic multimodal parity, BF16-safe golden execution, and real-checkpoint L4/L5 references for Muse-Glimmer-30B.

Co-authored-by: Copilot <[email protected]>
Signed-off-by: justinchuby <[email protected]>
@justinchuby
justinchuby requested review from a team and a lite review from Copilot August 11, 2026 02:49
@github-actions

github-actions Bot commented Aug 11, 2026 •

Copy link
Copy Markdown

Performance Comparison

Comparing f57f294 → c076560

Model Metric Baseline Current Delta
bert (feature-extraction) model_size_bytes 359 KB 359 KB +0.0% ⚪
bert (feature-extraction) num_nodes 60 60 +0.0% ⚪
falcon model_size_bytes 364 KB 364 KB +0.0% ⚪
falcon num_nodes 68 68 +0.0% ⚪
gemma2 model_size_bytes 428 KB 428 KB +0.0% ⚪
gemma2 num_nodes 107 107 +0.0% ⚪
gpt2 model_size_bytes 388 KB 388 KB +0.0% ⚪
gpt2 num_nodes 54 54 +0.0% ⚪
llama model_size_bytes 425 KB 425 KB +0.0% ⚪
llama num_nodes 62 62 +0.0% ⚪
llama (static-cache) model_size_bytes 425 KB 425 KB +0.0% ⚪
llama (static-cache) num_nodes 58 58 +0.0% ⚪
mamba (ssm-text-generation) model_size_bytes 296 KB 296 KB +0.0% ⚪
mamba (ssm-text-generation) num_nodes 98 98 +0.0% ⚪
phi3 model_size_bytes 421 KB 421 KB +0.0% ⚪
phi3 num_nodes 60 60 +0.0% ⚪
phi3 (static-cache) model_size_bytes 421 KB 421 KB +0.0% ⚪
phi3 (static-cache) num_nodes 56 56 +0.0% ⚪
qwen2 model_size_bytes 425 KB 425 KB +0.0% ⚪
qwen2 num_nodes 62 62 +0.0% ⚪
qwen2 (static-cache) model_size_bytes 425 KB 425 KB +0.0% ⚪
qwen2 (static-cache) num_nodes 58 58 +0.0% ⚪
qwen3_5_moe (hybrid-text-generation) model_size_bytes 506 KB 506 KB +0.0% ⚪
qwen3_5_moe (hybrid-text-generation) num_nodes 275 275 +0.0% ⚪
qwen3_5_text (hybrid-text-generation) model_size_bytes 458 KB 458 KB +0.0% ⚪
qwen3_5_text (hybrid-text-generation) num_nodes 129 129 +0.0% ⚪
qwen3_5_vl (hybrid-qwen-vl) model_size_bytes 977 KB 977 KB +0.0% ⚪
qwen3_5_vl (hybrid-qwen-vl) num_nodes 431 431 +0.0% ⚪
t5 (seq2seq) model_size_bytes 836 KB 836 KB +0.0% ⚪
t5 (seq2seq) num_nodes 166 166 +0.0% ⚪
whisper (speech-to-text) model_size_bytes 1008 KB 1008 KB +0.0% ⚪
whisper (speech-to-text) num_nodes 128 128 +0.0% ⚪

No performance regressions.

@github-actions

github-actions Bot commented Aug 11, 2026 •

Copy link
Copy Markdown

🏗️ Architecture Diff

Comparing f57f294 → c076560

Model Sub-model Changes Status
bert (feature-extraction) model 0 ⚪
falcon model 0 ⚪
gemma2 model 0 ⚪
gemma4 (gemma4) decoder 0 ⚪
gemma4 (gemma4) embedding 0 ⚪
gemma4 (gemma4) vision_encoder 0 ⚪
gemma4_text model 0 ⚪
gpt2 model 0 ⚪
llama model 0 ⚪
llama (static-cache) model 0 ⚪
mamba (ssm-text-generation) model 0 ⚪
phi3 model 0 ⚪
phi3 (static-cache) model 0 ⚪
qwen model 0 ⚪
qwen (static-cache) model 0 ⚪
qwen2 model 0 ⚪
qwen2 (static-cache) model 0 ⚪
qwen2_moe model 0 ⚪
qwen2_moe (static-cache) model 0 ⚪
qwen3 model 0 ⚪
qwen3 (static-cache) model 0 ⚪
qwen3_5_moe (hybrid-text-generation) model 0 ⚪
qwen3_5_text (hybrid-text-generation) model 0 ⚪
qwen3_5_vl (hybrid-qwen-vl) decoder 0 ⚪
qwen3_5_vl (hybrid-qwen-vl) embedding 0 ⚪
qwen3_5_vl (hybrid-qwen-vl) vision_encoder 0 ⚪
qwen3_moe model 0 ⚪
qwen3_moe (static-cache) model 0 ⚪
qwen3_next (hybrid-text-generation) model 0 ⚪
t5 (seq2seq) decoder 0 ⚪
t5 (seq2seq) encoder 0 ⚪
whisper (speech-to-text) decoder 0 ⚪
whisper (speech-to-text) encoder 0 ⚪

No architecture changes detected. ✅


Legend: ⚪ No change · 🔵 Minor (attrs/inits) · 🟡 Moderate (nodes added/removed) · 🔴 Major (interface changed)

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Adds first-class support for the Muse Glimmer 30B model family to mobius, including typed config extraction, registry/task wiring, and ONNX graph implementations for both text-only and vision-language (3-model split) export paths.

Changes:

  • Introduce Muse Glimmer model implementations (gated text decoder + packed dynamic vision encoder + embedding mixer) and a dedicated 3-model VL task.
  • Add Muse Glimmer config extraction hooks, registry entries, and tiny + golden coverage (including L4/L5 pinned references).
  • Improve golden/e2e harness dtype handling (bfloat16-friendly) and stabilize golden generation for bf16 logits.

Reviewed changes

Copilot reviewed 22 out of 22 changed files in this pull request and generated 4 comments.

Show a summary per file
File Description
tests/synthetic_parity_test.py Adds HF config/model construction support for muse_glimmer_text in synthetic parity tests.
tests/e2e_golden_test.py Ensures feeds use the ONNX model’s declared input dtypes (important for bf16).
tests/_test_configs.py Adds tiny Muse Glimmer text + VL configs to the shared test config lists.
testdata/golden/vision-language/muse-glimmer-30b.json Adds pinned golden logits/token references for Muse Glimmer 30B.
testdata/golden/vision-language/muse-glimmer-30b_generation.json Adds pinned L5 generation reference output.
testdata/cases/vision-language/muse-glimmer-30b.yaml Adds an L4/L5 golden test case definition (CI-skipped due to size/GPU needs).
src/mobius/tasks/_vision_language_3model.py Adds MuseGlimmerVLTask to export Muse Glimmer with standard 1D text RoPE and packed vision.
src/mobius/tasks/init.py Exports/registers MuseGlimmerVLTask for task lookup.
src/mobius/models/muse_glimmer.py Implements Muse Glimmer text-only + VL module components and weight routing.
src/mobius/models/muse_glimmer_test.py Adds integration parity tests for tiny multimodal Muse Glimmer and weight routing checks.
src/mobius/models/init.py Exports Muse Glimmer model classes from the public models package.
src/mobius/components/_muse_glimmer_vision.py Adds Muse Glimmer dynamic-resolution packed vision encoder component.
src/mobius/components/init.py Exports MuseGlimmerVisionModel from components public API.
src/mobius/_registry.py Registers muse_glimmer and muse_glimmer_text model_types and text-only mapping.
src/mobius/_configs/per_model/_muse_glimmer_vision.py Adds vision config extraction hook for Muse Glimmer composite configs.
src/mobius/_configs/per_model/init.py Ensures Muse Glimmer vision extractor is imported/registered.
src/mobius/_configs/_sub_configs.py Extends VisionConfig with position embedding grid height/width fields.
src/mobius/_configs/_base.py Adds MuseGlimmerConfig and video_token_id plumbing into ArchitectureConfig.
src/mobius/_configs/init.py Exports MuseGlimmerConfig from the configs package.
src/mobius/_configs_test.py Adds unit test coverage for MuseGlimmerConfig.from_transformers behavior.
src/mobius/_config_resolver.py Improves robustness of dict→PretrainedConfig conversion for newer model-specific fields.
scripts/generate_golden.py Normalizes logits to float32 before NumPy conversion for bf16 models.

💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

Comment thread src/mobius/_config_resolver.py Resolved
Comment thread tests/synthetic_parity_test.py Resolved
Comment thread tests/synthetic_parity_test.py Resolved
Comment thread src/mobius/models/muse_glimmer.py Resolved
justinchuby and others added 2 commits August 11, 2026 03:10
Keep config fallback compatible with older huggingface_hub releases, preserve explicit synthetic activation settings, handle disabled logit softcapping, and use the rank-2 position tensor for decoder attention-mask shape inference.

Co-authored-by: Copilot <[email protected]>
Signed-off-by: justinchuby <[email protected]>
Generate a real-checkpoint BF16 greedy reference through the composite Hugging Face model and verify the standalone Mobius text export produces the same 20-token sequence.

Co-authored-by: Copilot <[email protected]>
Signed-off-by: justinchuby <[email protected]>
@justinchuby

Copy link
Copy Markdown
Member Author

Added dedicated text-only L5 coverage in 0f34196. The case forces muse_glimmer_text, loads the language backbone from the composite 30B checkpoint, commits a 20-token BF16 golden sequence, and passed real-weight ONNX generation on H200 (1 passed in 713.32s).

Replace scattered Muse-specific test branches with data-driven Hugging Face config/model adapters and a reusable golden reference_loader field for text exports sourced from multimodal checkpoints.

Co-authored-by: Copilot <[email protected]>
Signed-off-by: justinchuby <[email protected]>

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 29 out of 29 changed files in this pull request and generated 1 comment.

Comment thread src/mobius/models/muse_glimmer.py Resolved
justinchuby and others added 3 commits August 11, 2026 15:45
Route packed image-first and video-second features through independent placeholder indices so prompt order and batch boundaries cannot swap modalities.

Co-authored-by: Copilot <[email protected]>
Signed-off-by: justinchuby <[email protected]>
Route Muse Glimmer through the packed Qwen-style image transform pipeline so processor output matches the vision encoder's flattened patches and image-grid inputs.

Co-authored-by: Copilot <[email protected]>
Signed-off-by: justinchuby <[email protected]>
Recognize the Muse text sub-config used by composite builds so runtime export still selects the packed image transform pipeline.

Co-authored-by: Copilot <[email protected]>
Signed-off-by: justinchuby <[email protected]>
@justinchuby

Copy link
Copy Markdown
Member Author

Olive/ORT GenAI validation found one final runtime-export issue: composite Muse builds expose muse_glimmer_text during processor generation, so they were missing the packed PatchImage/image_grid_thw pipeline. Commits f225c65 and 5d87411 fix both parent and unwrapped config forms.

With that fix, the full 30B BF16→INT4 Olive recipe completed in 1,436 seconds (18 GB output), native CUDA text generation passed, and image generation correctly described a Chinatown archway scene through microsoft/onnxruntime-genai#2397.

justinchuby and others added 5 commits August 12, 2026 04:29
Enable graph capture for CUDA decoder sessions while leaving one-shot multimodal encoder and embedding sessions uncaptured. Preserve an explicit decoder override for models that cannot safely use capture.

Co-authored-by: Copilot <[email protected]>
Signed-off-by: justinchuby <[email protected]>
Lower scale-free and centered Muse norms to ONNX RMSNormalization instead of decomposed float operations. This enables residual skip-norm fusion and removes redundant Cast, ReduceMean, Pow, and Mul nodes while preserving fp32 variance accumulation.

Co-authored-by: Copilot <[email protected]>
Signed-off-by: justinchuby <[email protected]>
Cast the unit scale to the hidden-state dtype because ONNX RMSNormalization derives its output type from scale. Add fp16 and bf16 regression coverage so full-precision Muse exports remain loadable.

Co-authored-by: Copilot <[email protected]>
Signed-off-by: justinchuby <[email protected]>
Keep Muse variance and centered scale computation in float32 while replacing the decomposed ReduceMean/Pow sequence with ONNX RMSNormalization. This retains Hugging Face numerical behavior for BF16 models and avoids generation drift from lower-precision skip-norm fusion.

Co-authored-by: Copilot <[email protected]>
Signed-off-by: justinchuby <[email protected]>
Represent scale-free normalization with a one-dimensional all-ones scale matching the normalized axis. ONNX RMSNormalization requires this shape; scalar scales can appear to work on CPU but produce invalid CUDA results.

Co-authored-by: Copilot <[email protected]>
Signed-off-by: justinchuby <[email protected]>
@justinchuby

Copy link
Copy Markdown
Member Author

Final H200 validation for c076560 completed:

  • Full BF16 -> INT4 Olive rebuild succeeded (736.8s export, 718.5s quantization).
  • Corrected scale-free RMSNorm uses schema-valid 1-D scales; isolated CUDA output exactly matched the float32 reference.
  • Final decoder: 2,458 nodes vs 3,913 baseline (-37.2%), 312 RMSNormalization, zero ReduceMean/Pow.
  • ORT GenAI text and image E2E both passed with decoder CUDA Graph capture and shared KV buffer enabled.
  • Same-runtime H200 benchmark: 61.76 tok/s median (61.74-61.82), up 11.29% from the 55.50 tok/s decomposed baseline.
  • Final INT4 artifact and ONNX GenAI inference_metadata.yaml are published at https://huggingface.co/justinchuby/Muse-Glimmer-30B-ONNX-INT4-CUDA and all 13 uploaded package files were SHA-256 verified.

@justinchuby
justinchuby merged commit 7ae0b89 into main Aug 12, 2026
20 of 23 checks passed
@justinchuby
justinchuby deleted the justinchuby/muse-glimmer-support branch August 12, 2026 16:53
NishantN2005 added a commit to NishantN2005/mobius that referenced this pull request Aug 13, 2026
Merging main brought in onnxruntime#475's test for the packed-Qwen image pipeline,
which asserts a ConvertRGB step this branch had already removed from
every VLM pipeline. Git merged the file cleanly because the conflict is
semantic, so all six unit-test combos went red on one assertion.

The removal stands: ort-extensions' convert_to_rgb swaps R and B
unconditionally -- it exists to fix up a BGR decode -- so chaining it
after DecodeImage(color_space="RGB") hands the encoder BGR. With it gone
the pixel tensor lands 0.01% from HF's reference instead of 22%. So this
updates the newer expectation rather than restoring the transform, and
says why in the docstring so it does not come back.

The pipeline is now DecodeImage, Resize, Rescale, Normalize, PatchImage,
which moves the qwen2_5_vl flag onto index 3 and PatchImage's attrs to
index 4.

Co-Authored-By: Claude Opus 5 <[email protected]>
justinchuby added a commit that referenced this pull request Aug 14, 2026
## Summary

- distill post-single-shot lessons from the Parakeet CTC, Mage-VL,
Nemotron Parse, LFM2.5, Moonshine, MiniCPM-V, Qwen Image Edit, and Muse
Glimmer integrations
- tighten source/config/revision fidelity, real processor and runtime
contracts, semantic multi-dtype validation, exact golden testing, and
weighted graph optimization evidence
- add precise CI baseline triage, targeted GPU validation, linear
rebase/worktree guidance, quantization schema checks, and executable
diffusion pipeline requirements
- shorten the duplicated multimodal float32 input section and resolve
contradictory encoder/component import guidance

## Sources

Direct agent retrospectives plus commit/review history for merged PRs
#462-#465, #471-#473, and #475.

## Validation

- documentation diff is whitespace-clean
- initialized repository-pinned Ruff/lintrunner tooling
- independent rubber-duck review found no blocking issues; follow-up
consistency suggestions were applied

No runtime code is changed.

---------

Signed-off-by: Justin Chu <[email protected]>
Signed-off-by: Justin Chu <[email protected]>
Co-authored-by: Copilot App <[email protected]>
Co-authored-by: Copilot Autofix powered by AI <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants