{"record":{"id":"3ed5a48a68a8c574","repo":"sgl-project/sglang","slug":"found-static-activation-scheme-for-checkpoint-that","errorCode":null,"errorMessage":"Found static activation scheme for checkpoint that was not serialized fp8.","messagePattern":"Found static activation scheme for checkpoint that was not serialized fp8\\.","errorType":"validation","errorClass":"ValueError","httpStatus":null,"severity":"error","filePath":"python/sglang/srt/layers/quantization/fp8.py","lineNumber":1384,"sourceCode":"\n        # If loading fp8 checkpoint, pass the weight loaders.\n        # If loading an fp16 checkpoint, do not (we will quantize in\n        #   process_weights_after_loading()\n        if quant_config.is_checkpoint_fp8_serialized:\n            set_weight_attrs(w13_weight_scale, extra_weight_attrs)\n            set_weight_attrs(w2_weight_scale, extra_weight_attrs)\n\n            if _is_hip and _use_hip_int4:\n                extra_weight_attrs.update(\n                    {\"quant_method\": FusedMoeWeightScaleSupported.CHANNEL.value}\n                )\n                set_weight_attrs(w13_weight_scale1, extra_weight_attrs)\n                set_weight_attrs(w2_weight_scale1, extra_weight_attrs)\n\n        # INPUT_SCALES\n        if quant_config.activation_scheme == \"static\":\n            if not quant_config.is_checkpoint_fp8_serialized:\n                raise ValueError(\n                    \"Found static activation scheme for checkpoint that \"\n                    \"was not serialized fp8.\"\n                )\n\n            w13_input_scale = torch.nn.Parameter(\n                torch.ones(num_experts, dtype=torch.float32), requires_grad=False\n            )\n            layer.register_parameter(\"w13_input_scale\", w13_input_scale)\n            set_weight_attrs(w13_input_scale, extra_weight_attrs)\n\n            w2_input_scale = torch.nn.Parameter(\n                torch.ones(num_experts, dtype=torch.float32), requires_grad=False\n            )\n            layer.register_parameter(\"w2_input_scale\", w2_input_scale)\n            set_weight_attrs(w2_input_scale, extra_weight_attrs)\n\n        else:\n            layer.w13_input_scale = None","sourceCodeStart":1366,"sourceCodeEnd":1402,"githubUrl":"https://github.com/sgl-project/sglang/blob/0132848349585cfe6aae51c4941cbae872505f8a/python/sglang/srt/layers/quantization/fp8.py#L1366-L1402","documentation":"When an FP8 MoE quant config declares activation_scheme=\"static\", the loader expects per-expert input scales (w13/w2 input_scale tensors) which only exist in FP8-serialized checkpoints. If the checkpoint was not FP8-serialized, those scales cannot exist, so create_fp8_moe_weight_ raises this contradiction.","triggerScenarios":"Creating MoE weights with quant_config.activation_scheme == \"static\" and quant_config.is_checkpoint_fp8_serialized == False — a config claiming static FP8 activation quantization over a non-FP8 checkpoint.","commonSituations":"Hand-written quantization_configs copied from FP8 models onto BF16 weights; configs produced by tools that always emit \"static\" regardless of serialization; misconverted checkpoints.","solutions":["Use a checkpoint that actually ships FP8 weights and static input scales","Change activation_scheme to \"dynamic\" (works with on-the-fly quantization)","Remove/fix the quantization_config if the model is not quantized"],"exampleFix":"// before\n{\"quant_method\":\"fp8\",\"activation_scheme\":\"static\"}  // on BF16 weights\n// after\n{\"quant_method\":\"fp8\",\"activation_scheme\":\"dynamic\"}","handlingStrategy":"validation","validationCode":"qcfg = model_config.quantization_config\nif qcfg.get(\"activation_scheme\") == \"static\" and not qcfg.get(\"is_checkpoint_fp8_serialized\", False):\n    raise SystemExit(\"static activation scheme requires an FP8-serialized checkpoint\")","typeGuard":"def static_scheme_consistent(qcfg: dict) -> bool:\n    return qcfg.get(\"activation_scheme\") != \"static\" or bool(qcfg.get(\"is_checkpoint_fp8_serialized\"))","tryCatchPattern":null,"preventionTips":["Validate static-scheme configs against checkpoint format before load","Prefer dynamic scheme for on-the-fly quantization"],"tags":["quantization","fp8","moe","activation-scheme","checkpoint-config"],"backgroundTag":"checkpoint-quant-config-mismatch","analyzedSha":"0132848349585cfe6aae51c4941cbae872505f8a","analyzedAt":"2026-08-28T05:10:05.995Z","schemaVersion":2},"datasetVersion":"2026-08-28T06:17:29.519Z"}