Repository navigation
Add Muse Glimmer 30B support - #475
Conversation
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]>
Performance Comparison
|
🏗️ Architecture Diff
No architecture changes detected. ✅ Legend: ⚪ No change · 🔵 Minor (attrs/inits) · 🟡 Moderate (nodes added/removed) · 🔴 Major (interface changed) |
There was a problem hiding this comment.
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.
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]>
|
Added dedicated text-only L5 coverage in |
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]>
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]>
|
Olive/ORT GenAI validation found one final runtime-export issue: composite Muse builds expose 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. |
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]>
|
Final H200 validation for
|
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]>
## 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]>
Summary
97c77dff50b2797bcc558fa2d909761dbc575c59Validation
3655 passed, 48 skipped- full non-integration suite149 passed- ORT GenAI config and export regression suiteThe 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.