{"record":{"id":"44a16e8e81055d13","repo":"sgl-project/sglang","slug":"modeloptmixedprecisionconfig-only-supports-mixed-p","errorCode":null,"errorMessage":"ModelOptMixedPrecisionConfig only supports MIXED_PRECISION checkpoints.","messagePattern":"ModelOptMixedPrecisionConfig only supports MIXED_PRECISION checkpoints\\.","errorType":"validation","errorClass":"ValueError","httpStatus":null,"severity":"error","filePath":"python/sglang/srt/layers/quantization/modelopt_quant.py","lineNumber":846,"sourceCode":"                    kv_cache_scheme.get(\"type\") == \"float\"\n                    and kv_cache_scheme.get(\"num_bits\") == 4\n                ):\n                    kv_cache_quant_algo = \"NVFP4\"\n                else:\n                    kv_cache_quant_algo = \"auto\"\n            else:\n                kv_cache_quant_algo = config.get(\"kv_cache_quant_algo\")\n            exclude_modules = config.get(\"ignore\", config.get(\"exclude_modules\"))\n            quantized_layers = config.get(\"quantized_layers\", {})\n        else:\n            quantization_section = cls.get_from_keys(config, [\"quantization\"])\n            quant_algo = quantization_section.get(\"quant_algo\")\n            kv_cache_quant_algo = quantization_section.get(\"kv_cache_quant_algo\")\n            exclude_modules = quantization_section.get(\"exclude_modules\")\n            quantized_layers = quantization_section.get(\"quantized_layers\", {})\n\n        if quant_algo != \"MIXED_PRECISION\":\n            raise ValueError(\n                \"ModelOptMixedPrecisionConfig only supports MIXED_PRECISION checkpoints.\"\n            )\n        if not quantized_layers:\n            raise ValueError(\n                \"MIXED_PRECISION quantization requires a non-empty quantized_layers map.\"\n            )\n\n        group_size = None\n        for layer_info in quantized_layers.values():\n            if layer_info.get(\"quant_algo\", \"\").upper() in (\n                \"NVFP4\",\n                \"W4A16_NVFP4\",\n            ):\n                group_size = layer_info.get(\"group_size\", 16)\n                break\n        if group_size is None:\n            group_size = 16\n","sourceCodeStart":828,"sourceCodeEnd":864,"githubUrl":"https://github.com/sgl-project/sglang/blob/0132848349585cfe6aae51c4941cbae872505f8a/python/sglang/srt/layers/quantization/modelopt_quant.py#L828-L864","documentation":"Error \"ModelOptMixedPrecisionConfig only supports MIXED_PRECISION checkpoints.\" thrown in sgl-project/sglang.","triggerScenarios":"Thrown at python/sglang/srt/layers/quantization/modelopt_quant.py:846 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":[],"exampleFix":null,"handlingStrategy":null,"validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"0132848349585cfe6aae51c4941cbae872505f8a","analyzedAt":"2026-08-28T05:10:05.995Z","schemaVersion":2},"datasetVersion":"2026-08-28T06:17:29.519Z"}