Skip to content

feat(models): support Muse Glimmer MLX 4-bit - #1116

Merged
inureyes merged 3 commits into
mainfrom
feature/muse-glimmer-mlx-4bit
Aug 12, 2026
Merged

inureyes merged 3 commits into
mainfrom
feature/muse-glimmer-mlx-4bit

Conversation

@inureyes

Copy link
Copy Markdown
Member

Summary

  • Support the pinned mlx-community/Muse-Glimmer-30B-4bit affine-Q4 checkpoint while preserving the canonical BF16 path and dense vision tower.
  • Normalize mlx-vlm weight roots, inherit the root quantization contract into the text configuration, and load text plus vision-fusion projections through quantization-aware layers.
  • Reuse the server ATEM channel parser in one-shot CLI generation so to=self reasoning and structural tokens stay hidden by default while to=user content remains visible.
  • Document the pinned revision, checkpoint layout, unsupported paths, and real NVIDIA GB10 qualification results.

Security review

  • Reject conflicting root/nested quantization contracts, unsupported or non-string modes, invalid group-size/bit combinations, alias collisions, orphan sidecars, missing affine biases, global-scale sidecars, and quantized vision-tower tensors before kernel selection.
  • Apply identical checkpoint validation to both VLM and text-only loading so malformed metadata cannot bypass the multimodal boundary or be inferred as another block-float format.
  • Keep checkpoint-format support fail-closed to the pinned affine-Q4 layout; this change adds no dependency, network, authentication, filesystem-write, shell-command, or unsafe-code surface.
  • Reviewed the output-channel path for reasoning disclosure and bounded behavior; it delegates to the existing server parser and changes only local CLI presentation.

Validation

  • cargo fmt --all --check
  • env -u MLXCEL_BACKEND cargo clippy --fix --allow-dirty --lib --bins -- -D warnings
  • env -u MLXCEL_BACKEND cargo test --quiet muse_ --lib — 100 passed
  • cargo test --quiet --bin mlxcel top_level_help_mentions_muse_glimmer_limits — passed
  • cargo test --quiet --bin mlxcel supported_models_output_describes_muse_glimmer_baseline — passed
  • env -u MLXCEL_BACKEND MLX_CUDA_ARCHITECTURES=121 cargo build --release --features cuda --bin mlxcel — passed
  • Exact-source real-checkpoint rerun on NVIDIA GB10 loaded the pinned Q4 model in 0.480s, printed only The capital of France is Paris., prefilling at 11.41 tok/s and decoding at 13.07 tok/s.

Performance and compatibility

  • Warm text qualification reached 12.43 prefill tok/s and 13.34 decode tok/s; the image path inserted 64 vision tokens, described the orange-red test image correctly, and decoded at 13.15 tok/s.
  • The Q4 text decode rate is approximately 3.1x the recorded BF16 baseline of 4.25 tok/s on the same GB10.
  • Scope remains single-process pinned BF16/affine-Q4 Muse inference. Video, quantized vision tower, Turbo/INT8 KV, speculative/DFlash, LoRA/adapters, TP/PP, XLA/IREE/OpenXLA, distributed, and disaggregated paths remain unsupported.

Follow-up to #1101.

Load the pinned mlx-community Muse Glimmer conversion by inheriting its root affine-Q4 contract, normalizing mlx-vlm weight roots, and using unified quantized layers for the text and vision-fusion projections while keeping the vision tower dense and fail-closed.

Reuse the server's Muse channel parsing for one-shot CLI display so internal to=self reasoning and control tokens stay hidden by default, and document the pinned artifact plus GB10 text and image qualification results.

Validated with cargo fmt, Clippy with warnings denied, 99 Muse-filtered library tests, the two CLI help regressions, an independent CUDA release build, and pinned-checkpoint text/image generation on NVIDIA GB10.
Reject non-string quantization modes, missing affine bias sidecars, and unsupported global scales before any Muse quantized kernel is selected. Apply the same checkpoint validation to the text-only loader so malformed metadata cannot bypass the VLM boundary and be inferred as a different block-float format.

Validated with 100 Muse-filtered library tests, both Muse CLI regressions, cargo fmt, and Clippy with warnings denied.
@inureyes inureyes added type:enhancement New features, capabilities, or significant additions status:review Under review priority:medium Medium priority area:models Model architectures, weights, loading, metadata area:inference Generation, sampling, decoding (incl. speculative, DRY) area:cli Command-line interface / CLI flags area:docs User and developer documentation modeltype:vlm Vision-language model modelsize:xlarge 4-bit checkpoint > 100GB; exceeds a 128GB dev box, needs bigger hardware arch:dense Dense transformer decoder modelsize:medium 4-bit checkpoint 10-50GB; comfortable on a 128GB dev box and removed modelsize:xlarge 4-bit checkpoint > 100GB; exceeds a 128GB dev box, needs bigger hardware labels Aug 12, 2026
@inureyes
inureyes merged commit e112fb4 into main Aug 12, 2026
7 checks passed
@inureyes
inureyes deleted the feature/muse-glimmer-mlx-4bit branch August 12, 2026 08:50
@inureyes inureyes added status:done Completed and removed status:review Under review labels Aug 12, 2026
inureyes added a commit that referenced this pull request Aug 14, 2026
…D race (#1157)

## Summary

Fixes three pre-existing muse_glimmer test defects (introduced with #1116, unrelated to epic #1148) that prevented `cargo test --release --features metal,accelerate --lib` from being green on a machine without the pinned `models/mlx/muse-glimmer-30b` checkpoint.

## What changed

- `src/loading/vlm_muse_glimmer_tests.rs`: `pinned_weight_index_classifies_each_source_weight_once` now checks whether `model.safetensors.index.json` exists before calling `read_muse_weight_inventory_from_index`, and skips with an `eprintln` reason instead of panicking when the pinned checkpoint is absent, matching the pattern already used in `tests/prompt_cache_e2e.rs`.
- `src/vision/encoders/muse_glimmer_fusion_tests.rs`: `pinned_post_tower_weight_roots_and_shapes_match_published_contract` skips the same way instead of asserting on the missing index file.
- `src/server/muse_glimmer_startup_guard_tests.rs`: `muse_glimmer_startup_allows_baseline_and_keeps_video_disabled` now acquires the crate-wide `crate::test_support::env_lock::env_lock()` guard before calling `validate_muse_glimmer_unsupported_startup`, which reads `MLXCEL_BACKEND`. The sibling test `muse_glimmer_startup_rejects_xla_backend_selection` in the same module already sets `MLXCEL_BACKEND=xla` under that lock; without the baseline test also taking it, the baseline test could intermittently observe the transient value under default parallel test execution and fail. A grep of `MLXCEL_BACKEND` across `src/` confirmed no other test module mutates it, so no other module needs to share this lock.

Both pinned-checkpoint tests still run their full contract check when the index file is present; that arm could not be exercised on this machine (no `models/mlx/` directory) and is verified by code inspection only, as noted in the commit body.

## Test plan

- [x] `cargo test --release --features metal,accelerate --lib muse_glimmer` (80 passed, 0 failed, on a machine without `models/mlx/muse-glimmer-30b`)
- [x] `cargo test --release --features metal,accelerate --lib muse_glimmer_startup_guard`, repeated 5 times under default parallelism (5 passed each run, no flakes observed)
- [x] `cargo check --lib --tests --features metal,accelerate`
- [x] `cargo clippy --release --lib --tests --features metal,accelerate -- -D warnings` (clean)
- [x] `cargo fmt --check` (clean)

Closes #1155
@inureyes inureyes self-assigned this Aug 27, 2026
be-free-snowboy pushed a commit to freestylejs/snowbrain-mlxcel that referenced this pull request Oct 27, 2026
## Summary

- Support the pinned `mlx-community/Muse-Glimmer-30B-4bit` affine-Q4 checkpoint while preserving the canonical BF16 path and dense vision tower.
- Normalize mlx-vlm weight roots, inherit the root quantization contract into the text configuration, and load text plus vision-fusion projections through quantization-aware layers.
- Reuse the server ATEM channel parser in one-shot CLI generation so `to=self` reasoning and structural tokens stay hidden by default while `to=user` content remains visible.
- Document the pinned revision, checkpoint layout, unsupported paths, and real NVIDIA GB10 qualification results.

## Security review

- Reject conflicting root/nested quantization contracts, unsupported or non-string modes, invalid group-size/bit combinations, alias collisions, orphan sidecars, missing affine biases, global-scale sidecars, and quantized vision-tower tensors before kernel selection.
- Apply identical checkpoint validation to both VLM and text-only loading so malformed metadata cannot bypass the multimodal boundary or be inferred as another block-float format.
- Keep checkpoint-format support fail-closed to the pinned affine-Q4 layout; this change adds no dependency, network, authentication, filesystem-write, shell-command, or unsafe-code surface.
- Reviewed the output-channel path for reasoning disclosure and bounded behavior; it delegates to the existing server parser and changes only local CLI presentation.

## Validation

- `cargo fmt --all --check`
- `env -u MLXCEL_BACKEND cargo clippy --fix --allow-dirty --lib --bins -- -D warnings`
- `env -u MLXCEL_BACKEND cargo test --quiet muse_ --lib` — 100 passed
- `cargo test --quiet --bin mlxcel top_level_help_mentions_muse_glimmer_limits` — passed
- `cargo test --quiet --bin mlxcel supported_models_output_describes_muse_glimmer_baseline` — passed
- `env -u MLXCEL_BACKEND MLX_CUDA_ARCHITECTURES=121 cargo build --release --features cuda --bin mlxcel` — passed
- Exact-source real-checkpoint rerun on NVIDIA GB10 loaded the pinned Q4 model in 0.480s, printed only `The capital of France is Paris.`, prefilling at 11.41 tok/s and decoding at 13.07 tok/s.

## Performance and compatibility

- Warm text qualification reached 12.43 prefill tok/s and 13.34 decode tok/s; the image path inserted 64 vision tokens, described the orange-red test image correctly, and decoded at 13.15 tok/s.
- The Q4 text decode rate is approximately 3.1x the recorded BF16 baseline of 4.25 tok/s on the same GB10.
- Scope remains single-process pinned BF16/affine-Q4 Muse inference. Video, quantized vision tower, Turbo/INT8 KV, speculative/DFlash, LoRA/adapters, TP/PP, XLA/IREE/OpenXLA, distributed, and disaggregated paths remain unsupported.

Follow-up to lablup#1101.
be-free-snowboy pushed a commit to freestylejs/snowbrain-mlxcel that referenced this pull request Oct 27, 2026
…D race (lablup#1157)

## Summary

Fixes three pre-existing muse_glimmer test defects (introduced with lablup#1116, unrelated to epic lablup#1148) that prevented `cargo test --release --features metal,accelerate --lib` from being green on a machine without the pinned `models/mlx/muse-glimmer-30b` checkpoint.

## What changed

- `src/loading/vlm_muse_glimmer_tests.rs`: `pinned_weight_index_classifies_each_source_weight_once` now checks whether `model.safetensors.index.json` exists before calling `read_muse_weight_inventory_from_index`, and skips with an `eprintln` reason instead of panicking when the pinned checkpoint is absent, matching the pattern already used in `tests/prompt_cache_e2e.rs`.
- `src/vision/encoders/muse_glimmer_fusion_tests.rs`: `pinned_post_tower_weight_roots_and_shapes_match_published_contract` skips the same way instead of asserting on the missing index file.
- `src/server/muse_glimmer_startup_guard_tests.rs`: `muse_glimmer_startup_allows_baseline_and_keeps_video_disabled` now acquires the crate-wide `crate::test_support::env_lock::env_lock()` guard before calling `validate_muse_glimmer_unsupported_startup`, which reads `MLXCEL_BACKEND`. The sibling test `muse_glimmer_startup_rejects_xla_backend_selection` in the same module already sets `MLXCEL_BACKEND=xla` under that lock; without the baseline test also taking it, the baseline test could intermittently observe the transient value under default parallel test execution and fail. A grep of `MLXCEL_BACKEND` across `src/` confirmed no other test module mutates it, so no other module needs to share this lock.

Both pinned-checkpoint tests still run their full contract check when the index file is present; that arm could not be exercised on this machine (no `models/mlx/` directory) and is verified by code inspection only, as noted in the commit body.

## Test plan

- [x] `cargo test --release --features metal,accelerate --lib muse_glimmer` (80 passed, 0 failed, on a machine without `models/mlx/muse-glimmer-30b`)
- [x] `cargo test --release --features metal,accelerate --lib muse_glimmer_startup_guard`, repeated 5 times under default parallelism (5 passed each run, no flakes observed)
- [x] `cargo check --lib --tests --features metal,accelerate`
- [x] `cargo clippy --release --lib --tests --features metal,accelerate -- -D warnings` (clean)
- [x] `cargo fmt --check` (clean)

Closes lablup#1155
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

arch:dense Dense transformer decoder area:cli Command-line interface / CLI flags area:docs User and developer documentation area:inference Generation, sampling, decoding (incl. speculative, DRY) area:models Model architectures, weights, loading, metadata modelsize:medium 4-bit checkpoint 10-50GB; comfortable on a 128GB dev box modeltype:vlm Vision-language model priority:medium Medium priority status:done Completed type:enhancement New features, capabilities, or significant additions

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant