{"record":{"id":"9f240fa34978a7fd","repo":"sgl-project/sglang","slug":"flashinfer-gdn-prefill-is-not-supported-with-ena","errorCode":null,"errorMessage":"FlashInfer GDN prefill is not supported with --enable-deterministic-inference. Use --linear-attn-prefill-backend triton.","messagePattern":"FlashInfer GDN prefill is not supported with --enable-deterministic-inference\\. Use --linear-attn-prefill-backend triton\\.","errorType":"validation","errorClass":"ValueError","httpStatus":null,"severity":"error","filePath":"python/sglang/srt/layers/attention/linear/gdn_backend.py","lineNumber":118,"sourceCode":"        return None\n\n    from sglang.srt.layers.attention.linear.kernels.gdn_flashinfer import (\n        is_flashinfer_gdn_prefill_available,\n    )\n\n    if not is_flashinfer_gdn_prefill_available():\n        return None\n\n    rank0_log(f\"Defaulting SM{sm_major}0 GDN prefill backend to FlashInfer.\")\n    return \"flashinfer\"\n\n\ndef _validate_gdn_linear_attn_backends(backends: LinearAttnBackends) -> None:\n    if (\n        get_exec().deterministic.enable_deterministic_inference\n        and backends.prefill.is_flashinfer()\n    ):\n        raise ValueError(\n            \"FlashInfer GDN prefill is not supported with \"\n            \"--enable-deterministic-inference. Use \"\n            \"--linear-attn-prefill-backend triton.\"\n        )\n\n\nclass GDNKernelDispatcher:\n    \"\"\"Dispatches GDN kernel calls to the appropriate backend per mode.\"\"\"\n\n    def __init__(\n        self,\n        decode_backend: LinearAttnKernelBackend,\n        prefill_backend: LinearAttnKernelBackend,\n        verify_backend: Optional[LinearAttnKernelBackend] = None,\n    ):\n        triton_kernel = TritonGDNKernel()\n        self.tree_verify_kernel = triton_kernel\n","sourceCodeStart":100,"sourceCodeEnd":136,"githubUrl":"https://github.com/sgl-project/sglang/blob/0132848349585cfe6aae51c4941cbae872505f8a/python/sglang/srt/layers/attention/linear/gdn_backend.py#L100-L136","documentation":"The GDN (gated deltanet) linear attention backend validates at construction that, when deterministic inference is enabled (--enable-deterministic-inference), the prefill backend is not FlashInfer, because FlashInfer GDN prefill kernels are non-deterministic. _validate_gdn_linear_attn_backends raises this ValueError telling you to use the triton prefill backend instead.","triggerScenarios":"Constructing the GDN backend with get_exec().deterministic.enable_deterministic_inference true and LinearAttnBackends.prefill set to flashinfer (explicitly via --linear-attn-prefill-backend flashinfer or as an inferred default), for models like Qwen3-Next.","commonSituations":"User enables deterministic inference for reproducible serving of a hybrid GDN model while leaving/forcing FlashInfer as the linear-attn prefill backend; defaults change across versions making flashinfer the default prefill backend.","solutions":["Pass --linear-attn-prefill-backend triton when using --enable-deterministic-inference","If determinism is not required, drop --enable-deterministic-inference to keep FlashInfer prefill","Check server startup scripts/defaults that may explicitly set flashinfer prefill and remove the override"],"exampleFix":"# before\npython -m sglang.launch_server --model Qwen3-Next-80B --enable-deterministic-inference --linear-attn-prefill-backend flashinfer\n# after\npython -m sglang.launch_server --model Qwen3-Next-80B --enable-deterministic-inference --linear-attn-prefill-backend triton","handlingStrategy":"validation","validationCode":"from sglang.srt.environ import get_exec\n\ndef validate_gdn_args(args):\n    if get_exec().deterministic.enable_deterministic_inference:\n        if args.linear_attn_prefill_backend == 'flashinfer':\n            raise SystemExit('use --linear-attn-prefill-backend triton')\n        args.linear_attn_prefill_backend = 'triton'","typeGuard":null,"tryCatchPattern":"try:\n    backend = GDNStrategy(backends)\nexcept ValueError as e:\n    if 'deterministic' in str(e):\n        backends.prefill = LinearAttnPrefillBackend.TRITON\n        backend = GDNStrategy(backends)\n    else:\n        raise","preventionTips":["Pair --enable-deterministic-inference with --linear-attn-prefill-backend triton on GDN models","Add a startup arg-compatibility lint for server_args","Write config-validation tests mirroring _validate_gdn_linear_attn_backends"],"tags":["gdn","linear-attention","deterministic-inference","flashinfer","triton","config-validation","sglang"],"backgroundTag":"incompatible-config-flag-combination","analyzedSha":"0132848349585cfe6aae51c4941cbae872505f8a","analyzedAt":"2026-08-28T05:10:05.995Z","schemaVersion":2},"datasetVersion":"2026-08-28T06:17:29.519Z"}