sgl-project/sglang · critical · ValueError

Unsupported Comfy W4A4 format for {prefix!r}: {marker_format

Error message

Unsupported Comfy W4A4 format for {prefix!r}: {marker_format!r}

What it means

Every layer marker passed to KitchenW4A4Config must be either 'int8_tensorwise' (delegated to the companion INT8 config) or 'convrot_w4a4'. Any other format string aborts config construction.

Source

Thrown at python/sglang/multimodal_gen/runtime/layers/quantization/configs/kitchen_w4a4_config.py:66

                )
        self.layer_markers = layer_markers
        self.checkpoint_uses_native_qkv_layout = True
        self.selected: list[str] = []
        int8_markers = {
            prefix: marker
            for prefix, marker in layer_markers.items()
            if marker.get("format") == "int8_tensorwise"
        }
        self._int8_config = (
            KitchenInt8Config(layer_markers=int8_markers) if int8_markers else None
        )

        for prefix, marker in layer_markers.items():
            marker_format = marker.get("format")
            if marker_format == "int8_tensorwise":
                continue
            if marker_format != "convrot_w4a4":
                raise ValueError(
                    f"Unsupported Comfy W4A4 format for {prefix!r}: "
                    f"{marker_format!r}"
                )
            self._parse_marker(prefix, marker)

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

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

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

    @classmethod

View on GitHub (pinned to 0132848349)

Solutions

  1. Re-export the checkpoint with only convrot_w4a4 / int8_tensorwise layers
  2. Load under the config matching the actual marker format (comfy_nvfp4, kitchen_w4a8, ...)

Example fix

// before
{"format": "nvfp4"}
// after
{"format": "convrot_w4a4", "convrot_groupsize": 256, "linear_dtype": "int4"}
Defensive patterns

Strategy: validation

Validate before calling

for prefix, m in layer_markers.items():
    fmt = m.get("format")
    assert fmt in ("int8_tensorwise", "convrot_w4a4"), (prefix, fmt)

Type guard

def is_w4a4_loadable_marker(m: dict) -> bool:
    return m.get("format") in ("int8_tensorwise", "convrot_w4a4")

Prevention

When it happens

Trigger: A layer_markers entry with format like 'nvfp4' or 'asym_w4a8_int8' while instantiating KitchenW4A4Config.

Common situations: Mixed-quantization exports; picking the wrong quant config name for the checkpoint's actual scheme.

Related errors


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