{"record":{"id":"3cbcb27bb7866072","repo":"sgl-project/sglang","slug":"aiter-sage-attention-is-not-available-please-upda","errorCode":null,"errorMessage":"AITER Sage attention is not available, please update AITER version.","messagePattern":"AITER Sage attention is not available, please update AITER version\\.","errorType":"exception","errorClass":"ImportError","httpStatus":null,"severity":"critical","filePath":"python/sglang/multimodal_gen/runtime/layers/attention/backends/aiter_sage.py","lineNumber":56,"sourceCode":"\n    def __init__(\n        self,\n        num_heads: int,\n        head_size: int,\n        softmax_scale: float,\n        causal: bool = False,\n        num_kv_heads: int | None = None,\n        prefix: str = \"\",\n        dropout_p: float = 0.0,\n        **extra_impl_args,\n    ) -> None:\n\n        try:\n            from aiter.ops.triton.attention.fav3_sage import fav3_sage_wrapper_func\n\n            self.aiter_sage_attn_fn = fav3_sage_wrapper_func\n        except ImportError:\n            raise ImportError(\n                \"AITER Sage attention is not available, please update AITER version.\"\n            )\n\n    def forward(\n        self,\n        query: torch.Tensor,\n        key: torch.Tensor,\n        value: torch.Tensor,\n        attn_metadata: AttentionMetadata | None = None,\n    ) -> torch.Tensor:\n        \"\"\"\n        Performs attention using aiter sage backend.\n\n        Args:\n            query: Query tensor of shape [batch_size, seq_len, head_num, head_dim]\n            key: Key tensor of shape [batch_size, seq_len, head_num, head_dim]\n            value: Value tensor of shape [batch_size, seq_len, head_num, head_dim]\n            attn_metadata: Metadata for the attention operation (unused).","sourceCodeStart":38,"sourceCodeEnd":74,"githubUrl":"https://github.com/sgl-project/sglang/blob/0132848349585cfe6aae51c4941cbae872505f8a/python/sglang/multimodal_gen/runtime/layers/attention/backends/aiter_sage.py#L38-L74","documentation":"AITERSageImpl.__init__ tries to import fav3_sage_wrapper_func from aiter.ops.triton.attention.fav3_sage; if the installed AITER package is too old (or lacks Sage attention), the ImportError is re-raised with this message. It fires at backend construction, before any forward pass.","triggerScenarios":"Constructing AITERSageImpl (selecting the AITER Sage attention backend) with an AITER build that predates the fav3_sage module, or an AITER install missing its Triton kernels.","commonSituations":"Using a ROCm environment with a stock/older pip aiter wheel; upgrading SGLang without upgrading AITER; container images that pin an old aiter commit.","solutions":["Upgrade AITER to a version containing aiter.ops.triton.attention.fav3_sage.fav3_sage_wrapper_func (build from the current AITER source if no wheel is new enough)","Verify with: python -c \"from aiter.ops.triton.attention.fav3_sage import fav3_sage_wrapper_func\"","If you cannot upgrade, fall back to another attention backend instead of Sage"],"exampleFix":"# before: old AITER -> ImportError at startup\n# after\npip install --upgrade aiter  # or build from source:\n# git clone https://github.com/ROCm/aiter && cd aiter && pip install -e .\npython -c \"from aiter.ops.triton.attention.fav3_sage import fav3_sage_wrapper_func\"  # sanity check","handlingStrategy":"fallback","validationCode":"try:\n    from aiter.ops.triton.attention.fav3_sage import fav3_sage_wrapper_func  # noqa\n    sage_available = True\nexcept ImportError:\n    sage_available = False\n# choose backend accordingly","typeGuard":null,"tryCatchPattern":"try:\n    impl = AITERSageImpl(...)\nexcept ImportError as e:\n    logger.warning(\"AITER Sage unavailable (%s); falling back\", e)\n    impl = FlashAttnImpl(...)","preventionTips":["Pin a sufficiently new aiter version in the environment/requirements","Probe the import once at startup and select the backend dynamically","Bake the correct aiter build into container images"],"tags":["aiter","sage-attention","rocm","dependency-version","import-error"],"backgroundTag":"missing-optional-dependency","analyzedSha":"0132848349585cfe6aae51c4941cbae872505f8a","analyzedAt":"2026-08-28T05:10:05.995Z","schemaVersion":2},"datasetVersion":"2026-08-28T06:17:29.519Z"}