{"record":{"id":"0823dc45930ce2f3","repo":"sgl-project/sglang","slug":"the-srt-encoder-checkpoint-adapter-supports-only-s","errorCode":null,"errorMessage":"The SRT encoder checkpoint adapter supports only serialized 'fp8', got {quant_spec.declared_method!r}","messagePattern":"The SRT encoder checkpoint adapter supports only serialized 'fp8', got (.+?)","errorType":"validation","errorClass":"ComponentCheckpointUnsupportedError","httpStatus":null,"severity":"error","filePath":"python/sglang/multimodal_gen/runtime/loader/component_loaders/text_encoder_loader.py","lineNumber":158,"sourceCode":"    component_name: str,\n) -> None:\n    \"\"\"Use Transformers when it owns a standard serialized BnB4 checkpoint.\"\"\"\n    if uses_native_transformers_bnb4(component_config, component_name):\n        raise NativeComponentLoaderRequired(\n            f\"{component_name!r} delegates serialized bitsandbytes checkpoint \"\n            \"loading to Transformers\"\n        )\n\n\ndef _get_srt_encoder_quant_config(\n    component_config: dict,\n    model_cls: type[EncoderTensorParallelMixin],\n) -> SrtFp8Config | None:\n    quant_spec = resolve_checkpoint_quant_spec(component_config)\n    if quant_spec is None:\n        return None\n    if quant_spec.declared_method != \"fp8\":\n        raise ComponentCheckpointUnsupportedError(\n            \"The SRT encoder checkpoint adapter supports only serialized 'fp8', \"\n            f\"got {quant_spec.declared_method!r}\"\n        )\n\n    config = dict(quant_spec.config)\n    config[\"packed_modules_mapping\"] = model_cls.packed_modules_mapping\n    return SrtFp8Config.from_config(config)\n\n\ndef _get_encoder_quant_config(\n    component_config: dict,\n    component_model_path: str,\n    component_weights_path: str,\n    model_cls: type[nn.Module] | None = None,\n):\n    if (\n        model_cls is not None\n        and issubclass(model_cls, EncoderTensorParallelMixin)","sourceCodeStart":140,"sourceCodeEnd":176,"githubUrl":"https://github.com/sgl-project/sglang/blob/0132848349585cfe6aae51c4941cbae872505f8a/python/sglang/multimodal_gen/runtime/loader/component_loaders/text_encoder_loader.py#L140-L176","documentation":"For text encoders loaded through the SRT adapter path, only serialized fp8 checkpoints are supported. If the checkpoint's quant spec declares any other quant_method (bnb, gptq, awq, unspecified-with-config, etc.), ComponentCheckpointUnsupportedError is raised in _get_srt_encoder_quant_config.","triggerScenarios":"Loading a text encoder component whose config declares e.g. quant_method: 'bitsandbytes' while using the SRT encoder loading path with quantization enabled.","commonSituations":"Mixing quantization formats across components of a multimodal model (bnb text encoder + fp8 DiT); downloading a community-quantized encoder variant; enabling quantization flags that apply to all components.","solutions":["Use an fp8-serialized text encoder checkpoint (quant_method: 'fp8') or an unquantized one","Remove the quantization override for the text encoder component so it loads unquantized","Re-quantize the encoder to fp8 with the supported toolchain"],"exampleFix":null,"handlingStrategy":"validation","validationCode":"spec = resolve_checkpoint_quant_spec(encoder_config)\nassert spec is None or spec.declared_method == 'fp8', \\\n    f\"SRT encoder adapter only supports fp8, got {spec.declared_method}\"","typeGuard":null,"tryCatchPattern":"except ComponentCheckpointUnsupportedError as e:\n    if \"supports only serialized 'fp8'\" in str(e):\n        switch_to_unquantized_encoder_checkpoint()","preventionTips":["Use fp8 or unquantized text encoder checkpoints with the SRT path","Keep per-component quantization formats consistent with loader support"],"tags":["quantization","text-encoder","fp8","model-loading"],"backgroundTag":"unsupported-quantization-format","analyzedSha":"0132848349585cfe6aae51c4941cbae872505f8a","analyzedAt":"2026-08-28T05:10:05.995Z","schemaVersion":2},"datasetVersion":"2026-08-28T06:17:29.519Z"}