sgl-project/sglang · error · NotImplementedError

AITER Sage backend does not have a metadata builder.

Error message

AITER Sage backend does not have a metadata builder.

What it means

The AITER Sage attention backend intentionally does not provide an AttentionMetadataBuilder; get_builder_cls raises NotImplementedError just like the base AITer backend. It uses plain AttentionMetadata (get_metadata_cls) and needs no per-batch metadata construction.

Source

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

class AITERSageBackend(AttentionBackend):

    @staticmethod
    def get_enum() -> AttentionBackendEnum:
        return AttentionBackendEnum.AITER_SAGE

    @staticmethod
    def get_impl_cls() -> type["AITERSageImpl"]:
        return AITERSageImpl

    @staticmethod
    def get_metadata_cls() -> type["AttentionMetadata"]:
        # AITER Sage backend does not require special metadata.
        return AttentionMetadata

    @staticmethod
    def get_builder_cls() -> type["AttentionMetadataBuilder"]:
        raise NotImplementedError(
            "AITER Sage backend does not have a metadata builder."
        )


class AITERSageImpl(AttentionImpl):

    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:

View on GitHub (pinned to 0132848349)

Solutions

  1. Skip builder instantiation for the Sage backend; guard with try/except NotImplementedError or a capability check
  2. Use get_metadata_cls() which returns the base AttentionMetadata
  3. Redesign the dispatch to treat a missing builder as 'no metadata needed' rather than fatal

Example fix

# before
builder = backend.get_builder_cls()()
# after
builder = None
if backend.get_builder_cls is not AITERSageBackend.get_builder_cls:
    builder = backend.get_builder_cls()()
Defensive patterns

Strategy: try-catch

Try / catch

try:
    builder_cls = backend.get_builder_cls()
except NotImplementedError:
    builder_cls = None

Prevention

When it happens

Trigger: Calling AITERSageBackend.get_builder_cls() directly or from generic code that instantiates builders for every registered backend.

Common situations: Backend-agnostic orchestration code that assumes all backends implement get_builder_cls; startup probing loops over the backend registry.

Understand the failure class

Background: UnsupportedOperationException and "is not supported" errors: when a library deliberately refuses a call — this error's family across 30 libraries.

Related errors


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