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
- 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
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
- 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
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
- AITER Sage backend does not have a metadata builder.
- aiter is required when SGLANG_USE_AITER is set to True
- AITer backend does not have a metadata builder.
- AITer backend requires num_heads ({num_heads}) to be a multi
- Online MXFP4 quantization for MoE is only supported on AMD G
AI-assisted analysis of sgl-project/sglang@0132848349 (2026-08-28).
Data as JSON: /api/errors/3cbcb27bb7866072.
Report an issue: GitHub.