{"record":{"id":"f1f9804caecb2412","repo":"sgl-project/sglang","slug":"requantization-into-config-requantization-method","errorCode":null,"errorMessage":"Requantization into {config['requantization_method']} is not supported, from the original quant_method={config['quant_method']} and activation_scheme={config.get('activation_scheme')}.","messagePattern":"Requantization into (.+?) is not supported, from the original quant_method=(.+?) and activation_scheme=(.+?)\\.","errorType":"exception","errorClass":"NotImplementedError","httpStatus":null,"severity":"error","filePath":"python/sglang/srt/layers/quantization/quark/quark.py","lineNumber":494,"sourceCode":"\n            # Pure FP8 source: every layer is requantized FP8 -> MXFP4.\n            if (\n                config.get(\"quant_method\") == \"fp8\"\n                and config.get(\"activation_scheme\") == \"dynamic\"\n            ):\n                quant_config = QuarkConfig._create_online_mxfp4_config(\n                    model_type=hf_config.model_type\n                )\n                dequantization_config = Fp8Config.from_config(config)\n                return cls(\n                    quant_config=quant_config,\n                    hf_config=hf_config,\n                    is_prequantized=False,\n                    dequantization_config=dequantization_config,\n                    online_scheme=config[\"requantization_method\"],\n                )\n\n            raise NotImplementedError(\n                f\"Requantization into {config['requantization_method']} is not supported, \"\n                f\"from the original quant_method={config['quant_method']} \"\n                f\"and activation_scheme={config.get('activation_scheme')}.\"\n            )\n\n        if config[\"quant_method\"] != \"quark\":\n            raise ValueError(\n                f\"QuarkConfig.from_config invoked with non-quark quant_method \"\n                f\"{config['quant_method']!r} but no requantization_method set.\"\n            )\n\n        export_config = config.get(\"export\")\n        if export_config is None:\n            raise ValueError(\n                \"The export key should be included in \"\n                \"the configurations of Quark quantized model\"\n            )\n","sourceCodeStart":476,"sourceCodeEnd":512,"githubUrl":"https://github.com/sgl-project/sglang/blob/0132848349585cfe6aae51c4941cbae872505f8a/python/sglang/srt/layers/quantization/quark/quark.py#L476-L512","documentation":"from_config supports a limited set of requantization transitions, decided by the checkpoint's quant_method + activation_scheme versus the requested requantization_method. When the pair doesn't match any implemented branch (the code falls through all supported cases for config['requantization_method']), it raises NotImplementedError naming the original quant_method and activation_scheme so the user knows which transition is missing.","triggerScenarios":"Loading a checkpoint whose quant_config sets requantization_method to something unsupported for its base quant_method/activation_scheme (e.g. requantization into MXFP4 from an FP8 static-scale checkpoint, or any combination outside the implemented NVFP4->quark_mxfp4 style transitions).","commonSituations":"Checkpoints produced by newer llm-compressor/quark exporters requesting transitions sglang hasn't implemented; hand-edited quant_config.json with a different requantization_method; version mismatch between exporter and sglang runtime.","solutions":["Serve the checkpoint with its native quantization (remove/blank requantization_method or don't force --quantization), letting the base quant_method path handle it.","Re-export the checkpoint using a supported transition (NVFP4 checkpoint + requantization to quark MXFP4).","Upgrade sglang to a release that implements the requested transition; check release notes for requantization support."],"exampleFix":"# before\n# quant_config.json: quant_method=\"fp8\", activation_scheme=\"static\", requantization_method=\"quark_mxfp4\" -> raises\n\n# after\n# quant_config.json: quant_method=\"NVFP4\", requantization_method=\"quark_mxfp4\" (supported transition)","handlingStrategy":"validation","validationCode":"SUPPORTED_TRANSITIONS = {(\"NVFP4\", None, \"quark_mxfp4\")}  # (quant_method, activation_scheme, requantization_method)\nkey = (config.get(\"quant_method\"), config.get(\"activation_scheme\"), config.get(\"requantization_method\"))\nif config.get(\"requantization_method\") and key not in SUPPORTED_TRANSITIONS:\n    raise RuntimeError(f\"Unsupported requantization transition: {key}; serve natively\")","typeGuard":"def requantization_transition_supported(config: dict) -> bool:\n    rm = config.get(\"requantization_method\")\n    return rm is None or (config.get(\"quant_method\"), config.get(\"activation_scheme\"), rm) in {\n        (\"NVFP4\", None, \"quark_mxfp4\"),\n    }","tryCatchPattern":"try:\n    QuarkConfig.from_config(quant_config=config, hf_config=hf_config)\nexcept NotImplementedError as e:\n    if \"Requantization into\" in str(e):\n        config = {k: v for k, v in config.items() if k != \"requantization_method\"}\n        QuarkConfig.from_config(quant_config=config, hf_config=hf_config)\n    else:\n        raise","preventionTips":["Strip or validate requantization_method in quant_config.json before serving with a forced --quantization.","Pin exporter and sglang versions together; test the pair in CI.","Maintain a support matrix of quant transitions and validate checkpoints against it at download time."],"tags":["quantization","quark","requantization","not-implemented","checkpoint","python"],"backgroundTag":"unsupported-quantization-algo","analyzedSha":"0132848349585cfe6aae51c4941cbae872505f8a","analyzedAt":"2026-08-28T05:10:05.995Z","schemaVersion":2},"datasetVersion":"2026-08-28T06:17:29.519Z"}