{"record":{"id":"e75a12d2a1e3224d","repo":"sgl-project/sglang","slug":"minimax-h3-adaln-cache-is-only-compatible-with-unq","errorCode":null,"errorMessage":"MiniMax H3 AdaLN cache is only compatible with unquantized weights","messagePattern":"MiniMax H3 AdaLN cache is only compatible with unquantized weights","errorType":"validation","errorClass":"ValueError","httpStatus":null,"severity":"error","filePath":"python/sglang/multimodal_gen/runtime/models/dits/minimax_h3.py","lineNumber":1879,"sourceCode":"                \"the packed sequence alignment.\"\n            )\n\n    def __init__(\n        self,\n        config: MiniMaxH3DiTConfig,\n        hf_config: dict[str, Any],\n        quant_config: QuantizationConfig | None = None,\n        adaln_cache_path: str | None = None,\n        adaln_cache_model_variant: str | None = None,\n        adaln_weight_files: list[str] | None = None,\n        adaln_plan_width: int = MINIMAX_H3_ADALN_MAX_PLAN_WIDTH,\n    ) -> None:\n        super().__init__(config=config, hf_config=hf_config)\n        arch = self.config\n        if (\n            adaln_cache_path is not None or adaln_weight_files is not None\n        ) and quant_config is not None:\n            raise ValueError(\n                \"MiniMax H3 AdaLN cache is only compatible with unquantized weights\"\n            )\n        if arch.adaln_curve_grid is not None and (\n            adaln_cache_path is not None or adaln_weight_files is not None\n        ):\n            raise ValueError(\n                \"MiniMax H3 pruned curve checkpoints cannot use a separate \"\n                \"AdaLN cache\"\n            )\n        self._adaln_precomputed = (\n            adaln_cache_path is not None or adaln_weight_files is not None\n        )\n        self.arch = arch\n        if arch.checkpoint_uses_diffusers_layout:\n            self.preprocess_loaded_state_dict = _diffusers_h3_checkpoint\n        self.hidden_size = arch.hidden_size\n        self.num_attention_heads = arch.num_attention_heads\n        self.num_channels_latents = arch.latents_dim","sourceCodeStart":1861,"sourceCodeEnd":1897,"githubUrl":"https://github.com/sgl-project/sglang/blob/0132848349585cfe6aae51c4941cbae872505f8a/python/sglang/multimodal_gen/runtime/models/dits/minimax_h3.py#L1861-L1897","documentation":"The MiniMax H3 AdaLN cache (precomputed AdaLN conditioning tables loaded from adaln_cache_path or adaln_weight_files) is only valid for unquantized weights. Passing both a quantization config (quant_config) and an AdaLN cache is rejected because quantized kernels would consume the cached fp32 conditioning inconsistently.","triggerScenarios":"Constructing the model with adaln_cache_path (or adaln_weight_files) set while also passing a non-None quant_config (e.g. fp8/int8 quantized checkpoint).","commonSituations":"Reusing an AdaLN cache generated for the bf16 checkpoint after switching the server to a quantized model; enabling --quantization together with --adaln-cache flags.","solutions":["Drop the AdaLN cache args and let AdaLN compute on the fly with the quantized checkpoint","Or use the unquantized checkpoint (quant_config=None) if you need the AdaLN cache's startup/time savings","Regenerate workflows: keep cache and quantization mutually exclusive in launch scripts"],"exampleFix":"# before\nmodel = MiniMaxH3DiT(..., adaln_cache_path=cache, quant_config=fp8_cfg)\n# after\nmodel = MiniMaxH3DiT(..., quant_config=fp8_cfg)  # no adaln cache","handlingStrategy":"validation","validationCode":"if quant_config is not None:\n    adaln_cache_path = None\n    adaln_weight_files = None","typeGuard":"def cache_quant_compatible(cache: Optional[str], qc) -> bool:\n    return cache is None or qc is None","tryCatchPattern":null,"preventionTips":["Make launch scripts treat AdaLN cache and --quantization as mutually exclusive","Regenerate caches per checkpoint variant"],"tags":["adaln","quantization","checkpoint","config-conflict"],"backgroundTag":"incompatible-quantization-config","analyzedSha":"0132848349585cfe6aae51c4941cbae872505f8a","analyzedAt":"2026-08-28T05:10:05.995Z","schemaVersion":2},"datasetVersion":"2026-08-28T06:17:29.519Z"}