{"record":{"id":"1bc7cab302840564","repo":"sgl-project/sglang","slug":"moe-wna16-only-support-gptq-and-awq","errorCode":null,"errorMessage":"moe_wna16 only support gptq and awq.","messagePattern":"moe_wna16 only support gptq and awq\\.","errorType":"validation","errorClass":"ValueError","httpStatus":null,"severity":"error","filePath":"python/sglang/srt/layers/quantization/moe_wna16.py","lineNumber":110,"sourceCode":"        if self.linear_quant_method == \"gptq\":\n            self.use_marlin = GPTQMarlinConfig.is_gptq_marlin_compatible(full_config)\n        elif self.linear_quant_method == \"awq\":\n            capability_tuple = get_device_capability()\n            device_capability = (\n                -1\n                if capability_tuple is None\n                else capability_tuple[0] * 10 + capability_tuple[1]\n            )\n            awq_min_capability = AWQConfig.get_min_capability()\n            if device_capability < awq_min_capability:\n                raise ValueError(\n                    \"The quantization method moe_wna16 + awq is not supported \"\n                    \"for the current GPU. \"\n                    f\"Minimum capability: {awq_min_capability}. \"\n                    f\"Current capability: {device_capability}.\"\n                )\n        else:\n            raise ValueError(\"moe_wna16 only support gptq and awq.\")\n\n        if modules_to_not_convert is None:\n            self.modules_to_not_convert = []\n        else:\n            self.modules_to_not_convert = modules_to_not_convert\n\n    @classmethod\n    def get_name(cls) -> str:\n        return \"moe_wna16\"\n\n    @classmethod\n    def get_supported_act_dtypes(cls) -> List[torch.dtype]:\n        return [torch.bfloat16, torch.half]\n\n    @classmethod\n    def get_min_capability(cls) -> int:\n        return 70\n","sourceCodeStart":92,"sourceCodeEnd":128,"githubUrl":"https://github.com/sgl-project/sglang/blob/0132848349585cfe6aae51c4941cbae872505f8a/python/sglang/srt/layers/quantization/moe_wna16.py#L92-L128","documentation":"The MoeWNA16Config constructor only accepts quant_method values 'gptq' and 'awq' — these are the only backends with kernels wired into the moe_wna16 scheme. Any other method string in the MoE quant config raises this ValueError at config construction time.","triggerScenarios":"Constructing MoeWNA16Config directly, or via from_config, where the quant_method resolved from the config dict is something like 'qqq', 'gptq_v2', 'awq_v2', or a typo like 'awq '.","commonSituations":"quant_config.json of a MoE checkpoint carries an unrecognized quant_method key; hand-edited configs; or a newly published quant variant that moe_wna16 doesn't implement yet.","solutions":["Set quant_method in the MoE quant config to exactly 'gptq' or 'awq'","If the checkpoint uses another method, pick the matching SGLang quant scheme (e.g. qqq, w8a8) instead of forcing moe_wna16","Update SGLang — newer revisions may have added the method you need"],"exampleFix":"// before\n{\"quant_method\": \"gptq_v2\", \"bits\": 4, ...}\n// after\n{\"quant_method\": \"gptq\", \"bits\": 4, ...}","handlingStrategy":"validation","validationCode":"method = quant_cfg.get(\"quant_method\")\nif method not in (\"gptq\", \"awq\"):\n    raise ValueError(f\"moe_wna16 needs gptq/awq, got {method!r}\")\ncfg = MoeWNA16Config(method, bits, group, has_zp, ...)","typeGuard":"from typing import Literal\nQuantMethod = Literal[\"gptq\", \"awq\"]\n\ndef is_supported_method(m: str) -> TypeGuard[QuantMethod]:\n    return m in (\"gptq\", \"awq\")","tryCatchPattern":null,"preventionTips":["Route checkpoints to the quant scheme matching their actual quant_method","Build configs via from_config so keys are validated once"],"tags":["quantization","moe","gptq","awq","config-validation"],"backgroundTag":"unsupported-quant-method","analyzedSha":"0132848349585cfe6aae51c4941cbae872505f8a","analyzedAt":"2026-08-28T05:10:05.995Z","schemaVersion":2},"datasetVersion":"2026-08-28T06:17:29.519Z"}