[None][feat] DSv4 prep: attention op plumbing - #15384
Conversation
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Path: .coderabbit.yaml Review profile: CHILL Plan: Enterprise Run ID: 📒 Files selected for processing (2)
📝 WalkthroughWalkthroughTwo new optional fields ( ChangesDeepSeek-V4 Sparse-MLA Support
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~20 minutes 🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches🧪 Generate unit tests (beta)
Comment |
|
/bot run --disable-fail-fast |
|
PR_Github #54390 [ run ] triggered by Bot. Commit: |
heyuhhh
left a comment
There was a problem hiding this comment.
It totally looks good to me with little comments: it would be better if we can just keep forward_args process in this PR, many other operations can be lived in V4 metadata/attention.
|
/bot kill |
|
PR_Github #54427 [ kill ] triggered by Bot. Commit: |
|
PR_Github #54390 [ run ] completed with state |
|
PR_Github #54427 [ kill ] completed with state |
Signed-off-by: Fanrong Li <lfr-0531@users.noreply.github.com>
82536f0 to
9e86d65
Compare
|
/bot run --disable-fail-fast |
|
PR_Github #54453 [ run ] triggered by Bot. Commit: |
|
PR_Github #54453 [ run ] completed with state
|
|
/bot run --disable-fail-fast |
|
PR_Github #54491 [ run ] triggered by Bot. Commit: |
|
/bot kill |
|
PR_Github #54544 [ kill ] triggered by Bot. Commit: |
|
PR_Github #54491 [ run ] completed with state |
|
PR_Github #54544 [ kill ] completed with state |
Signed-off-by: Fanrong Li <lfr-0531@users.noreply.github.com>
Signed-off-by: Fanrong Li <lfr-0531@users.noreply.github.com>
|
/bot run --disable-fail-fast |
|
PR_Github #54549 [ run ] triggered by Bot. Commit: |
|
/bot kill |
This reverts commit bfacdce. Signed-off-by: Fanrong Li <lfr-0531@users.noreply.github.com>
|
PR_Github #54551 [ kill ] triggered by Bot. Commit: |
|
PR_Github #54549 [ run ] completed with state |
|
PR_Github #54551 [ kill ] completed with state |
Signed-off-by: Fanrong Li <lfr-0531@users.noreply.github.com>
|
/bot run --disable-fail-fast |
|
PR_Github #54565 [ run ] triggered by Bot. Commit: |
|
PR_Github #54565 [ run ] completed with state |
Signed-off-by: Fanrong Li <lfr-0531@users.noreply.github.com> Co-authored-by: Fanrong Li <lfr-0531@users.noreply.github.com> Signed-off-by: GitLab CI Bot <gitlab-ci@nvidia.com>
Signed-off-by: Fanrong Li <lfr-0531@users.noreply.github.com> Co-authored-by: Fanrong Li <lfr-0531@users.noreply.github.com> Signed-off-by: GitLab CI Bot <gitlab-ci@nvidia.com>
Summary by CodeRabbit
Description
This PR adds the remaining Python-side attention-op plumbing needed for the DSv4 split:
AttentionSparseArgssparse_mla_topk_lensandcompressed_kv_cache_pool_ptrintothop.attentionalgorithm == "deepseek_v4"using duck-typed metadata/config fields, without importingDeepSeekV4SparseAttentionConfigor any DSv4 model/backend/cache-manager modulesTrtllmAttentionMetadata.max_total_draft_tokensso the attention-op sync test can validate the thop call site without a dynamicgetattrThis is intentionally limited to shared TRTLLM attention backend/interface plumbing. The DSv4 sparse backend and cache-manager implementation are left for the later split PR that consumes these fields.
Test Coverage
python3 ./scripts/build_wheel.py --trt_root /usr/local/tensorrt --benchmarks --use_ccache --cuda_architectures "90-real;100-real" --configure_cmake.venv-3.12/bin/python -m pip install --force-reinstall --no-deps build/tensorrt_llm-1.3.0rc18-cp312-cp312-linux_x86_64.whltensorrt_llm,tensorrt_llm._torch.attention_backend.trtllm, andtensorrt_llm.bindings.internal.thopload from this worktree / installed wheelmodeling_deepseekv4, DSv4 sparse backend, or DSv4 sparse cache-manager module is loaded by importingtrtllm.pytensorrt_llm/_torch/attention_backend/interface.pyandtensorrt_llm/_torch/attention_backend/trtllm.pyare changed, with no compressor/mHC, IndexerTopK/TopK, MoE, DSv4 model/tokenizer, fusion/custom-op, or sparse-backend implementation filesCUDA_VISIBLE_DEVICES=0 timeout 1800 .venv-3.12/bin/python -m pytest -q --tb=short -ra tests/unittest/_torch/attention/sparse/test_cpp_custom_ops.pyCUDA_VISIBLE_DEVICES=0 timeout 600 .venv-3.12/bin/python -m pytest -q --tb=short -ra tests/unittest/_torch/attention_backend/test_attention_op_sync.pyAlso attempted
tests/unittest/_torch/attention/test_attention_mla.pyon idle GPU 0. It failed in existing TRTLLM-Gen FMHA NVRTC preprocessing at step 1 withcould not open source file "cuda.h" (no directories in search list). Retrying the failing case withCPATH=/usr/local/cuda-13.1/targets/x86_64-linux/includeproduced the same NVRTC include-path error, so this is recorded as an environment/runtime include issue rather than a PR-4 plumbing assertion failure.Build note: attribution generation warned
ninja -t inputs returned no results for wheel targets, but the wheel build exited 0.PR Checklist
Please review the following before submitting your PR:
PR description clearly explains what and why. If using CodeRabbit's summary, please make sure it makes sense.
PR Follows TRT-LLM CODING GUIDELINES to the best of your knowledge.
Test cases are provided for new code paths (see test instructions)
If PR introduces API changes, an appropriate PR label is added - either
api-compatibleorapi-breaking. Forapi-breaking, includeBREAKINGin the PR title.Any new dependencies have been scanned for license and vulnerabilities
CODEOWNERS updated if ownership changes
Documentation updated as needed
Update tava architecture diagram if there is a significant design change in PR.
The reviewers assigned automatically/manually are appropriate for the PR.
Please check this after reviewing the above items as appropriate for this PR.
GitHub Bot Help
To see a list of available CI bot commands, please comment
/bot help.