{"record":{"id":"ca7b2607414c8ad0","repo":"sgl-project/sglang","slug":"expected-hybrid-gdn-or-nemotronh-models-but-got-u","errorCode":null,"errorMessage":"Expected hybrid GDN or NemotronH models, but got unknown model. If this is a custom hybrid model, use register_linear_attn_model() from sglang.srt.configs.linear_attn_model_registry.","messagePattern":"Expected hybrid GDN or NemotronH models, but got unknown model\\. If this is a custom hybrid model, use register_linear_attn_model\\(\\) from sglang\\.srt\\.configs\\.linear_attn_model_registry\\.","errorType":"validation","errorClass":"ValueError","httpStatus":null,"severity":"error","filePath":"python/sglang/srt/layers/attention/attention_registry.py","lineNumber":516,"sourceCode":"                linear_attn_backend = AscendKDAAttnBackend(runner)\n                hybrid_backend_cls = AscendKDAHybridLinearAttnBackend\n            else:\n                linear_attn_backend = KDAAttnBackend(runner)\n        elif hybrid_lightning_config(runner.model_config) is not None:\n            linear_attn_backend = LightningAttentionBackend(runner)\n        else:\n            spec_result = get_linear_attn_config(runner.model_config.hf_config)\n            if spec_result is not None:\n                spec, _ = spec_result\n                cfg = runner.model_config\n                BackendClass = import_backend_class(spec.backend_class_name)\n                linear_attn_backend = BackendClass(runner)\n                if spec.hybrid_backend_class_name is not None:\n                    hybrid_backend_cls = import_backend_class(\n                        spec.hybrid_backend_class_name\n                    )\n            else:\n                raise ValueError(\n                    \"Expected hybrid GDN or NemotronH models, but got unknown model. \"\n                    \"If this is a custom hybrid model, use register_linear_attn_model() \"\n                    \"from sglang.srt.configs.linear_attn_model_registry.\"\n                )\n        if runner.is_draft_worker:\n            # FIXME: we assume that MTP/NEXTN always use full-attention.\n            full_attn_layers = [0]\n        else:\n            full_attn_layers = cfg.full_attention_layer_ids\n        return hybrid_backend_cls(\n            full_attn_backend, linear_attn_backend, full_attn_layers\n        )\n\n    return full_attn_backend\n\n\n@register_attention_backend(\"intel_xpu\")\ndef create_intel_xpu_backend(runner):","sourceCodeStart":498,"sourceCodeEnd":534,"githubUrl":"https://github.com/sgl-project/sglang/blob/0132848349585cfe6aae51c4941cbae872505f8a/python/sglang/srt/layers/attention/attention_registry.py#L498-L534","documentation":"The hybrid-attention registry path only knows how to build a linear-attention/hybrid backend for GDN and NemotronH model families. For an unrecognized hybrid architecture it raises, pointing custom model authors at register_linear_attn_model() in sglang.srt.configs.linear_attn_model_registry.","triggerScenarios":"Loading a custom hybrid (linear-attention + full-attention) model whose architecture is neither GDN nor NemotronH (and not pre-registered) while the hybrid backend path is selected in attn_backend_wrapper.","commonSituations":"Adding a new hybrid model config to SGLang without registering it; renaming a model architecture so family detection fails; forked Qwen3-Next-like or custom Mamba hybrids.","solutions":["Register the model: call register_linear_attn_model() from sglang.srt.configs.linear_attn_model_registry with your architecture in model code or a plugin","Map your model onto the GDN or NemotronH config family if it is actually one of those","Check the architecture string in config.json for typos/renames"],"exampleFix":"# before\nclass MyHybridConfig(PretrainedConfig):\n    model_type = \"my_hybrid\"\n# after\nfrom sglang.srt.configs.linear_attn_model_registry import register_linear_attn_model\nregister_linear_attn_model(\"my_hybrid\")\nclass MyHybridConfig(PretrainedConfig):\n    model_type = \"my_hybrid\"","handlingStrategy":"try-catch","validationCode":"from sglang.srt.configs.linear_attn_model_registry import get_linear_attn_model_names\nif model_type not in {\"gdn-like...\", *get_linear_attn_model_names()} and is_hybrid:\n    raise SystemExit(\"register the hybrid model via register_linear_attn_model()\")","typeGuard":null,"tryCatchPattern":"try:\n    attn_backend_wrapper(...)\nexcept ValueError as e:\n    if \"register_linear_attn_model\" in str(e):\n        register_linear_attn_model(model_type); attn_backend_wrapper(...)  # retry once\n    else:\n        raise","preventionTips":["Register every custom hybrid architecture at import time of its config module","Fail fast in model config __init__ if the architecture is not registered"],"tags":["hybrid-model","linear-attention","gdn","nemotron-h","model-registry","sglang"],"backgroundTag":"unregistered-model-architecture","analyzedSha":"0132848349585cfe6aae51c4941cbae872505f8a","analyzedAt":"2026-08-28T05:10:05.995Z","schemaVersion":2},"datasetVersion":"2026-08-28T06:17:29.519Z"}