[Refactor] Rename NSA → DSA: user-facing aliases, file/class/import rename#25821
Merged
Conversation
Contributor
|
Warning You have reached your daily quota limit. Please wait up to 24 hours and I will start processing your requests again! |
- Rename C++ struct fields nsa_cache_seqlens → dsa_cache_seqlens in fused_metadata_copy.cuh - Update Python wrapper fused_metadata_copy.py param names (nsa_* → dsa_*) - Rename get_nsa_kv_pool_cls → get_dsa_kv_pool_cls in platforms/interface.py and callers - Update comments/docstrings: NSA → DSA across 20 files (jit_kernel, mem_cache, srt layers, disaggregation, server_args) - Rename DeepSeekNSAAlgorithm → DeepSeekDSAAlgorithm and update imports - Update .claude/skills references (overlap-catalog, fuse-overlap-catalog, triage_kernel_helpers) Co-Authored-By: Claude Sonnet 4.6 (1M context) <noreply@anthropic.com>
Update ~25 stray NSA references in comments and docstrings across dsa_indexer.py, cp_utils.py, pool_configurator.py, model_runner*.py, deepseek_v4.py, forward_mha.py, forward_mla.py, model_config.py, hisparse_hook.py, and deepseek_v2_attention_mla_npu.py. Co-Authored-By: Claude Sonnet 4.6 (1M context) <noreply@anthropic.com>
- plugin.md: get_nsa_kv_pool_cls → get_dsa_kv_pool_cls (matches code rename) - attention_backend.md: remove (NSA) from section header, fix anchor link Co-Authored-By: Claude Sonnet 4.6 (1M context) <noreply@anthropic.com>
- NSATokenToKVPool → DSATokenToKVPool (memory_pool.py + all callers) - HiSparseNSATokenToKVPool → HiSparseDSATokenToKVPool - NSAIndexerPoolHost → DSAIndexerPoolHost - nsa_kv_cache_store_fp8 → dsa_kv_cache_store_fp8 - nsa_impl / nsa_impl_for_batch → dsa_impl / dsa_impl_for_batch (dsa_backend.py) - _nsa_payload → _dsa_payload (disaggregation/prefill.py, decode.py) - _send_swa_nsa_state → _send_swa_dsa_state (mori/conn.py) - MockNSATokenToKVPool → MockDSATokenToKVPool (test file) - _jit_nsa_fused_store_module → _jit_dsa_fused_store_module Co-Authored-By: Claude Sonnet 4.6 (1M context) <noreply@anthropic.com>
… names - docs_new/docs/: attention_backend.mdx, server_arguments.mdx, deepseek_v32.mdx, hisparse_guide.mdx, ascend docs, plugin.mdx, environment_variables.mdx — all --nsa-* → --dsa-* - docs_new/cookbook/: GLM-5, GLM-5.1, DeepSeek-V3.2 mdx files - docs_new/src/snippets/: 4 JSX deployment snippet files - .github/workflows/: nightly AMD test job names NSA → DSA - environ.py: comment update Co-Authored-By: Claude Sonnet 4.6 (1M context) <noreply@anthropic.com>
- StateType.NSA = "nsa" → StateType.DSA = "dsa" (symbol + wire value)
- Update all callers: disaggregation/utils.py, prefill.py, decode.py,
nixl/conn.py, mooncake/conn.py, mori/conn.py ("nsa" string literal)
- attention_registry.py: create_nsa_backend → _create_nsa_compat
(keeps @register_attention_backend("nsa") user-facing key + DeprecationWarning)
Co-Authored-By: Claude Sonnet 4.6 (1M context) <noreply@anthropic.com>
…OPK, get_nsa_kv_pool_cls - test_fused_metadata_copy.py: nsa_cache_seqlens_*/nsa_cu_seqlens_k_* → dsa_* (dict keys + vars) - environ.py: remove stale SGLANG_NSA_* EnvBool definitions (now covered by DSA canonical + alias) - test_platform_interface.py: get_nsa_kv_pool_cls → get_dsa_kv_pool_cls - skills/: fused_nsa_cache_seqlens → fused_dsa_cache_seqlens in profiler catalog - docs/references/environment_variables.md: SGLANG_NSA_* → SGLANG_DSA_* as canonical + deprecated alias note - docs_new/docs/references/environment_variables.mdx: same Co-Authored-By: Claude Sonnet 4.6 (1M context) <noreply@anthropic.com>
…nment_variables.mdx
…eepseek_v4.py - AttnTPContext.is_nsa → is_dsa (attr + init_context param) - _nsa_needs_bf16 local var → _dsa_needs_bf16 (×2 in communicator.py) - deepseek_v4.py: init_context(is_nsa=True) → init_context(is_dsa=True) Co-Authored-By: Claude Sonnet 4.6 (1M context) <noreply@anthropic.com>
- test_fused_metadata_copy.py: nsa_seqlens_expanded → dsa_seqlens_expanded - dsa_indexer.py: get_nsa_extend_len_cpu → get_dsa_extend_len_cpu - test_dsa_indexer.py: mock get_nsa_extend_len_cpu → get_dsa_extend_len_cpu - dequant_k_cache.py: comment nsa_backend → dsa_backend - dsa_backend.py: comment nsa_prefill_impl → dsa_prefill_impl - factory.py: "deepseek_nsa" dict key → "deepseek_dsa" - model_runner_kv_cache_mixin.py: is_nsa_model → is_dsa_model (×9) - forward_mha.py: _get_mla_kv_buffer_from_fp8_for_nsa → _for_dsa - forward_mla.py: _skip_rope_for_nsa_tilelang_fused → _for_dsa (def + 3 calls) - communicator.py: is_nsa/init_context param already fixed in prior commit Co-Authored-By: Claude Sonnet 4.6 (1M context) <noreply@anthropic.com>
…ning SGLANG_NSA_* as canonical - environ.py: add SGLANG_DSA_HIP_DISABLE_PRESHUFFLE with deprecated_name fallback - dsa/utils.py: use envs.SGLANG_DSA_HIP_DISABLE_PRESHUFFLE; update docstring - server_args.py: update comment to SGLANG_DSA_HIP_DISABLE_PRESHUFFLE - docs/basic_usage/deepseek_v32.md: SGLANG_NSA_PREFILL_DENSE_ATTN_KV_LEN_THRESHOLD → DSA canonical - docs_new/docs/basic_usage/deepseek_v32.mdx: same - skills/fuse-overlap-catalog.md: SGLANG_NSA_FUSE_TOPK → SGLANG_DSA_FUSE_TOPK Co-Authored-By: Claude Sonnet 4.6 (1M context) <noreply@anthropic.com>
…iCacheTransfer → TestDSAHiCacheTransfer Co-Authored-By: Claude Sonnet 4.6 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 4.6 (1M context) <noreply@anthropic.com>
5 tasks
cursor Bot
pushed a commit
that referenced
this pull request
May 20, 2026
Conflicts: .github/workflows/nightly-test-amd.yml and .github/workflows/nightly-test-amd-rocm720.yml. The only main commit that touched these two files was PR #25821 "[Refactor] Rename NSA → DSA: user-facing aliases, file/class/import rename" (8131641), which changed 4 step-name strings: "Accuracy Test (8-GPU GLM-5.1 NSA)" -> "...DSA)" "Accuracy Test MI35x (8-GPU GLM-5.1 NSA)" -> "...DSA)" "Accuracy Test ROCm 7.2 (8-GPU GLM-5.1 NSA)" -> "...DSA)" "Accuracy Test MI35x ROCm 7.2 (8-GPU GLM-5.1 NSA)" -> "...DSA)" (2 occurrences in nightly-test-amd.yml, 2 in nightly-test-amd-rocm720.yml.) This PR's "Reorder nightly-test-amd*.yml jobs by model" commits moved the surrounding GLM-5.1 job blocks to different physical line ranges in the YAML. Git's 3-way merge could not reconcile "we moved a 500-line range" with "they changed a single word in that range", so it dumped both entire spans into one large conflict region per file. Resolved by: 1. taking this PR's reordered content for both nightly files (git checkout --ours), since the reorder is a core change of this PR and is content-equivalent to main's; 2. then mechanically applying the 4 NSA -> DSA string renames on top so main's rename intent is preserved. After resolution `rg "GLM-5.1 NSA" .github/workflows/nightly-test-amd*.yml` returns 0 hits; the 4 expected "GLM-5.1 DSA" step names are present. Verified post-merge: - yaml.safe_load passes on all 4 AMD workflows - per-workflow: jobs <-> dropdown <-> contains() gating <-> finish-needs sets are mutually consistent - no conflict markers anywhere All other NSA -> DSA changes from #25821 are in files this PR does not touch (docs, attention backend code, server args, etc.) and auto-merged cleanly. Co-authored-by: Bingxu Chen <Bingxu.Chen@amd.com>
5 tasks
AliceChenyy
added a commit
to AliceChenyy/sglang
that referenced
this pull request
May 20, 2026
Resolve conflicts from NSA→DSA rename (sgl-project#25821): - Migrate SM120 guards from nsa_indexer.py → dsa_indexer.py - Migrate SM120 guards from nsa_backend.py → dsa_backend.py - Move sm120_mqa_fallback.py, sm120_mqa_triton.py to dsa/ directory - Update test import path to dsa.sm120_mqa_fallback - Use is_sm120_supported() directly (no module-level _is_sm120 var)
AliceChenyy
added a commit
to AliceChenyy/sglang
that referenced
this pull request
May 20, 2026
…ctor The NSA→DSA rename (PR sgl-project#25821) changed all backend attributes from nsa_prefill_backend/nsa_decode_backend to dsa_prefill_backend/dsa_decode_backend, but the SM120 branches in _set_default_dsa_backends() still used the old names, silently creating orphan attributes while leaving dsa_* as None. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
7 tasks
Shunkangz
pushed a commit
to Shunkangz/sglang
that referenced
this pull request
May 27, 2026
…ename (sgl-project#25821) Co-authored-by: Claude Sonnet 4.6 (1M context) <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Motivation
NSA(Native Sparse Attention) is a misnomer — this attention variant is specific to DeepSeek and should be calledDSA(DeepSeek Sparse Attention). This PR performs a full rename fromnsatodsaacross user-facing CLI/env/registry surfaces and internal files, while preserving backward-compatible aliases for the user-facing layer.Modifications
User-facing (with deprecated backward-compat aliases):
ServerArgsfields:nsa_prefill_backend→dsa_prefill_backend,nsa_decode_backend→dsa_decode_backend,enable_nsa_prefill_context_parallel→enable_dsa_prefill_context_parallel,nsa_prefill_cp_mode→dsa_prefill_cp_mode--dsa-*as canonical;--nsa-*kept as deprecated aliases (emit logger warning viaDeprecatedAliasStoreAction)"dsa"as canonical;"nsa"kept withDeprecationWarningSGLANG_DSA_*canonical;SGLANG_NSA_*as deprecated fallbacks via_DeprecatedEnvFallbackmixinInternal renames (no compat layer needed):
layers/attention/nsa/→dsa/;nsa_backend.py→dsa_backend.py;nsa_indexer.py→dsa_indexer.pyNativeSparseAttnBackend→DeepseekSparseAttnBackend(one-release alias kept);NSAMetadata→DSAMetadata;NSAIndexerMetadata→DSAIndexerMetadata; etc.SGLANG_DSA_*inside DSA backendtest_nsa_indexer.py→test_dsa_indexer.py,test_nsa_pool_host_unit.py→test_dsa_pool_host_unit.pyhandle_attention_nsa→handle_attention_dsa;_create_nsa_{decode,prefill}_backend→_create_dsa_*attach_hybrid_nsa_pool_to_hiradix_cache→attach_hybrid_dsa_pool_to_hiradix_cache"dsa"as canonical entryBackward-compat shims (to be removed in N+1 release):
layers/attention/nsa_backend.py— thin re-export shimlayers/attention/nsa/__init__.py— thin re-export shimNote: the directory mv (
nsa/→dsa/) may rebase-conflict with upstream PR #23906 (Cuda Graph Runner refactor). Coordination recommended before merge.Accuracy Tests
Pure rename refactor — no model forward or kernel code changed. Verified with:
test_dsa_indexer.py: 9 passedtest_dsa_alias_cli_registry_env.py: 24 passedtest_dsa_pool_host_unit.py: 2 passedSpeed Tests and Profiling
N/A — no computation path changes.
Checklist
Review and Merge Process
/tag-and-rerun-ci,/tag-run-ci-label,/rerun-failed-ciCI States
Latest PR Test (Base): 🚫 Run #26137426290
Latest PR Test (Extra): ❌ Run #26137426228