Skip to content

feat(attention): add unfused compressed sparse attention - #5947

Closed
FDecaYed wants to merge 1 commit into
NVIDIA:pull-request/5944from
FDecaYed:codex/dsv4-csa-unfused-core
Closed

feat(attention): add unfused compressed sparse attention#5947
FDecaYed wants to merge 1 commit into
NVIDIA:pull-request/5944from
FDecaYed:codex/dsv4-csa-unfused-core

Conversation

@FDecaYed

@FDecaYed FDecaYed commented Jul 21, 2026

Copy link
Copy Markdown
Contributor

What

Add the unfused SBHD compressed sparse attention core:

  • compressor and learned indexer;
  • sliding-window and compressed-KV selection;
  • sparse-attention execution and dense-reference mode;
  • inert CSA configuration fields;
  • focused helper, forward/backward, compressor/indexer, dense-mode, and RoPE coverage.

This slice deliberately does not enable the dsv4_hybrid model variant. Its Files changed view is limited to the algorithm, configuration fields, and tests.

Stack

This PR is stacked on #5944 because CSA consumes its explicit MLA RoPE API and remove-interleaving behavior.

Provenance

Deliberately excluded

  • model-variant selection and Hybrid attention orchestration;
  • fused CSA/DSA kernels;
  • packed-sequence/THD and context-parallel support;
  • HybridModel and GPTModel wiring;
  • HCA, Hash MoE, mHC, and FP8 marker integration.

Testing

  • isort, ruff, Black, Python compilation, and git diff --check passed for the exact slice.
  • Focused pytest collection is blocked locally because this host lacks Torch/CUDA; PR CI owns execution.

Add the unfused compressed sparse attention algorithm, inert configuration fields, and focused algorithm coverage without enabling a model variant.

Reconstructed from NVIDIA#4458 and its corrections as part of the frozen feature set in NVIDIA#5795.

Signed-off-by: Deyu Fu <Deyu.Foo@gmail.com>
@copy-pr-bot

copy-pr-bot Bot commented Jul 21, 2026

Copy link
Copy Markdown

Auto-sync is disabled for draft pull requests in this repository. Workflows must be run manually.

Contributors can view more details about this message here.

@FDecaYed

Copy link
Copy Markdown
Contributor Author

/ok to test bb891cb

Copy link
Copy Markdown
Contributor Author

Closing this draft until Round 1. Its logical successor is D1 (unfused SBHD compressed sparse attention), rebuilt after P1 and P6 merge. It will target main directly rather than remain stacked. Tracking PR: #5795.

@FDecaYed FDecaYed closed this Jul 23, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant