{"record":{"id":"0be4c963ff448436","repo":"sgl-project/sglang","slug":"invalid-quantization-method-quantization-avail","errorCode":null,"errorMessage":"Invalid quantization method: {quantization}. Available methods: {list(QUANTIZATION_METHODS.keys())}","messagePattern":"Invalid quantization method: (.+?)\\. Available methods: (.+?)","errorType":"validation","errorClass":"ValueError","httpStatus":null,"severity":"error","filePath":"python/sglang/srt/layers/quantization/__init__.py","lineNumber":164,"sourceCode":"    )\n\n# subset of above quant methods, supported on CPU\nCPU_QUANTIZATION_METHODS = {\n    \"fp8\": Fp8Config,\n    \"w8a8_int8\": W8A8Int8Config,\n    \"compressed-tensors\": CompressedTensorsConfig,\n    \"awq\": AWQCPUConfig,\n    \"gptq\": CPUGPTQConfig,\n    \"mxfp4\": Mxfp4Config,\n    \"auto-round\": AutoRoundConfig,\n}\n\nQUANTIZATION_METHODS = {**BASE_QUANTIZATION_METHODS}\n\n\ndef get_quantization_config(quantization: str) -> Type[QuantizationConfig]:\n    if quantization not in QUANTIZATION_METHODS:\n        raise ValueError(\n            f\"Invalid quantization method: {quantization}. \"\n            f\"Available methods: {list(QUANTIZATION_METHODS.keys())}\"\n        )\n    from sglang.srt.utils import is_cpu\n\n    if is_cpu() and cpu_has_amx_support():\n        if quantization not in CPU_QUANTIZATION_METHODS:\n            raise ValueError(\n                f\"Invalid quantization method on CPU: {quantization}. \"\n                f\"Available methods on CPU: {list(QUANTIZATION_METHODS.keys())}\"\n            )\n        else:\n            return CPU_QUANTIZATION_METHODS[quantization]\n\n    if current_platform.is_out_of_tree():\n        config = current_platform.get_quantization_config(quantization)\n\n        # If the platform has a quantization config, use it else use the default","sourceCodeStart":146,"sourceCodeEnd":182,"githubUrl":"https://github.com/sgl-project/sglang/blob/0132848349585cfe6aae51c4941cbae872505f8a/python/sglang/srt/layers/quantization/__init__.py#L146-L182","documentation":"SGLang's quantization registry does not recognize the requested quantization method name. get_quantization_config looks up the string in QUANTIZATION_METHODS (the merged base registry of supported quant schemes) and raises when it is absent, listing all valid names.","triggerScenarios":"Passing --quantization <name> (or ServerArgs.quantization / a config with quantization_config.quant_method) whose string is not a key in QUANTIZATION_METHODS — e.g. a typo like 'aw_q', an uninstalled/optional scheme whose import was skipped, or a method only available in newer SGLang versions.","commonSituations":"Typos in CLI flags, copy-pasting quant names from vLLM/HF docs that SGLang doesn't support, using a stale SGLang version that lacks a new quant method, or a quant method that requires sgl-kernel/AOT deps not installed so it was never registered.","solutions":["Check the error's printed list and correct the flag to exactly one of the listed methods (e.g. 'awq', 'gptq', 'fp8', 'w8a8_int8')","Upgrade sglang to a version that supports the method","Install missing backend deps (sgl-kernel, CPU/AMX builds) so the method registers","If the checkpoint is quantized with a scheme SGLang lacks, use a compatible checkpoint or the generic 'gptq'/'awq' path"],"exampleFix":"# before\npython -m sglang.launch_server --model model --quantization awq_marlin_typo\n# after\npython -m sglang.launch_server --model model --quantization awq_marlin","handlingStrategy":"validation","validationCode":"from sglang.srt.layers.quantization import QUANTIZATION_METHODS\nif args.quantization not in QUANTIZATION_METHODS:\n    raise SystemExit(f\"Pick one of {sorted(QUANTIZATION_METHODS)}\")","typeGuard":null,"tryCatchPattern":"try:\n    cfg = get_quantization_config(name)\nexcept ValueError as e:\n    if \"Invalid quantization method\" in str(e):\n        log.error(f\"Unknown quant {name}; valid: {list(QUANTIZATION_METHODS)}\")\n    raise","preventionTips":["Validate the quantization string against QUANTIZATION_METHODS before launching the server","Pin a known-good SGLang version in deployment images","Add startup config linting for CLI flags"],"tags":["quantization","configuration","startup","sglang"],"backgroundTag":"invalid-configuration-value","analyzedSha":"0132848349585cfe6aae51c4941cbae872505f8a","analyzedAt":"2026-08-28T05:10:05.995Z","schemaVersion":2},"datasetVersion":"2026-08-28T06:17:29.519Z"}