{"record":{"id":"4c1f11442395f114","repo":"sgl-project/sglang","slug":"unknown-quantization-method-self-quantization","errorCode":null,"errorMessage":"Unknown quantization method: {self.quantization}. Must be one of {supported_quantization}.","messagePattern":"Unknown quantization method: (.+?)\\. Must be one of (.+?)\\.","errorType":"exception","errorClass":"ValueError","httpStatus":null,"severity":"error","filePath":"python/sglang/srt/configs/model_config.py","lineNumber":1647,"sourceCode":"                        f\"main model quantization ({self.quantization}). \"\n                        f\"Using draft model's detected quantization: {quant_method}\"\n                    )\n                    self.quantization = quant_method\n                elif self.quantization in REQUANTIZATION_METHODS:\n                    logger.info_once(\n                        f\"Requantizing from quant_method='{quant_method}' to the requested online quantization='{self.quantization}'. Beware that requantization may incur a loss in accuracy, the requantized model should be re-validated/re-evaluated. More details at https://docs.sglang.io/advanced_features/quantization.html#online-quantization.\"\n                    )\n                else:\n                    raise ValueError(\n                        \"Quantization method specified in the model config \"\n                        f\"({quant_method}) does not match the quantization \"\n                        f\"method specified in the `quantization` argument \"\n                        f\"({self.quantization}).\"\n                    )\n\n        if self.quantization is not None:\n            if self.quantization not in supported_quantization:\n                raise ValueError(\n                    f\"Unknown quantization method: {self.quantization}. Must \"\n                    f\"be one of {supported_quantization}.\"\n                )\n            if is_hip() and self.quantization not in rocm_supported_quantization:\n                raise ValueError(\n                    f\"{self.quantization} quantization is currently not \"\n                    f\"supported in ROCm.\"\n                )\n            if self.quantization not in optimized_quantization_methods:\n                # Don't warn for MXFP4/MXFP8 on SM100 since they have optimized kernels\n                if not (\n                    self.quantization in [\"mxfp4\", \"mxfp8\"] and is_sm100_supported()\n                ):\n                    logger.warning(\n                        \"%s quantization is not fully \"\n                        \"optimized yet. The speed can be slower than \"\n                        \"non-quantized models.\",\n                        self.quantization,","sourceCodeStart":1629,"sourceCodeEnd":1665,"githubUrl":"https://github.com/sgl-project/sglang/blob/0132848349585cfe6aae51c4941cbae872505f8a/python/sglang/srt/configs/model_config.py#L1629-L1665","documentation":"The --quantization string is not in sglang's supported_quantization list, so _verify_quantization rejects it before model loading. Common with typos, renamed methods, or method names from other frameworks (e.g. vLLM-specific spellings).","triggerScenarios":"Passing --quantization <name> where name is misspelled (e.g. 'gptq_marlin ' with trailing space, 'int8_w8a8' in a version that renamed it) or simply not implemented in this build.","commonSituations":"Typos in launch scripts, upgrading sglang where quantization names were added/removed, using a name valid in vLLM/llama.cpp but not sglang.","solutions":["Check the error message's supported list and correct the spelling/casing","Upgrade or align your sglang version with the docs for the method you want","If the method should exist, verify you're on a build that includes it (not a CPU-only or trimmed wheel)"],"exampleFix":"# before\npython -m sglang.launch_server --model MODEL --quantization w8a8_int8\n# after\npython -m sglang.launch_server --model MODEL --quantization int8_w8a8  # exact supported name","handlingStrategy":"validation","validationCode":"from sglang.srt.layers.quantization import QUANTIZATION_METHODS  # or the supported list surfaced by the error\nif requested_quant not in QUANTIZATION_METHODS:\n    raise SystemExit(f\"unsupported quantization {requested_quant}; pick from {sorted(QUANTIZATION_METHODS)}\")","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Derive quantization names from the installed sglang version, not from memory","Fail fast in deploy scripts on unknown enum-like flags"],"tags":["quantization","typo","unsupported-method","sglang"],"backgroundTag":"invalid-argument-value","analyzedSha":"0132848349585cfe6aae51c4941cbae872505f8a","analyzedAt":"2026-08-28T05:10:05.995Z","schemaVersion":2},"datasetVersion":"2026-08-28T06:17:29.519Z"}