{"record":{"id":"6d4ba63ebdaf9784","repo":"sgl-project/sglang","slug":"unsupported-weight-quantization-strategy-self-we","errorCode":null,"errorMessage":"Unsupported weight quantization strategy: {self.weight_quant.strategy}","messagePattern":"Unsupported weight quantization strategy: (.+?)","errorType":"validation","errorClass":"ValueError","httpStatus":null,"severity":"error","filePath":"python/sglang/srt/layers/quantization/compressed_tensors/schemes/compressed_tensors_w8a8_fp8_moe.py","lineNumber":209,"sourceCode":"                    num_experts,\n                    2 * ((intermediate_size_per_partition + block_n - 1) // block_n),\n                    (hidden_size + block_k - 1) // block_k,\n                    dtype=torch.float32,\n                ),\n                requires_grad=False,\n            )\n            w2_weight_scale = torch.nn.Parameter(\n                torch.ones(\n                    num_experts,\n                    (hidden_size + block_n - 1) // block_n,\n                    (intermediate_size_per_partition + block_k - 1) // block_k,\n                    dtype=torch.float32,\n                ),\n                requires_grad=False,\n            )\n            weight_quant_method = FusedMoeWeightScaleSupported.BLOCK.value\n        else:\n            raise ValueError(\n                f\"Unsupported weight quantization strategy: {self.weight_quant.strategy}\"\n            )\n\n        layer.register_parameter(\"w13_weight_scale\", w13_weight_scale)\n        layer.register_parameter(\"w2_weight_scale\", w2_weight_scale)\n        # Add the quantization method used (per tensor/grouped/channel)\n        # to ensure the weight scales are loaded in properly\n        extra_weight_attrs.update({\"quant_method\": weight_quant_method})\n        set_weight_attrs(w13_weight_scale, extra_weight_attrs)\n        set_weight_attrs(w2_weight_scale, extra_weight_attrs)\n\n        # INPUT_SCALES\n        if self.static_input_scales:\n            assert (\n                self.input_quant.strategy == QuantizationStrategy.TENSOR\n            ), \"Only per-tensor quantization is supported for static input scales\"\n            w13_input_scale = torch.nn.Parameter(\n                torch.ones(num_experts, dtype=torch.float32), requires_grad=False","sourceCodeStart":191,"sourceCodeEnd":227,"githubUrl":"https://github.com/sgl-project/sglang/blob/0132848349585cfe6aae51c4941cbae872505f8a/python/sglang/srt/layers/quantization/compressed_tensors/schemes/compressed_tensors_w8a8_fp8_moe.py#L191-L227","documentation":"create_weights for the FP8 MoE scheme supports only TENSOR, CHANNEL (and BLOCK when weight_block_size is set) weight strategies for w13/w2 scale allocation. Any other strategy hits this raise.","triggerScenarios":"A compressed-tensors FP8 MoE checkpoint whose weight_quant.strategy is something other than tensor/channel/block reaches the scale-allocation else branch.","commonSituations":"Novel quant strategies from newer llmcompressor versions; corrupted or hand-edited quant configs.","solutions":["Inspect quantization_config weights strategy; re-quantize as channel, tensor, or block","Upgrade SGLang to a version supporting the new strategy","Validate the checkpoint was produced by a compatible llmcompressor version"],"exampleFix":"// before: \"weights\": {\"strategy\": \"group\"}\n// after: \"weights\": {\"strategy\": \"channel\"}","handlingStrategy":"validation","validationCode":"assert cfg[\"quantization_config\"][\"weights\"][\"strategy\"] in {\"tensor\", \"channel\", \"block\"}","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Validate quant config schema on checkpoint creation"],"tags":["quantization","fp8","moe","strategy","compressed-tensors"],"backgroundTag":"unsupported-quantization-strategy","analyzedSha":"0132848349585cfe6aae51c4941cbae872505f8a","analyzedAt":"2026-08-28T05:10:05.995Z","schemaVersion":2},"datasetVersion":"2026-08-28T06:17:29.519Z"}