{"record":{"id":"a707af1470b485cc","repo":"sgl-project/sglang","slug":"does-not-support-qvg-kv-cache-quantization","errorCode":null,"errorMessage":"{} does not support QVG KV-cache quantization","messagePattern":"(.+?) does not support QVG KV-cache quantization","errorType":"validation","errorClass":"ValueError","httpStatus":null,"severity":"error","filePath":"python/sglang/multimodal_gen/runtime/pipelines_core/stages/causal_denoising.py","lineNumber":424,"sourceCode":"            \"realtime_causal_kv_cache_num_frames\",\n            None,\n        )\n        if kv_cache_num_frames is None:\n            kv_cache_num_frames = getattr(\n                pipeline_config,\n                \"realtime_causal_kv_cache_num_frames\",\n                None,\n            )\n        if kv_cache_num_frames is not None:\n            if kv_cache_num_frames <= 0:\n                raise ValueError(\"realtime_causal_kv_cache_num_frames must be positive\")\n            self.sliding_window_num_frames = int(kv_cache_num_frames)\n\n        if (\n            server_args.kv_cache_quant_config.enabled\n            and not self._supports_qvg_kv_cache_quantization()\n        ):\n            raise ValueError(\n                f\"{type(self).__name__} does not support QVG KV-cache quantization\"\n            )\n\n    def _supports_qvg_kv_cache_quantization(self) -> bool:\n        return False\n\n    def _causal_sequence_shard_enabled(self, batch: Req) -> bool:\n        return False\n\n    def _num_causal_cache_attention_heads(\n        self,\n        *,\n        sequence_shard_enabled: bool,\n    ) -> int:\n        return self.transformer.num_attention_heads\n\n    def _causal_kv_cache_kwargs(\n        self,","sourceCodeStart":406,"sourceCodeEnd":442,"githubUrl":"https://github.com/sgl-project/sglang/blob/0132848349585cfe6aae51c4941cbae872505f8a/python/sglang/multimodal_gen/runtime/pipelines_core/stages/causal_denoising.py#L406-L442","documentation":"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.","triggerScenarios":"Launching with server_args.kv_cache_quant_config.enabled=True using a causal denoising stage/model that has not opted into QVG support.","commonSituations":"Enabling a global kv-cache quantization flag intended for LLM backends on a multimodal/diffusion deployment; new model not yet supporting quantized cache.","solutions":["Disable KV-cache quantization (kv_cache_quant_config.enabled=False) for this pipeline","Use a stage subclass that implements _supports_qvg_kv_cache_quantization() returning True only if actually supported","Request/await QVG support for your model architecture"],"exampleFix":"# before\nserver_args.kv_cache_quant_config.enabled = True\n# after\nserver_args.kv_cache_quant_config.enabled = False","handlingStrategy":"validation","validationCode":"if server_args.kv_cache_quant_config.enabled:\n    assert stage._supports_qvg_kv_cache_quantization(), 'stage lacks QVG support'","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Gate kv-cache quantization flags per-model in deployment configs","Check capability flags before enabling global quantization"],"tags":["kv-cache","quantization","unsupported-feature"],"backgroundTag":"unsupported-feature-combination","analyzedSha":"0132848349585cfe6aae51c4941cbae872505f8a","analyzedAt":"2026-08-28T05:10:05.995Z","schemaVersion":2},"datasetVersion":"2026-08-28T06:17:29.519Z"}