sgl-project/sglang · error · ValueError

{} does not support QVG KV-cache quantization

Error message

{} does not support QVG KV-cache quantization

What it means

If KV-cache quantization (QVG) is enabled in server args but the stage's _supports_qvg_kv_cache_quantization() returns False (base implementation always False), the causal denoising stage refuses to run rather than silently producing wrong quantized-cache handling.

Source

Thrown at python/sglang/multimodal_gen/runtime/pipelines_core/stages/causal_denoising.py:424

            "realtime_causal_kv_cache_num_frames",
            None,
        )
        if kv_cache_num_frames is None:
            kv_cache_num_frames = getattr(
                pipeline_config,
                "realtime_causal_kv_cache_num_frames",
                None,
            )
        if kv_cache_num_frames is not None:
            if kv_cache_num_frames <= 0:
                raise ValueError("realtime_causal_kv_cache_num_frames must be positive")
            self.sliding_window_num_frames = int(kv_cache_num_frames)

        if (
            server_args.kv_cache_quant_config.enabled
            and not self._supports_qvg_kv_cache_quantization()
        ):
            raise ValueError(
                f"{type(self).__name__} does not support QVG KV-cache quantization"
            )

    def _supports_qvg_kv_cache_quantization(self) -> bool:
        return False

    def _causal_sequence_shard_enabled(self, batch: Req) -> bool:
        return False

    def _num_causal_cache_attention_heads(
        self,
        *,
        sequence_shard_enabled: bool,
    ) -> int:
        return self.transformer.num_attention_heads

    def _causal_kv_cache_kwargs(
        self,

View on GitHub (pinned to 0132848349)

Solutions

  1. Disable KV-cache quantization (kv_cache_quant_config.enabled=False) for this pipeline
  2. Use a stage subclass that implements _supports_qvg_kv_cache_quantization() returning True only if actually supported
  3. Request/await QVG support for your model architecture

Example fix

# before
server_args.kv_cache_quant_config.enabled = True
# after
server_args.kv_cache_quant_config.enabled = False
Defensive patterns

Strategy: validation

Validate before calling

if server_args.kv_cache_quant_config.enabled:
    assert stage._supports_qvg_kv_cache_quantization(), 'stage lacks QVG support'

Prevention

When it happens

Trigger: Launching with server_args.kv_cache_quant_config.enabled=True using a causal denoising stage/model that has not opted into QVG support.

Common situations: Enabling a global kv-cache quantization flag intended for LLM backends on a multimodal/diffusion deployment; new model not yet supporting quantized cache.

Related errors


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