Repository navigation
[None][feat] Add DSA Vanilla sparse attention - #16309
Conversation
|
/bot run --disable-fail-fast |
|
PR_Github #59376 [ run ] triggered by Bot. Commit: |
|
PR_Github #59376 [ run ] completed with state |
|
/bot run --disable-fail-fast |
|
PR_Github #59435 [ run ] triggered by Bot. Commit: |
|
PR_Github #59435 [ run ] completed with state |
|
Note Reviews pausedIt looks like this branch is under active development. To avoid overwhelming you with review comments due to an influx of new commits, CodeRabbit has automatically paused this review. You can configure this behavior by changing the Use the following commands to manage reviews:
Use the checkboxes below for quick actions:
WalkthroughVanillaAttention now supports DSA sparse MLA with paged latent-cache handling, sparse selection routing, selected-token attention, and contiguous cache writes. The attention test harness adds sparse configuration, cache execution, deterministic inputs, capability checks, and Vanilla-versus-TRTLLM comparisons. ChangesDSA sparse MLA support
Estimated code review effort: 4 (Complex) | ~60 minutes Sequence Diagram(s)sequenceDiagram
participant BackendCase
participant SparseKVCacheManager
participant VanillaAttention
participant TRTLLM
BackendCase->>SparseKVCacheManager: create sparse paged cache
BackendCase->>VanillaAttention: run sparse context and generation
VanillaAttention->>SparseKVCacheManager: read and append latent cache
BackendCase->>TRTLLM: run matching sparse phases
BackendCase->>BackendCase: compare outputs and singleton oracle values
Possibly related PRs
Suggested reviewers: 🚥 Pre-merge checks | ✅ 4 | ❌ 1
✨ Finishing Touches
Comment |
|
PR_Github #72765 [ run ] completed with state
|
Signed-off-by: Yihan Wang <yihwang@nvidia.com>
|
/bot run |
|
PR_Github #72837 [ run ] triggered by Bot. Commit: |
|
PR_Github #72837 [ run ] completed with state |
|
@yuxianq, this PR is already assigned to you as trt-llm-torch-attention-devs based on your earlier review. Could you help with the renewed review request? Thanks~ Assignment explanation
Affinity and workload are snapshots at selection, not live counters. Existing reservations on this PR are counted once. |
Preserve the independent DSA Vanilla backend and its regression coverage. Reconcile the indexer test helper with upstream and limit signature exclusions to optional non-DSA modes. Signed-off-by: yihwang-nv <yihwang@nvidia.com>
Share phase, score, TopK mapping, and latent-cache helpers while preserving the independent PyTorch reference. Document quantization and cache contracts, improve input validation, and move kernel-only reference adapters into test utilities. Trim redundant tests while retaining quantized Q projection and generation RoPE/cache ownership coverage. Validation on umbriel-b200-043 (B200): 1305 passed, 4 existing skips, 0 failed. Ruff lint, formatting, and diff checks passed. Signed-off-by: yihwang-nv <yihwang@nvidia.com>
|
/bot run |
|
PR_Github #78057 [ run ] triggered by Bot. Commit: |
|
PR_Github #78057 [ run ] completed with state
|
yuxianq
left a comment
There was a problem hiding this comment.
One issue with the FP8 block-scale projection reference.
… indexer end to end - Pick UE8M0 vs float32 1x128 activation scales in the Vanilla indexer wq_b reference by mirroring FP8BlockScalesLinearMethod.apply dispatch (SM100 family, SM107 CuTe DSL MXFP8, SM120, int32 weight scales). - Dequantize FP8 QDQ in float32 before casting back to the input dtype. - Tile weighted_relu_scores over queries to bound [H, T, S] intermediates on long sequences. - Run the indexer end to end in all sparse MLA cases, including the long ones, instead of injecting random top-k indices. - Cover DSA sparse backend cases on both v1 and v2 KV cache managers. Signed-off-by: yihwang-nv <yihwang@nvidia.com>
|
/bot run |
- Follow fp8_quantize_1x128's arithmetic in _qdq_fp8_blocks (quant = 448 / amax, dequant = 1 / quant, quantize x * quant). - Add a GPU test comparing _qdq_fp8_blocks with the native quantizer: exact for UE8M0 scales, and at most one adjacent E4M3 code on rare elements for float32 scales, since the kernel is built with --use_fast_math. - Use an asymmetric input in the CPU dispatch test so quantization errors cannot cancel in the projection. Signed-off-by: yihwang-nv <yihwang@nvidia.com>
|
/bot run |
Signed-off-by: yihwang-nv <yihwang@nvidia.com>
Signed-off-by: yihwang-nv <yihwang@nvidia.com>
|
/bot run |
|
PR_Github #81324 [ run ] triggered by Bot. Commit: |
|
PR_Github #81324 [ run ] completed with state Resource maintenance in LLM/main/L0_Test-x86_64-Single-GPU #9635: L40S-PyTorch-2 is temporarily paused due to Kubernetes agent provisioning and node issues.
|
The CuTe DSL paged-MQA atom split reads its expanded schedule from on_update_kv_lens(), which the executor runs after prepare() on every step. Call it in the generation steps so the TRTLLM indexer matches the Vanilla golden. Signed-off-by: yihwang-nv <yihwang@nvidia.com>
Signed-off-by: yihwang-nv <yihwang@nvidia.com>
|
/bot run |
|
PR_Github #81604 [ run ] triggered by Bot. Commit: |
|
PR_Github #81604 [ run ] completed with state |
Depends on #18044.
Description
DSAVanillaAttentionandDSAVanillaIndexerPyTorch golden implementations with the same module-facing contracts as the TRTLLM DSA backend.DSATrtllmAttention.TRTLLM_DSA_INDEXER_BF16projection mode without dispatching through the production fused kernels.max_model_lenwhose final page is partial, and validate compressed generation coordinates when a cached prefix is present.The implementation is intentionally standalone: projection, quantization, RoPE, cache reconstruction, scoring, and selection are expressed in PyTorch so a defect in a TRTLLM/DeepGEMM/CuTe kernel cannot be hidden by sharing its implementation with the golden.
Test Coverage
pytest -q tests/unittest/_torch/attention/sparse/dsa— passed on B200 before the upstream rebase.pytest -q tests/unittest/_torch/attention/test_attention_backends.py -k deepseekv3_2_dsa_mla— passed on B200 before the upstream rebase.ruff check,ruff format --check, andgit diff --checkfor the rebased DSA changes — passed.The current host cannot collect TensorRT-LLM pytest tests because its Python environment cannot load
libmpi; CI should revalidate the rebased head.