sgl-project/sglang · error · ValueError

Unsupported Comfy FP8 layer formats: {unsupported}

Error message

Unsupported Comfy FP8 layer formats: {unsupported}

What it means

ComfyFp8Config scans per-layer safetensors markers and requires every layer's format to be float8_e4m3fn. Any layer marker with a different format is collected and reported in this error.

Source

Thrown at python/sglang/multimodal_gen/runtime/layers/quantization/comfy_fp8.py:111

    def __init__(self, layer_markers: dict[str, dict[str, Any]]) -> None:
        super().__init__()
        self.layer_markers = layer_markers
        self.selected: list[str] = []
        self._fp8_configs = {
            activation_scheme: Fp8Config(
                is_checkpoint_fp8_serialized=True,
                activation_scheme=activation_scheme,
            )
            for activation_scheme in ("static", "dynamic")
        }

        unsupported = {
            prefix: marker.get("format")
            for prefix, marker in layer_markers.items()
            if marker.get("format") != "float8_e4m3fn"
        }
        if unsupported:
            raise ValueError(f"Unsupported Comfy FP8 layer formats: {unsupported}")

    @classmethod
    def get_name(cls) -> str:
        return "comfy_fp8"

    @classmethod
    def get_supported_act_dtypes(cls) -> list[torch.dtype]:
        return Fp8Config.get_supported_act_dtypes()

    @classmethod
    def get_min_capability(cls) -> int:
        return Fp8Config.get_min_capability()

    @staticmethod
    def get_config_filenames() -> list[str]:
        return []

    @classmethod

View on GitHub (pinned to 0132848349)

Solutions

  1. Verify each layer's safetensors marker format; only float8_e4m3fn is supported
  2. Re-quantize the offending layers to float8_e4m3fn
  3. Use the appropriate config class for the actual formats present
Defensive patterns

Strategy: validation

Validate before calling

unsupported = {p: m.get("format") for p, m in layer_markers.items() if m.get("format") != "float8_e4m3fn"}
if unsupported:
    raise SystemExit(f"non-e4m3 layers present: {unsupported}")

Prevention

When it happens

Trigger: Constructing ComfyFp8Config from layer_markers where at least one prefix has marker["format"] != "float8_e4m3fn" (e.g. float8_e5m2 or int8 layers mixed in).

Common situations: Mixed-precision Comfy checkpoints (most layers e4m3 but some e5m2/int8); checkpoints saved by a different ComfyUI quantization tool.

Related errors


AI-assisted analysis of sgl-project/sglang@0132848349 (2026-08-28). Data as JSON: /api/errors/c853c5596e3c9adc. Report an issue: GitHub.