sgl-project/sglang · error · ValueError

Comfy full_precision_matrix_mult does not support fused line

Error message

Comfy full_precision_matrix_mult does not support fused linears

What it means

Same constraint as comfy_fp8: the Comfy full_precision_matrix_mult NVFP4 path allocates one weight per layer and rejects fused linears where output_partition_sizes has multiple entries before delegating to super().create_weights.

Source

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

        quant_config: ComfyNvfp4Config,
        *,
        has_pre_quant_scale: bool,
    ) -> None:
        self.quant_config = quant_config
        self.has_pre_quant_scale = has_pre_quant_scale

    def create_weights(
        self,
        layer: nn.Module,
        input_size_per_partition: int,
        output_partition_sizes: list[int],
        input_size: int,
        output_size: int,
        params_dtype: torch.dtype,
        **extra_weight_attrs: Any,
    ) -> None:
        if len(output_partition_sizes) != 1:
            raise ValueError(
                "Comfy full_precision_matrix_mult does not support fused linears"
            )
        super().create_weights(
            layer,
            input_size_per_partition,
            output_partition_sizes,
            input_size,
            output_size,
            params_dtype,
            **extra_weight_attrs,
        )
        # Comfy uses runtime activations directly for this weight-only path.
        layer.register_parameter("input_scale", None)
        if not self.has_pre_quant_scale:
            return
        _register_parameter(
            layer,
            "pre_quant_scale",

View on GitHub (pinned to 0132848349)

Solutions

  1. Build the projections as separate linears (one output partition each)
  2. Use a quant method supporting fused output partitions
Defensive patterns

Strategy: validation

Validate before calling

if len(output_partition_sizes) != 1:
    raise SystemExit("comfy_nvfp4 requires unfused linear layers")

Prevention

When it happens

Trigger: create_weights on a comfy_nvfp4 layer with more than one output partition size (merged/fused projections).

Common situations: Loading Comfy NVFP4 checkpoints with fused qkv or gated-fused projections.

Related errors


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