{"record":{"id":"29d944655010e17c","repo":"sgl-project/sglang","slug":"flashinferkdakernel-has-no-prefill-kernel-keep-pr","errorCode":null,"errorMessage":"FlashInferKDAKernel has no prefill kernel; keep prefill on Triton / CuTe DSL.","messagePattern":"FlashInferKDAKernel has no prefill kernel; keep prefill on Triton / CuTe DSL\\.","errorType":"exception","errorClass":"NotImplementedError","httpStatus":null,"severity":"error","filePath":"python/sglang/srt/layers/attention/linear/kernels/kda_flashinfer.py","lineNumber":335,"sourceCode":"            A_log=A_log_fi,\n            dt_bias=dt_bias_fi,\n            scale=None,\n            initial_state=state_pool,\n            output_final_state=False,\n            use_qk_l2norm_in_kernel=True,\n            use_gate_in_kernel=True,\n            lower_bound=lower_bound,\n            cu_seqlens=query_start_loc.to(torch.int32),\n            ssm_state_indices=ssm_state_indices,\n            num_spec_tokens=num_spec_tokens,\n        )\n\n        return output_fi.view(1, seq_len, num_v_heads, head_v_dim)\n\n    # ---- extend (prefill): not provided by FlashInfer ----\n\n    def extend(self, *args, **kwargs):\n        raise NotImplementedError(\n            \"FlashInferKDAKernel has no prefill kernel; keep prefill on Triton / CuTe DSL.\"\n        )\n","sourceCodeStart":317,"sourceCodeEnd":338,"githubUrl":"https://github.com/sgl-project/sglang/blob/0132848349585cfe6aae51c4941cbae872505f8a/python/sglang/srt/layers/attention/linear/kernels/kda_flashinfer.py#L317-L338","documentation":"FlashInfer provides only recurrent (decode/verify) KDA kernels, not chunked prefill. The dispatcher is expected to keep prefill on Triton or CuTe DSL; calling extend() directly on FlashInferKDAKernel raises NotImplementedError.","triggerScenarios":"Explicitly routing prefill/extend to the FlashInfer KDA kernel (e.g. forcing one backend for all phases instead of the split dispatch).","commonSituations":"Setting --linear-attn-backend flashinfer expecting it to handle all phases; custom dispatcher changes that removed the prefill fallback to triton/cutedsl.","solutions":["Let the KDA dispatcher split phases: prefill on triton/cutedsl, decode on flashinfer","Configure prefill backend separately (triton or cutedsl) when decode backend is flashinfer","Do not call extend() on FlashInferKDAKernel directly"],"exampleFix":"# before\nkernel = FlashInferKDAKernel(); out = kernel.extend(...)\n# after\nprefill_kernel = TritonKDAKernel(); out = prefill_kernel.extend(...)","handlingStrategy":"type-guard","validationCode":"if phase == 'extend' and isinstance(kernel, FlashInferKDAKernel):\n    kernel = prefill_kernel  # triton or cutedsl","typeGuard":"def kernel_supports_extend(kernel) -> bool:\n    return type(kernel).extend is not FlashInferKDAKernel.extend","tryCatchPattern":null,"preventionTips":["Use the built-in dispatcher's per-phase backend split instead of a single backend","Unit-test each phase route in custom dispatchers"],"tags":["sglang","flashinfer","kda","prefill","not-implemented"],"backgroundTag":"unsupported-operation","analyzedSha":"0132848349585cfe6aae51c4941cbae872505f8a","analyzedAt":"2026-08-28T05:10:05.995Z","schemaVersion":2},"datasetVersion":"2026-08-28T11:17:15.048Z"}