sgl-project/sglang · error · ValueError

config.json claims a packaged Muse Glimmer MLX artifact (mus

Error message

config.json claims a packaged Muse Glimmer MLX artifact (muse_glimmer_mlx_format={MUSE_GLIMMER_MLX_FORMAT_VERSION}) but the weights contain raw-checkpoint keys {stray[:4]}{'...' if len(stray) > 4 else ''}; the marker belongs on packaged artifacts only — repackage from the raw HF export

What it means

The loader found raw-checkpoint-only key markers in the weights even though config.json claims a packaged artifact (muse_glimmer_mlx_format is set). Raw-only keys (e.g. separate output_gate_proj weights) must have been fused during packaging, so their presence means the format marker was applied to a non-packaged (raw) checkpoint.

Source

Thrown at python/sglang/srt/hardware_backend/mlx/models/muse_glimmer_mlx.py:623

                    "mlp.up_proj.weight",
                    "mlp.down_proj.weight",
                )
            )
            if self.args.use_attn_output_gate:
                keys.add(prefix + "self_attn.output_gate_proj.weight")
        return keys

    def sanitize(self, weights: dict) -> dict:
        if self.args.muse_glimmer_mlx_format == MUSE_GLIMMER_MLX_FORMAT_VERSION:
            # Packaged artifact: weights are already fused/folded.  A raw-only
            # key here means the marker was stamped on the wrong directory.
            stray = sorted(
                k
                for k in weights
                if any(marker in k for marker in _RAW_ONLY_KEY_MARKERS)
            )
            if stray:
                raise ValueError(
                    "config.json claims a packaged Muse Glimmer MLX artifact "
                    f"(muse_glimmer_mlx_format={MUSE_GLIMMER_MLX_FORMAT_VERSION}) but the "
                    f"weights contain raw-checkpoint keys {stray[:4]}"
                    f"{'...' if len(stray) > 4 else ''}; the marker belongs "
                    "on packaged artifacts only — repackage from the raw HF export"
                )
            return weights

        # No marker: a raw HF export, possibly in the RC multimodal layout —
        # normalize that to the raw schema first.
        if any(k.startswith(_RC_PREFIX) for k in weights):
            weights = _normalize_rc_layout(weights)

        text_keys = {
            k
            for k in weights
            if not any(marker in k for marker in _VISION_KEY_MARKERS)
            and "rotary_emb" not in k

View on GitHub (pinned to 0132848349)

Solutions

  1. Remove the muse_glimmer_mlx_format key from config.json if the weights are raw
  2. Or properly repackage the raw HF export with the matching packager so the gate is fused and raw keys disappear
  3. Never hand-add the format marker; only the packager sets it

Example fix

// before: raw weights + "muse_glimmer_mlx_format": 1 in config.json
// after: delete that key from config.json (weights are raw)
// or repackage: python -m sglang.srt.hardware_backend.mlx.pack muse-glimmer raw_dir out_dir
Defensive patterns

Strategy: validation

Validate before calling

fmt = cfg.get("muse_glimmer_mlx_format")
if fmt is not None:
    stray = [k for k in weight_keys if any(m in k for m in RAW_ONLY_MARKERS)]
    assert not stray, f"raw keys present: {stray[:4]}"

Try / catch

try:
    weights = sanitize(weights)
except ValueError as e:
    if "raw-checkpoint keys" in str(e):
        del cfg["muse_glimmer_mlx_format"]; weights = sanitize(weights)  # retry as raw

Prevention

When it happens

Trigger: Calling sanitize/load on weights that still contain keys matching _RAW_ONLY_KEY_MARKERS while the config carries muse_glimmer_mlx_format — typically someone manually added the marker to a raw HF export's config.json to work around the fused-gate error (3576/3578).

Common situations: Hand-editing config.json to silence a previous loader error instead of actually repackaging, or a partial/failed packaging run that copied the config but left raw weights.

Related errors


AI-assisted analysis of sgl-project/sglang@0132848349 (2026-08-28). Data as JSON: /api/errors/7fd20daf7c3c71b3. Report an issue: GitHub.