{"record":{"id":"d9991014a8b254e4","repo":"sgl-project/sglang","slug":"this-tool-only-supports-modelopt-diffusers-fp8-exp","errorCode":null,"errorMessage":"This tool only supports ModelOpt diffusers FP8 exports (quant_method=modelopt).","messagePattern":"This tool only supports ModelOpt diffusers FP8 exports \\(quant_method=modelopt\\)\\.","errorType":"validation","errorClass":"ValueError","httpStatus":null,"severity":"error","filePath":"python/sglang/multimodal_gen/tools/build_modelopt_fp8_transformer.py","lineNumber":570,"sourceCode":"    model_type: str = \"auto\",\n    keep_bf16_patterns: Sequence[str] | None = None,\n    maxbound: float = FP8_E4M3_MAXBOUND,\n    overwrite: bool = False,\n) -> dict[str, int]:\n    source_dir = _resolve_transformer_dir(modelopt_hf_dir)\n    backbone_ckpt_path = _resolve_backbone_ckpt(modelopt_backbone_ckpt)\n    base_dir = (\n        _resolve_transformer_dir(base_transformer_dir) if base_transformer_dir else None\n    )\n\n    config = _load_config(source_dir)\n    quant_config = config.get(\"quantization_config\")\n    if not isinstance(quant_config, dict):\n        raise ValueError(\n            \"Expected a flat quantization_config dict in the ModelOpt export.\"\n        )\n    if quant_config.get(\"quant_method\") != \"modelopt\":\n        raise ValueError(\n            \"This tool only supports ModelOpt diffusers FP8 exports \"\n            \"(quant_method=modelopt).\"\n        )\n\n    source_weight_map_all, index_filename = _load_weight_map(source_dir)\n    source_metadata = _load_first_shard_metadata(source_dir, source_weight_map_all)\n    is_ltx2_export = _is_ltx2_x0_export(\n        config=config,\n        source_metadata=source_metadata,\n        source_weight_map=source_weight_map_all,\n    )\n    class_name = config.get(\"_class_name\")\n    runtime_name_mapper = _get_runtime_module_name_mapper(\n        model_type=model_type, class_name=class_name\n    )\n    ignore_patterns = list(quant_config.get(\"ignore\", []) or [])\n    patterns = list(\n        get_default_keep_bf16_patterns(model_type=model_type, class_name=class_name)","sourceCodeStart":552,"sourceCodeEnd":588,"githubUrl":"https://github.com/sgl-project/sglang/blob/0132848349585cfe6aae51c4941cbae872505f8a/python/sglang/multimodal_gen/tools/build_modelopt_fp8_transformer.py#L552-L588","documentation":"quantization_config exists but its quant_method is not 'modelopt', so the export came from a different quantizer (awq, gptq, fp8 native, etc.) which this tool cannot process.","triggerScenarios":"Passing an AWQ/GPTQ/other-quantized checkpoint to the ModelOpt FP8 transformer builder.","commonSituations":"Mixing up checkpoint variants; a pipeline quantized with vLLM-native fp8 instead of ModelOpt.","solutions":["Use a checkpoint quantized with ModelOpt (quant_method == 'modelopt')","Or use the appropriate tool for the actual quantizer","Check quantization_config.quant_method in config.json before running"],"exampleFix":null,"handlingStrategy":"type-guard","validationCode":"qc = json.load(open(cfg_path)).get(\"quantization_config\", {})\nassert qc.get(\"quant_method\") == \"modelopt\", f\"unsupported quantizer: {qc.get('quant_method')}\"","typeGuard":"def is_modelopt_export(cfg: dict) -> bool:\n    qc = cfg.get(\"quantization_config\")\n    return isinstance(qc, dict) and qc.get(\"quant_method\") == \"modelopt\"","tryCatchPattern":null,"preventionTips":["Inspect quant_method in config.json when sourcing checkpoints from mixed pipelines"],"tags":["modelopt","fp8","quantization","config"],"backgroundTag":"unsupported-quantization-scheme","analyzedSha":"0132848349585cfe6aae51c4941cbae872505f8a","analyzedAt":"2026-08-28T05:10:05.995Z","schemaVersion":2},"datasetVersion":"2026-08-28T06:17:29.519Z"}