{"record":{"id":"4de4cfe2dabdb1ab","repo":"sgl-project/sglang","slug":"aiter-sage-backend-does-not-have-a-metadata-builde","errorCode":null,"errorMessage":"AITER Sage backend does not have a metadata builder.","messagePattern":"AITER Sage backend does not have a metadata builder\\.","errorType":"exception","errorClass":"NotImplementedError","httpStatus":null,"severity":"error","filePath":"python/sglang/multimodal_gen/runtime/layers/attention/backends/aiter_sage.py","lineNumber":32,"sourceCode":"\nclass AITERSageBackend(AttentionBackend):\n\n    @staticmethod\n    def get_enum() -> AttentionBackendEnum:\n        return AttentionBackendEnum.AITER_SAGE\n\n    @staticmethod\n    def get_impl_cls() -> type[\"AITERSageImpl\"]:\n        return AITERSageImpl\n\n    @staticmethod\n    def get_metadata_cls() -> type[\"AttentionMetadata\"]:\n        # AITER Sage backend does not require special metadata.\n        return AttentionMetadata\n\n    @staticmethod\n    def get_builder_cls() -> type[\"AttentionMetadataBuilder\"]:\n        raise NotImplementedError(\n            \"AITER Sage backend does not have a metadata builder.\"\n        )\n\n\nclass AITERSageImpl(AttentionImpl):\n\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","sourceCodeStart":14,"sourceCodeEnd":50,"githubUrl":"https://github.com/sgl-project/sglang/blob/0132848349585cfe6aae51c4941cbae872505f8a/python/sglang/multimodal_gen/runtime/layers/attention/backends/aiter_sage.py#L14-L50","documentation":"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.","triggerScenarios":"Calling AITERSageBackend.get_builder_cls() directly or from generic code that instantiates builders for every registered backend.","commonSituations":"Backend-agnostic orchestration code that assumes all backends implement get_builder_cls; startup probing loops over the backend registry.","solutions":["Skip builder instantiation for the Sage backend; guard with try/except NotImplementedError or a capability check","Use get_metadata_cls() which returns the base AttentionMetadata","Redesign the dispatch to treat a missing builder as 'no metadata needed' rather than fatal"],"exampleFix":"# before\nbuilder = backend.get_builder_cls()()\n# after\nbuilder = None\nif backend.get_builder_cls is not AITERSageBackend.get_builder_cls:\n    builder = backend.get_builder_cls()()","handlingStrategy":"try-catch","validationCode":null,"typeGuard":null,"tryCatchPattern":"try:\n    builder_cls = backend.get_builder_cls()\nexcept NotImplementedError:\n    builder_cls = None","preventionTips":["Maintain a per-backend capability map (has_builder: bool) instead of assuming uniform interfaces"],"tags":["aiter","sage-attention","attention-backend","rocm","not-implemented"],"backgroundTag":"unsupported-operation","analyzedSha":"0132848349585cfe6aae51c4941cbae872505f8a","analyzedAt":"2026-08-28T05:10:05.995Z","schemaVersion":2},"datasetVersion":"2026-08-28T06:17:29.519Z"}