Skip to content

feat(model): add Muse Glimmer support - #5479

Merged
yaoyu-33 merged 89 commits into
mainfrom
yuya/muse-glimmer-support
Sep 2, 2026
Merged

yaoyu-33 merged 89 commits into
mainfrom
yuya/muse-glimmer-support

Conversation

@yaoyu-33

@yaoyu-33 yaoyu-33 commented Aug 10, 2026 •

Copy link
Copy Markdown
Contributor

What does this PR do?

Adds Muse Glimmer 30B support through the builder-backed model config, model builder, and model bridge APIs.

Modeling

MuseGlimmerModel directly subclasses Megatron-Core HybridModel. MuseGlimmerModelBuilder constructs it with a model-local HybridStack specification whose * layer pattern selects the complete Muse transformer layer. The implementation does not build, wrap, alias, or present the text model as GPTModel.

The text path preserves Muse's 3:1 sliding/full attention pattern, per-layer NoPE pattern, GQA, weightless Q/K RMSNorm, full-head sigmoid attention gate, centered pre/post residual norms, final scaled RMSNorm, normalized embeddings, output multiplier, and tanh logit soft-cap. Muse-specific behavior remains confined to the Muse Glimmer model family while the stack uses Megatron-Core transformer components.

The replicated vision path implements the 50-layer encoder, learned-position lookup, 2-D RoPE, window/full attention, pixel shuffle, adapter, projection, and perception RMSNorm. Its parameters are marked for tensor-parallel gradient averaging.

The bridge maps the complete checkpoint against native HybridModel parameter roots, including model-local Q/K/V/full-head gate fusion and split semantics.

Changelog

  • Add MuseGlimmerModelConfig, MuseGlimmerModelBuilder, and the combined VLM.
  • Build the language stack as a native Megatron-Core HybridModel/HybridStack.
  • Add complete HF ↔ Megatron mappings and AutoBridge registration.
  • Add CPU and builder-backed checkpoint conversion support.
  • Add deterministic builder-backed VLM inference support.
  • Use the official Transformers 5.15.0 Muse Glimmer configs directly and keep the native HybridModel config in muse_glimmer_config.py.
  • Add focused config, mapping, checkpoint, norm, vision, HybridModel construction, and registration tests.
  • Add modeling documentation, training recipes, and a model verification card.

Validation

Final DCO-signed head: a80ab5709f1f04982c4ce907729d6b524c0a3f2b.

  • CPU and TP8 HF → Megatron imports each completed all 1,228 mappings and persisted/reloaded a native 52-layer HybridModel with 29,776,626,688 parameters.
  • CPU and TP8 Megatron → HF exports each passed an exact audit over all 1,436 BF16 tensors and 29,776,626,688 elements: zero missing, unexpected, shape, dtype, or value mismatches and maximum absolute difference 0. Transformers 5.15.0 strictly reloaded both exports as MuseGlimmerForConditionalGeneration with the same parameter count.
  • TP8 HF/Megatron forward comparison predicted the same next token. Logit cosine similarity was 0.999896; maximum and mean absolute differences were 0.781250 and 0.139148.
  • Two independent deterministic TP8 greedy runs produced the same exact 64-token image-conditioned completion.
  • Bounded 32-H100 multimodal pretraining completed 100 finite optimizer steps with zero skipped or NaN iterations, loss 12.23977 -> 1.4103, and complete step-50/100 checkpoints.
  • Full-model SFT, post-SFT export/inference, and packed 8K CP2 SFT completed their bounded verification runs with finite loss and complete reloadable artifacts.
  • TP8 LoRA completed 100 finite optimizer steps with zero skipped or NaN iterations, saved all 208 expected adapters, and passed a direct step-100 reload followed by finite step 101 and a distinct complete save.
  • The canonical 32-H100 FP8 recipe completed 50 finite steps and averaged 428.24 model TFLOP/s/GPU over its final 10 steps, satisfying the requested 400-500 range.
  • Direct pretraining resume restored full state and saved a complete distinct 32-shard checkpoint, but the final loss sentinel differed by 2.9638%, exceeding the fixed 1% gate. The card therefore leaves checkpoint resume explicitly unverified; the tolerance was not weakened.
  • Original focused Muse HybridModel, conversion mapping, checkpoint schema, deterministic inference, and related common-path validation: 85 passed. Post-cleanup/current-main focused validation: 116 passed.
  • Final current-main focused regression passed 499 tests with 1 skip across the original DeepSeek failure, Muse HybridModel/config/mappings/recipes, Gemma Transformers 5.15 paths, builder conversion/inference, checkpointing, shared parameter mappings, direct-HF SFT, docs consistency, and verification-card validation.
  • Model verification card validator: passed.
  • uv run pre-commit run --all-files: passed.
  • Independent final review found no blocking or high-severity issues. Its embedding-sharing config finding was fixed by honoring the top-level VLM contract and adding a divergent nested/top-level regression test.
  • Current upstream main at 74749b4f2e456800255d65d2735c522443f9c384 was inspected and is contained in the final head.

The full conversion, forward, inference, PEFT, and performance evidence is recorded in examples/model_verification_cards/muse-glimmer-30b/card.yaml.

Before your PR is "Ready for review"

