{"record":{"id":"a9d7c1e1a87e0aaa","repo":"sgl-project/sglang","slug":"unsupported-kimi-k3-vision-attention-backend-att","errorCode":null,"errorMessage":"Unsupported Kimi-K3 vision attention backend: {attention_backend}","messagePattern":"Unsupported Kimi-K3 vision attention backend: (.+?)","errorType":"exception","errorClass":"ValueError","httpStatus":null,"severity":"error","filePath":"python/sglang/srt/models/kimi_k3_vl.py","lineNumber":555,"sourceCode":"\n@dataclass(frozen=True)\nclass KimiK3VisionForwardMetadata:\n    grid_thw_list: Tuple[GridTHW, ...]\n    segment_bounds: SegmentBounds\n    rope_freqs_cis: torch.Tensor\n    attention: VisionAttentionMetadata\n    use_fused_rope: bool\n    selected_attention_backend: str\n    position_embeddings: Optional[torch.Tensor] = None\n\n\nclass MoonViT3dEncoder(nn.Module):\n    def __init__(self, hidden_dim: int, num_layers: int, block_cfg: dict) -> None:\n        super().__init__()\n        qkv_hidden_size = block_cfg.get(\"qkv_hidden_size\") or block_cfg[\"hidden_dim\"]\n        attention_backend = _get_mm_attention_backend()\n        if attention_backend != \"auto\" and attention_backend not in QKV_BACKEND_IMPL:\n            raise ValueError(\n                f\"Unsupported Kimi-K3 vision attention backend: {attention_backend}\"\n            )\n        attention_workspace = None\n        if attention_backend == \"flashinfer_cudnn\" and torch.cuda.is_available():\n            attention_workspace = torch.empty(\n                FLASHINFER_WORKSPACE_SIZE_BYTES,\n                dtype=torch.uint8,\n                device=torch.device(\"cuda\", torch.cuda.current_device()),\n            )\n        self.attention_backend = attention_backend\n        if attention_backend == \"auto\":\n            print_info_once(\n                \"Kimi-K3 vision attention uses shape-aware auto selection on \"\n                \"B300/GB300 (Triton for small workloads, FA4 otherwise).\"\n            )\n        self.attention_width = qkv_hidden_size\n        self.rope_2d = Rope2DPosEmbRepeated(\n            qkv_hidden_size // block_cfg[\"num_heads\"], 512, 512","sourceCodeStart":537,"sourceCodeEnd":573,"githubUrl":"https://github.com/sgl-project/sglang/blob/0132848349585cfe6aae51c4941cbae872505f8a/python/sglang/srt/models/kimi_k3_vl.py#L537-L573","documentation":"MoonViT3dEncoder.__init__ (kimi_k3_vl.py:555) validates the configured multimodal attention backend: only \"auto\" or one of the entries in QKV_BACKEND_IMPL (e.g. flashinfer, triton, flashinfer_cudnn, fa3) may be used for the Kimi-K3 vision tower. Any other SGLANG_MM_ATTENTION_BACKEND value raises immediately at model build time, before any GPU work.","triggerScenarios":"Setting a vision attention backend string that has no Kimi-K3 implementation, e.g. SGLANG_MM_ATTENTION_BACKEND=torch_native or an older backend name, then loading the model.","commonSituations":"Copying server flags/env vars from other models whose backend names differ; upgrading SGLang where backend names were renamed; running on hardware where only a subset of backends is compiled.","solutions":["Unset the backend (use auto) and let the model pick a supported implementation","Set SGLANG_MM_ATTENTION_BACKEND to a value present in QKV_BACKEND_IMPL in this repo version (check the import at the top of kimi_k3_vl.py)","Upgrade/downgrade SGLang so the backend name you use exists in this model's allow-list"],"exampleFix":"# before\nexport SGLANG_MM_ATTENTION_BACKEND=torch_native\n# after\nunset SGLANG_MM_ATTENTION_BACKEND  # or =flashinfer","handlingStrategy":"validation","validationCode":"be = os.getenv(\"SGLANG_MM_ATTENTION_BACKEND\")\nassert be is None or be == \"auto\" or be in QKV_BACKEND_IMPL, be","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Don't copy backend env vars across models; check each model's allow-list","Prefer 'auto' unless you have a measured reason"],"tags":["kimi-k3","attention-backend","env-var","startup-validation"],"backgroundTag":"unsupported-config-value","analyzedSha":"0132848349585cfe6aae51c4941cbae872505f8a","analyzedAt":"2026-08-28T05:10:05.995Z","schemaVersion":2},"datasetVersion":"2026-08-28T06:17:29.519Z"}