sgl-project/sglang · critical · ImportError

AITER Sage attention is not available, please update AITER v

Error message

AITER Sage attention is not available, please update AITER version.

What it means

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.

Source

Thrown at python/sglang/multimodal_gen/runtime/layers/attention/backends/aiter_sage.py:56

    def __init__(
        self,
        num_heads: int,
        head_size: int,
        softmax_scale: float,
        causal: bool = False,
        num_kv_heads: int | None = None,
        prefix: str = "",
        dropout_p: float = 0.0,
        **extra_impl_args,
    ) -> None:

        try:
            from aiter.ops.triton.attention.fav3_sage import fav3_sage_wrapper_func

            self.aiter_sage_attn_fn = fav3_sage_wrapper_func
        except ImportError:
            raise ImportError(
                "AITER Sage attention is not available, please update AITER version."
            )

    def forward(
        self,
        query: torch.Tensor,
        key: torch.Tensor,
        value: torch.Tensor,
        attn_metadata: AttentionMetadata | None = None,
    ) -> torch.Tensor:
        """
        Performs attention using aiter sage backend.

        Args:
            query: Query tensor of shape [batch_size, seq_len, head_num, head_dim]
            key: Key tensor of shape [batch_size, seq_len, head_num, head_dim]
            value: Value tensor of shape [batch_size, seq_len, head_num, head_dim]
            attn_metadata: Metadata for the attention operation (unused).

View on GitHub (pinned to 0132848349)

Solutions

  1. 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)
  2. Verify with: python -c "from aiter.ops.triton.attention.fav3_sage import fav3_sage_wrapper_func"
  3. If you cannot upgrade, fall back to another attention backend instead of Sage

Example fix

# before: old AITER -> ImportError at startup
# after
pip install --upgrade aiter  # or build from source:
# git clone https://github.com/ROCm/aiter && cd aiter && pip install -e .
python -c "from aiter.ops.triton.attention.fav3_sage import fav3_sage_wrapper_func"  # sanity check
Defensive patterns

Strategy: fallback

Validate before calling

try:
    from aiter.ops.triton.attention.fav3_sage import fav3_sage_wrapper_func  # noqa
    sage_available = True
except ImportError:
    sage_available = False
# choose backend accordingly

Try / catch

try:
    impl = AITERSageImpl(...)
except ImportError as e:
    logger.warning("AITER Sage unavailable (%s); falling back", e)
    impl = FlashAttnImpl(...)

Prevention

When it happens

Trigger: 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.

Common situations: Using a ROCm environment with a stock/older pip aiter wheel; upgrading SGLang without upgrading AITER; container images that pin an old aiter commit.

Related errors


AI-assisted analysis of sgl-project/sglang@0132848349 (2026-08-28). Data as JSON: /api/errors/3cbcb27bb7866072. Report an issue: GitHub.