{"record":{"id":"5963a147d762cbdc","repo":"sgl-project/sglang","slug":"unsupported-weight-strategy-self-strategy-suppo","errorCode":null,"errorMessage":"Unsupported weight strategy={self.strategy}, supported strategies are {SUPPORTED_STRATEGIES}","messagePattern":"Unsupported weight strategy=(.+?), supported strategies are (.+?)","errorType":"validation","errorClass":"ValueError","httpStatus":null,"severity":"error","filePath":"python/sglang/srt/layers/quantization/compressed_tensors/schemes/compressed_tensors_w8a16_fp8.py","lineNumber":106,"sourceCode":"            output_dim=0,\n            weight_loader=weight_loader,\n        )\n        layer.register_parameter(\"weight\", weight)\n\n        # WEIGHT SCALE\n        if self.strategy == QuantizationStrategy.CHANNEL:\n            weight_scale = ChannelQuantScaleParameter(\n                data=torch.empty((sum(output_partition_sizes), 1), dtype=torch.float32),\n                output_dim=0,\n                weight_loader=weight_loader,\n            )\n        elif self.strategy == QuantizationStrategy.TENSOR:\n            weight_scale = PerTensorScaleParameter(\n                data=torch.empty(len(output_partition_sizes), dtype=torch.float32),\n                weight_loader=weight_loader,\n            )\n        else:\n            raise ValueError(\n                f\"Unsupported weight strategy={self.strategy}, \"\n                f\"supported strategies are {SUPPORTED_STRATEGIES}\"\n            )\n\n        weight_scale[:] = torch.finfo(torch.float32).min\n        layer.register_parameter(\"weight_scale\", weight_scale)\n\n        # INPUT SCALE (to deal with converted checkpoints)\n        if self.is_static_input_scheme:\n            input_scale = PerTensorScaleParameter(\n                data=torch.empty(len(output_partition_sizes), dtype=torch.float32),\n                weight_loader=weight_loader,\n            )\n            layer.register_parameter(\"input_scale\", input_scale)\n\n    def apply_weights(\n        self,\n        layer: torch.nn.Module,","sourceCodeStart":88,"sourceCodeEnd":124,"githubUrl":"https://github.com/sgl-project/sglang/blob/0132848349585cfe6aae51c4941cbae872505f8a/python/sglang/srt/layers/quantization/compressed_tensors/schemes/compressed_tensors_w8a16_fp8.py#L88-L124","documentation":"create_weights for the W8A16 FP8 scheme only knows how to build weight_scale parameters for CHANNEL and TENSOR strategies. Any other QuantizationStrategy (e.g. BLOCK/grouped) falls through to this ValueError.","triggerScenarios":"A compressed-tensors checkpoint whose weights section declares strategy 'block' (grouped FP8 with a group_size) is routed to CompressedTensorsW8A16Fp8; the strategy is neither CHANNEL nor TENSOR when allocating weight_scale.","commonSituations":"Quantizing with block-wise FP8 weights but per-token dynamic activations, causing scheme dispatch to the W8A16 path; mismatched quantization recipes between weights and activations.","solutions":["Re-quantize weights as channelwise (strategy: channel) or per-tensor so the W8A16 FP8 path applies","Verify the weights section of quantization_config: strategy should be \"channel\" or \"tensor\"","If block-quantized FP8 is intended, use a scheme that supports BLOCK (W8A8 fp8 block path) by also quantizing activations"],"exampleFix":"// before\n\"weights\": {\"strategy\": \"block\", \"group_size\": 128}\n// after\n\"weights\": {\"strategy\": \"channel\"}","handlingStrategy":"validation","validationCode":"strategy = cfg[\"quantization_config\"][\"weights\"][\"strategy\"]\nassert strategy in (\"channel\", \"tensor\"), f\"W8A16 fp8 unsupported strategy {strategy}\"","typeGuard":"def is_w8a16_compatible(w):\n    return w.get(\"strategy\") in {\"channel\", \"tensor\"}","tryCatchPattern":null,"preventionTips":["Standardize quantization recipes on supported strategies","Automate config linting in the model release pipeline"],"tags":["quantization","fp8","w8a16","compressed-tensors","strategy"],"backgroundTag":"unsupported-quantization-strategy","analyzedSha":"0132848349585cfe6aae51c4941cbae872505f8a","analyzedAt":"2026-08-28T05:10:05.995Z","schemaVersion":2},"datasetVersion":"2026-08-28T06:17:29.519Z"}