{"record":{"id":"64710ddf13640a8c","repo":"sgl-project/sglang","slug":"unsupported-activation-scheme-activation-scheme-64710d","errorCode":null,"errorMessage":"Unsupported activation scheme {activation_scheme}","messagePattern":"Unsupported activation scheme (.+?)","errorType":"validation","errorClass":"ValueError","httpStatus":null,"severity":"error","filePath":"python/sglang/srt/layers/quantization/fp8.py","lineNumber":248,"sourceCode":"        is_checkpoint_fp8_serialized: bool = False,\n        activation_scheme: str = \"dynamic\",\n        ignored_layers: Optional[List[str]] = None,\n        weight_block_size: List[int] = None,\n        packed_modules_mapping: Optional[Dict[str, List[str]]] = None,\n        use_mxfp8: bool = False,\n        is_fp4_experts: bool = False,\n        kv_cache_quant_algo: Optional[str] = None,\n    ) -> None:\n        super().__init__()\n        # DSV4 mxfp4-packed (True) vs converted FP8 (False); injected by\n        # model_loader from ModelConfig. Default False off the DSV4 path.\n        self.is_fp4_experts = is_fp4_experts\n        self.dequant_fp4_to_fp8 = False\n        self.is_checkpoint_fp8_serialized = is_checkpoint_fp8_serialized\n        if is_checkpoint_fp8_serialized:\n            log_info_on_rank0(logger, \"Detected fp8 checkpoint.\")\n        if activation_scheme not in ACTIVATION_SCHEMES:\n            raise ValueError(f\"Unsupported activation scheme {activation_scheme}\")\n        self.activation_scheme = activation_scheme\n        self.ignored_layers = ignored_layers or []\n        if ignored_layers_str := envs.SGLANG_FP8_IGNORED_LAYERS.get():\n            self.ignored_layers.extend(\n                [\n                    layer.strip()\n                    for layer in ignored_layers_str.split(\",\")\n                    if layer.strip()\n                ]\n            )\n        self.packed_modules_mapping = packed_modules_mapping or {}\n        self.use_mxfp8 = use_mxfp8\n        self.kv_cache_quant_algo = kv_cache_quant_algo\n        if weight_block_size is not None:\n            if not is_checkpoint_fp8_serialized:\n                raise ValueError(\n                    \"The block-wise quantization only supports fp8-serialized checkpoint for now.\"\n                )","sourceCodeStart":230,"sourceCodeEnd":266,"githubUrl":"https://github.com/sgl-project/sglang/blob/0132848349585cfe6aae51c4941cbae872505f8a/python/sglang/srt/layers/quantization/fp8.py#L230-L266","documentation":"The Fp8LinearConfig constructor validates activation_scheme against the ACTIVATION_SCHEMES whitelist ('static' and 'dynamic'). Any other string — including 'none', 'None' handled elsewhere, typos, or new scheme names — raises this ValueError at config construction time, before weights are created.","triggerScenarios":"Constructing Fp8LinearConfig(activation_scheme=...) with a value outside ACTIVATION_SCHEMES; usually triggered by parsing a checkpoint's quantization_config where activation_scheme is something like \"static_per_token\", \"\" (empty), or miscapitalized \"Dynamic\".","commonSituations":"Fine-tuned checkpoints saved with custom quant tools that write non-standard activation_scheme values; hand-edited config.json quantization sections; schemas that use \"delayed\" or other schemes SGLang hasn't mapped.","solutions":["Set activation_scheme to \"static\" or \"dynamic\" in the model's config.json quantization_config","If the checkpoint truly uses a per-token scheme, map it to \"dynamic\" which covers per-token dynamic quantization","Check for trailing whitespace/case issues in the config value"],"exampleFix":"// before\n\"quantization_config\": { \"quant_method\": \"fp8\", \"activation_scheme\": \"static_per_token\" }\n// after\n\"quantization_config\": { \"quant_method\": \"fp8\", \"activation_scheme\": \"dynamic\" }","handlingStrategy":"validation","validationCode":"from sglang.srt.layers.quantization.fp8 import Fp8LinearConfig  # ACTIVATION_SCHEMES lives in config module\nscheme = qcfg.get(\"activation_scheme\", \"dynamic\")\nif scheme not in (\"static\", \"dynamic\"):\n    qcfg[\"activation_scheme\"] = \"dynamic\"  # or hard-fail with a clear message","typeGuard":"def is_valid_activation_scheme(s: str) -> bool:\n    return s in {\"static\", \"dynamic\"}","tryCatchPattern":"try:\n    cfg = Fp8LinearConfig(...)\nexcept ValueError as e:\n    if \"activation scheme\" in str(e):\n        cfg = Fp8LinearConfig(..., activation_scheme=\"dynamic\")\n    else:\n        raise","preventionTips":["Normalize activation_scheme to static/dynamic when ingesting third-party checkpoints","Schema-validate quantization_config before model load","Fail fast in data pipelines writing quant configs"],"tags":["quantization","fp8","config-validation","checkpoint-config"],"backgroundTag":"invalid-config-value","analyzedSha":"0132848349585cfe6aae51c4941cbae872505f8a","analyzedAt":"2026-08-28T05:10:05.995Z","schemaVersion":2},"datasetVersion":"2026-08-28T06:17:29.519Z"}