Commit 290fdfd
committed
[nvbugs/6276981][fix] DSA chunked-prefill indexer: always q-split when eligible
When the indexer chunked-prefill is gated by q_split_eligible (TP > 1, no
attention DP) but apply_q_split is False (chunk smaller than
q_split_threshold), every TP rank computes the full chunk's topk indices
independently via fp8_mqa_logits / fp8_fp4_mqa_logits. Those DeepGEMM
kernels are not bit-exact across launches, so per-rank topk indices
diverge for the same tokens. The downstream MLA attention then attends
to different KV positions on different ranks, corrupting KV-cache
writes. Short generations (MMLU's 2-token answers) hide it; long ones
(GSM8K's 256 tokens) compound it into garbage and 0% accuracy.
Force the q-split + allgather path whenever eligible: small chunks pay
a microscopic allgather instead of redundant per-rank logits compute,
and the per-token canonical owner from the slice + allgather erases
any rank-local nondeterminism before downstream layers read the
indices. q_split_threshold < 0 still fully disables eligibility.
Signed-off-by: tensorrt-cicd <90828364+tensorrt-cicd@users.noreply.github.com>1 parent eb2bddd commit 290fdfd
3 files changed
Lines changed: 85 additions & 105 deletions
File tree
- tensorrt_llm/_torch/attention_backend/sparse
- tests/integration
- defs/examples/visual_gen/golden/visual_gen_lpips
- test_lists
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
2016 | 2016 | | |
2017 | 2017 | | |
2018 | 2018 | | |
2019 | | - | |
2020 | | - | |
| 2019 | + | |
| 2020 | + | |
| 2021 | + | |
| 2022 | + | |
| 2023 | + | |
| 2024 | + | |
| 2025 | + | |
| 2026 | + | |
| 2027 | + | |
| 2028 | + | |
| 2029 | + | |
| 2030 | + | |
| 2031 | + | |
2021 | 2032 | | |
2022 | 2033 | | |
2023 | 2034 | | |
| |||
2065 | 2076 | | |
2066 | 2077 | | |
2067 | 2078 | | |
2068 | | - | |
| 2079 | + | |
2069 | 2080 | | |
2070 | 2081 | | |
2071 | 2082 | | |
| |||
Binary file not shown.
0 commit comments