{"record":{"id":"d0373910e10ff17b","repo":"sgl-project/sglang","slug":"the-helion-package-is-required-when-a-kda-backend","errorCode":null,"errorMessage":"The Helion package is required when a KDA backend is set to Helion. Install it with: pip install helion==1.4.0","messagePattern":"The Helion package is required when a KDA backend is set to Helion\\. Install it with: pip install helion==1\\.4\\.0","errorType":"exception","errorClass":"ImportError","httpStatus":null,"severity":"error","filePath":"python/sglang/srt/layers/attention/linear/kernels/kda_helion.py","lineNumber":41,"sourceCode":"\n    def __init__(\n        self,\n        triton_fallback: TritonKDAKernel | None = None,\n        *,\n        enable_decode: bool = True,\n        enable_prefill: bool = True,\n    ) -> None:\n        self.supports_packed_decode = enable_decode\n        self._packed_decode = None\n        self._replayssm_decode = None\n        self._chunk_kda = None\n        if enable_decode or enable_prefill:\n            try:\n                import helion  # noqa: F401\n            except ModuleNotFoundError as error:\n                if error.name != \"helion\":\n                    raise\n                raise ImportError(\n                    \"The Helion package is required when a KDA backend is set to \"\n                    \"Helion. Install it with: pip install helion==1.4.0\"\n                ) from None\n        if enable_decode:\n            from sglang.kernels.ops.attention.helion.kda_decode import (\n                helion_fused_recurrent_kda_packed_decode,\n            )\n            from sglang.kernels.ops.attention.helion.kda_replayssm import (\n                helion_fused_recurrent_kda_replayssm_decode,\n            )\n\n            self._packed_decode = helion_fused_recurrent_kda_packed_decode\n            self._replayssm_decode = helion_fused_recurrent_kda_replayssm_decode\n        if enable_prefill:\n            from sglang.kernels.ops.attention.helion.kda_prefill import chunk_kda\n\n            self._chunk_kda = chunk_kda\n        self._triton = triton_fallback or TritonKDAKernel()","sourceCodeStart":23,"sourceCodeEnd":59,"githubUrl":"https://github.com/sgl-project/sglang/blob/0132848349585cfe6aae51c4941cbae872505f8a/python/sglang/srt/layers/attention/linear/kernels/kda_helion.py#L23-L59","documentation":"HelionKDAKernel imports the helion JIT package when either decode or prefill is enabled; if helion is absent, __init__ raises ImportError pinning the required version (1.4.0).","triggerScenarios":"Selecting helion as a KDA backend (decode and/or prefill) in an environment without the helion package installed.","commonSituations":"New environment or minimal Docker image without helion; version drift where helion is present but the import of the exact module fails with name 'helion'.","solutions":["pip install helion==1.4.0","Fall back to triton backend if helion cannot be installed","Verify the install with python -c 'import helion' before launching the server"],"exampleFix":"# before\n# helion not installed\n# after\npip install helion==1.4.0","handlingStrategy":"try-catch","validationCode":"try:\n    import helion\n    helion_ok = True\nexcept ModuleNotFoundError:\n    helion_ok = False\nif not helion_ok:\n    linear_attn_backend = 'triton'","typeGuard":"null","tryCatchPattern":"try:\n    kernel = HelionKDAKernel(enable_decode=True, enable_prefill=True)\nexcept ImportError as e:\n    logger.warning('%s; falling back to triton KDA', e)\n    kernel = TritonKDAKernel()","preventionTips":["Pin helion==1.4.0 in requirements when using the helion backend","Smoke-test 'import helion' in container builds"],"tags":["sglang","helion","kda","missing-dependency","version-pin"],"backgroundTag":"missing-optional-dependency","analyzedSha":"0132848349585cfe6aae51c4941cbae872505f8a","analyzedAt":"2026-08-28T05:10:05.995Z","schemaVersion":2},"datasetVersion":"2026-08-28T06:17:29.519Z"}