Pre checks:

  • Read and followed the contributor guidelines.
  • Added focused tests.
  • Added modeling documentation and a model verification card.
  • No new dependency was added; the existing Transformers requirement was updated to 5.15.0 for native Muse Glimmer support.

Additional Information

@copy-pr-bot

copy-pr-bot Bot commented Aug 10, 2026

Copy link
Copy Markdown

This pull request requires additional validation before any workflows can run on NVIDIA's runners.

Pull request vetters can view their responsibilities here.

Contributors can view more details about this message here.

@yaoyu-33

Copy link
Copy Markdown
Contributor Author

/ok to test 7f50992

Signed-off-by: yaoyu-33 <yaoyu.094@gmail.com>
Signed-off-by: yaoyu-33 <yaoyu.094@gmail.com>
Signed-off-by: yaoyu-33 <yaoyu.094@gmail.com>
Signed-off-by: yaoyu-33 <yaoyu.094@gmail.com>
@yaoyu-33
yaoyu-33 force-pushed the yuya/muse-glimmer-support branch from 7f50992 to 6cef8df Compare August 11, 2026 20:56
@yaoyu-33

Copy link
Copy Markdown
Contributor Author

/ok to test 6cef8df

Signed-off-by: yaoyu-33 <yaoyu.094@gmail.com>
Signed-off-by: yaoyu-33 <yaoyu.094@gmail.com>
Signed-off-by: yaoyu-33 <yaoyu.094@gmail.com>
Signed-off-by: yaoyu-33 <yaoyu.094@gmail.com>
Signed-off-by: yaoyu-33 <yaoyu.094@gmail.com>
Signed-off-by: yaoyu-33 <yaoyu.094@gmail.com>
Signed-off-by: yaoyu-33 <yaoyu.094@gmail.com>
Signed-off-by: yaoyu-33 <yaoyu.094@gmail.com>
@yaoyu-33

Copy link
Copy Markdown
Contributor Author

/ok to test 8b096c9

@yaoyu-33

Copy link
Copy Markdown
Contributor Author

/ok to test 9f42e8b

Signed-off-by: yaoyu-33 <yaoyu.094@gmail.com>
…codex/pr-5479-config-contract

Signed-off-by: yaoyu-33 <yaoyu.094@gmail.com>
@yaoyu-33

Copy link
Copy Markdown
Contributor Author

/ok to test 1c6177b

Signed-off-by: yaoyu-33 <yaoyu.094@gmail.com>
@yaoyu-33

Copy link
Copy Markdown
Contributor Author

/ok to test f1a9bd8

Signed-off-by: yaoyu-33 <yaoyu.094@gmail.com>
@copy-pr-bot

copy-pr-bot Bot commented Aug 18, 2026

Copy link
Copy Markdown

/ok to test 6633d4748989ad4eb55e2cbd36943a70c8fd2bfd

@yaoyu-33, there was an error processing your request: E2

See the following link for more information: https://docs.gha-runners.nvidia.com/cpr/e/2/

@yaoyu-33

Copy link
Copy Markdown
Contributor Author

/ok to test 6633d47

…odel

Signed-off-by: yaoyu-33 <yaoyu.094@gmail.com>
…odel

Signed-off-by: yaoyu-33 <yaoyu.094@gmail.com>
@yaoyu-33

Copy link
Copy Markdown
Contributor Author

/ok to test a80ab57

…odel

Signed-off-by: yaoyu-33 <yaoyu.094@gmail.com>

# Conflicts:
#	src/megatron/bridge/training/model_load_save.py
#	tests/unit_tests/training/test_checkpointing.py
Signed-off-by: yaoyu-33 <yaoyu.094@gmail.com>
…odel

Signed-off-by: yaoyu-33 <yaoyu.094@gmail.com>
@yaoyu-33

Copy link
Copy Markdown
Contributor Author

/ok to test fe7a92f

…odel

Signed-off-by: yaoyu-33 <yaoyu.094@gmail.com>
…odel

Signed-off-by: yaoyu-33 <yaoyu.094@gmail.com>
Signed-off-by: yaoyu-33 <yaoyu.094@gmail.com>
@yaoyu-33

Copy link
Copy Markdown
Contributor Author

/ok to test 4950254

…odel

Signed-off-by: yaoyu-33 <yaoyu.094@gmail.com>
Signed-off-by: yaoyu-33 <yaoyu.094@gmail.com>
@yaoyu-33

Copy link
Copy Markdown
Contributor Author

/ok to test 4c59dc7

Signed-off-by: Yu Yao <yaoyu.094@gmail.com>
@yaoyu-33

Copy link
Copy Markdown
Contributor Author

/ok to test 4964763

This branch was previously deployed

2 inactive (1 outdated) deployments
test — 4964763a Deployed Aug 28, 2026 by copy-pr-bot[bot] via cicd-wait-in-queue #21197
public — 4c59dc75 Deployed Aug 25, 2026 by copy-pr-bot[bot] via release / finalize / publish-docs #5032
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area:model Model implementations and HF bridge logic feature New capabilities, enhancements, or enablement work full-test-suite high-complexity Harder to merge: prone to conflicts and needs additional test coverage needs-more-tests Requires additional L0 and L1 test coverage before merge needs-review PR is ready for code review and waiting on a reviewer

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants