{"record":{"id":"46a1fcb95e0d367e","repo":"vllm-project/vllm","slug":"unknown-kv-cache-group-kind-kind-in-backend-pe","errorCode":null,"errorMessage":"Unknown KV cache group kind '{kind}' in backend_per_kind. Valid kinds are: {', '.join(sorted(valid_kinds))}.","messagePattern":"Unknown KV cache group kind '(.+?)' in backend_per_kind\\. Valid kinds are: (.+?)\\.","errorType":"validation","errorClass":"ValueError","httpStatus":null,"severity":"error","filePath":"vllm/config/attention.py","lineNumber":169,"sourceCode":"        return value\n\n    @field_validator(\"backend_per_kind\", mode=\"before\")\n    @classmethod\n    def validate_backend_per_kind_before(cls, value: Any) -> Any:\n        \"\"\"Parse the `backend_per_kind` map from strings.\n\n        Keys must be valid `KVCacheSpecKind` values; values are parsed like\n        `backend` (enum name, case-insensitive).\n        \"\"\"\n        from vllm.v1.kv_cache_interface import KVCacheSpecKind\n\n        if not isinstance(value, dict):\n            return value\n        valid_kinds = {kind.value for kind in KVCacheSpecKind}\n        parsed: dict[str, AttentionBackendEnum] = {}\n        for kind, backend in value.items():\n            if kind not in valid_kinds:\n                raise ValueError(\n                    f\"Unknown KV cache group kind '{kind}' in \"\n                    f\"backend_per_kind. Valid kinds are: \"\n                    f\"{', '.join(sorted(valid_kinds))}.\"\n                )\n            if isinstance(backend, str):\n                backend = AttentionBackendEnum[backend.upper()]\n            parsed[kind] = backend\n        return parsed\n","sourceCodeStart":151,"sourceCodeEnd":178,"githubUrl":"https://github.com/vllm-project/vllm/blob/c794754062d49a8fdb63ab3c5215b488b865030c/vllm/config/attention.py#L151-L178","documentation":"The compilation config accepts a backend_per_kind mapping from KV cache group kind to attention backend enum. Keys are validated against KVCacheSpecKind values (e.g. 'full_attention', 'sliding_window', ...); an unknown key string raises ValueError listing the valid kinds.","triggerScenarios":"Passing CompilationConfig(attention_backend_cfg / backend_per_kind={'foo': 'FLASHATTN'}) — any dict key that is not a member of KVCacheSpecKind — during config parsing (the mode='before' validator).","commonSituations":"Typos in kind names; using attention-backend names or model names instead of KV cache group kinds; configs written for a newer/older vLLM whose KVCacheSpecKind members differ.","solutions":["Use one of the valid kinds listed in the error message, e.g. {'full_attention': 'FLASHINFER', 'sliding_window': 'XFORMERS'}.","Check KVCacheSpecKind in vllm.v1.kv_cache_interface for your vLLM version to see supported kinds.","Ensure backend values are attention backend enum names (case-insensitive), not kinds."],"exampleFix":"# before\nCompilationConfig(backend_per_kind={'full': 'FLASHATTN'})\n# after\nfrom vllm.v1.kv_cache_interface import KVCacheSpecKind\nCompilationConfig(backend_per_kind={KVCacheSpecKind.FULL_ATTENTION.value: 'FLASHATTN'})","handlingStrategy":"type-guard","validationCode":"from vllm.v1.kv_cache_interface import KVCacheSpecKind\n\ndef valid_backend_per_kind(cfg: dict) -> bool:\n    valid = {k.value for k in KVCacheSpecKind}\n    return set(cfg.keys()) <= valid","typeGuard":"def is_valid_kind_map(value: dict) -> bool:\n    valid = {k.value for k in KVCacheSpecKind}\n    return isinstance(value, dict) and set(value) <= valid","tryCatchPattern":null,"preventionTips":["Derive kind names from KVCacheSpecKind members, never hardcode strings","Validate config dicts against the enum before constructing CompilationConfig","Re-check valid kinds after vLLM upgrades"],"tags":["configuration","attention-backend","kv-cache","vllm"],"backgroundTag":null,"analyzedSha":"c794754062d49a8fdb63ab3c5215b488b865030c","analyzedAt":"2026-08-14T21:17:39.825Z","schemaVersion":2},"datasetVersion":"2026-08-15T22:17:37.221Z"}