{"record":{"id":"36aed54d025fc3b2","repo":"sgl-project/sglang","slug":"attention-backend-nsa-is-deprecated-use-dsa-i","errorCode":null,"errorMessage":"attention-backend='nsa' is deprecated; use 'dsa' instead. The alias will be removed in a future release.","messagePattern":"attention-backend='nsa' is deprecated; use 'dsa' instead\\. The alias will be removed in a future release\\.","errorType":"console","errorClass":"DeprecationWarning","httpStatus":null,"severity":"warning","filePath":"python/sglang/srt/layers/attention/attention_registry.py","lineNumber":142,"sourceCode":"@register_attention_backend(\"ascend\")\ndef create_ascend_backend(runner):\n    from sglang.srt.hardware_backend.npu.attention.ascend_backend import (\n        AscendAttnBackend,\n    )\n\n    return AscendAttnBackend(runner)\n\n\n@register_attention_backend(\"dsa\")\ndef create_dsa_backend(runner):\n    from sglang.srt.layers.attention.dsa_backend import DeepseekSparseAttnBackend\n\n    return DeepseekSparseAttnBackend(runner)\n\n\n@register_attention_backend(\"nsa\")\ndef _create_nsa_compat(runner):\n    warnings.warn(\n        \"attention-backend='nsa' is deprecated; use 'dsa' instead. \"\n        \"The alias will be removed in a future release.\",\n        DeprecationWarning,\n        stacklevel=2,\n    )\n    return create_dsa_backend(runner)\n\n\n@register_attention_backend(\"dsv4\")\ndef create_dsv4_backend(runner):\n    if _is_npu:\n        from sglang.srt.hardware_backend.npu.attention.ascend_dsv4_backend import (\n            DeepseekV4AscendAttnBackend,\n        )\n\n        return DeepseekV4AscendAttnBackend(runner)\n    elif _is_hip:\n        from sglang.srt.layers.attention.deepseek_v4_backend_hip_radix import (","sourceCodeStart":124,"sourceCodeEnd":160,"githubUrl":"https://github.com/sgl-project/sglang/blob/0132848349585cfe6aae51c4941cbae872505f8a/python/sglang/srt/layers/attention/attention_registry.py#L124-L160","documentation":"The attention backend name 'nsa' (native sparse attention) is a deprecated alias for what is now called 'dsa'. Selecting it via --attention-backend nsa or AttentionBackendEnum.NSA still works — it creates the DSA backend — but the alias will be removed.","triggerScenarios":"Launching the server with --attention-backend nsa, or setting the attention backend registry key 'nsa' in code, on a DeepSeek-style sparse attention model.","commonSituations":"Old launch commands/model configs from when the backend was named NSA; scripts pinned to previous sglang versions after upgrading.","solutions":["Change --attention-backend nsa to --attention-backend dsa in launch commands","Update any programmatic registry lookups from 'nsa' to 'dsa'","Watch release notes for the removal and migrate before upgrading past it"],"exampleFix":"# before\nsglang serve --model-path deepseek-ai/DeepSeek-V3 --attention-backend nsa\n# after\nsglang serve --model-path deepseek-ai/DeepSeek-V3 --attention-backend dsa","handlingStrategy":"validation","validationCode":"assert server_args.attention_backend != \"nsa\", \"use 'dsa'\"","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Update launch flags on every major upgrade","Track deprecation notices in release notes for model-specific backends"],"tags":["deprecation","attention-backend","nsa","dsa","migration"],"backgroundTag":"deprecated-option-alias","analyzedSha":"0132848349585cfe6aae51c4941cbae872505f8a","analyzedAt":"2026-08-28T05:10:05.995Z","schemaVersion":2},"datasetVersion":"2026-08-28T06:17:29.519Z"}