sgl-project/sglang · error · ValueError

MiniMax H3 pruned curve checkpoints cannot use a separate Ad

Error message

MiniMax H3 pruned curve checkpoints cannot use a separate AdaLN cache

What it means

Checkpoints with pruned AdaLN curves (arch.adaln_curve_grid is not None) already encode compact curve-based AdaLN parameters, so they cannot also use a separately precomputed AdaLN cache. Supplying both is contradictory and rejected at construction.

Source

Thrown at python/sglang/multimodal_gen/runtime/models/dits/minimax_h3.py:1885

        hf_config: dict[str, Any],
        quant_config: QuantizationConfig | None = None,
        adaln_cache_path: str | None = None,
        adaln_cache_model_variant: str | None = None,
        adaln_weight_files: list[str] | None = None,
        adaln_plan_width: int = MINIMAX_H3_ADALN_MAX_PLAN_WIDTH,
    ) -> None:
        super().__init__(config=config, hf_config=hf_config)
        arch = self.config
        if (
            adaln_cache_path is not None or adaln_weight_files is not None
        ) and quant_config is not None:
            raise ValueError(
                "MiniMax H3 AdaLN cache is only compatible with unquantized weights"
            )
        if arch.adaln_curve_grid is not None and (
            adaln_cache_path is not None or adaln_weight_files is not None
        ):
            raise ValueError(
                "MiniMax H3 pruned curve checkpoints cannot use a separate "
                "AdaLN cache"
            )
        self._adaln_precomputed = (
            adaln_cache_path is not None or adaln_weight_files is not None
        )
        self.arch = arch
        if arch.checkpoint_uses_diffusers_layout:
            self.preprocess_loaded_state_dict = _diffusers_h3_checkpoint
        self.hidden_size = arch.hidden_size
        self.num_attention_heads = arch.num_attention_heads
        self.num_channels_latents = arch.latents_dim
        tp_size = get_tp_world_size()
        ulysses_size, _ = get_ulysses_ctx()
        self._validate_tp_config(arch=arch, tp_size=tp_size)
        self._validate_sequence_parallel_config(
            arch=arch,
            tp_size=tp_size,

View on GitHub (pinned to 0132848349)

Solutions

  1. Remove adaln_cache_path/adaln_weight_files from the launch for pruned-curve checkpoints
  2. If you actually want the cache path, use the non-pruned (dense AdaLN) checkpoint with adaln_curve_grid=None
  3. Check arch.adaln_curve_grid in the loaded config to confirm which checkpoint variant you have

Example fix

# before
MiniMaxH3DiT(arch_with_curve_grid, adaln_cache_path="...")
# after
MiniMaxH3DiT(arch_with_curve_grid)  # curves only, no cache
Defensive patterns

Strategy: validation

Validate before calling

if arch.adaln_curve_grid is not None:
    adaln_cache_path = None
    adaln_weight_files = None

Type guard

def curve_cache_ok(arch, cache) -> bool:
    return cache is None or arch.adaln_curve_grid is None

Prevention

When it happens

Trigger: Loading a pruned-curve checkpoint (adaln_curve_grid set in the arch config) while passing adaln_cache_path or adaln_weight_files.

Common situations: Copy-pasting the adaln-cache launch flags from a dense-checkpoint deployment onto a new pruned-curve checkpoint; mixing cached AdaLN artifacts from a different model variant.

Related errors


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