sgl-project/sglang · error · ValueError

Comfy NVFP4 layer {prefix!r} must request full_precision_mat

Error message

Comfy NVFP4 layer {prefix!r} must request full_precision_matrix_mult

What it means

Every nvfp4-format layer marker must explicitly set full_precision_matrix_mult to True, since this runtime implements the full-precision matmul dequant path. A marker missing the flag or setting it False raises.

Source

Thrown at python/sglang/multimodal_gen/runtime/layers/quantization/comfy_nvfp4.py:189

        super().__init__(
            is_checkpoint_nvfp4_serialized=True,
            group_size=16,
            exclude_modules=[],
            checkpoint_uses_comfy_quantization=True,
        )
        self.layer_markers = layer_markers
        self.selected: list[str] = []
        for prefix, marker in layer_markers.items():
            marker_format = marker.get("format")
            if marker_format == "int8_tensorwise" and marker.get("_is_rowwise"):
                continue
            if marker_format != "nvfp4":
                raise ValueError(
                    f"Unsupported Comfy NVFP4 companion for {prefix!r}: "
                    f"{marker_format!r}"
                )
            if marker.get("full_precision_matrix_mult") is not True:
                raise ValueError(
                    f"Comfy NVFP4 layer {prefix!r} must request "
                    "full_precision_matrix_mult"
                )

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

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

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

    @classmethod
    def get_config_filenames(cls) -> list[str]:

View on GitHub (pinned to 0132848349)

Solutions

  1. Regenerate/re-save the checkpoint so nvfp4 markers include full_precision_matrix_mult: true
  2. Patch the marker metadata for the listed prefix if you control the files
  3. Use a ComfyUI export path known to set the flag
Defensive patterns

Strategy: validation

Validate before calling

for p, m in layer_markers.items():
    if m.get("format") == "nvfp4" and m.get("full_precision_matrix_mult") is not True:
        raise SystemExit(f"{p} missing full_precision_matrix_mult marker")

Prevention

When it happens

Trigger: An nvfp4 layer marker where marker.get("full_precision_matrix_mult") is not True — flag missing or False in the safetensors metadata.

Common situations: Checkpoints quantized by tools that don't emit the full_precision_matrix_mult flag; hand-written or older-format markers.

Related errors


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