{"record":{"id":"98b3b9a6ad76d7df","repo":"sgl-project/sglang","slug":"comfy-full-precision-matrix-mult-does-not-support-98b3b9","errorCode":null,"errorMessage":"Comfy full_precision_matrix_mult does not support fused linears","messagePattern":"Comfy full_precision_matrix_mult does not support fused linears","errorType":"validation","errorClass":"ValueError","httpStatus":null,"severity":"error","filePath":"python/sglang/multimodal_gen/runtime/layers/quantization/comfy_nvfp4.py","lineNumber":117,"sourceCode":"        quant_config: ComfyNvfp4Config,\n        *,\n        has_pre_quant_scale: bool,\n    ) -> None:\n        self.quant_config = quant_config\n        self.has_pre_quant_scale = has_pre_quant_scale\n\n    def create_weights(\n        self,\n        layer: nn.Module,\n        input_size_per_partition: int,\n        output_partition_sizes: list[int],\n        input_size: int,\n        output_size: int,\n        params_dtype: torch.dtype,\n        **extra_weight_attrs: Any,\n    ) -> None:\n        if len(output_partition_sizes) != 1:\n            raise ValueError(\n                \"Comfy full_precision_matrix_mult does not support fused linears\"\n            )\n        super().create_weights(\n            layer,\n            input_size_per_partition,\n            output_partition_sizes,\n            input_size,\n            output_size,\n            params_dtype,\n            **extra_weight_attrs,\n        )\n        # Comfy uses runtime activations directly for this weight-only path.\n        layer.register_parameter(\"input_scale\", None)\n        if not self.has_pre_quant_scale:\n            return\n        _register_parameter(\n            layer,\n            \"pre_quant_scale\",","sourceCodeStart":99,"sourceCodeEnd":135,"githubUrl":"https://github.com/sgl-project/sglang/blob/0132848349585cfe6aae51c4941cbae872505f8a/python/sglang/multimodal_gen/runtime/layers/quantization/comfy_nvfp4.py#L99-L135","documentation":"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.","triggerScenarios":"create_weights on a comfy_nvfp4 layer with more than one output partition size (merged/fused projections).","commonSituations":"Loading Comfy NVFP4 checkpoints with fused qkv or gated-fused projections.","solutions":["Build the projections as separate linears (one output partition each)","Use a quant method supporting fused output partitions"],"exampleFix":null,"handlingStrategy":"validation","validationCode":"if len(output_partition_sizes) != 1:\n    raise SystemExit(\"comfy_nvfp4 requires unfused linear layers\")","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Keep projections unfused for comfy_nvfp4 checkpoints"],"tags":["quantization","nvfp4","comfy","fused-layers"],"backgroundTag":"unsupported-layer-fusion","analyzedSha":"0132848349585cfe6aae51c4941cbae872505f8a","analyzedAt":"2026-08-28T05:10:05.995Z","schemaVersion":2},"datasetVersion":"2026-08-28T06:17:29.519Z"}