bench: add topology KV candidate schedule benchmark#1160
Conversation
AI Code Review - PR #1160Status: BLOCKING Summary: P0/0 · P1/0 · P2/3 · P3/1 Non-blocking SuggestionsP2
P3
Checklist Violations (2 fail / 54 total)General Principles Checklist
Strengths
|
There was a problem hiding this comment.
Pull request overview
Note
Copilot couldn't run its full agentic review because no GitHub Actions runner was available. Make sure your repository has a runner available to run Copilot's review, or add a copilot-setup-steps.yml file specifying one with the runs-on attribute. See the docs for more details.
Adds an opt-in benchmarking + test harness to evaluate a topology-derived KV candidate schedule for long-context decode attention, comparing dense PyTorch SDPA against a selected-token (gathered K/V) SDPA path.
Changes:
- Added a topology-style block schedule builder (sink/local/high-drift) plus token-index expansion helpers.
- Added a CUDA/CPU benchmark script that times dense SDPA vs selected-token SDPA for decode (q_len=1).
- Added unit tests and benchmark documentation with an example command/output.
Reviewed changes
Copilot reviewed 3 out of 3 changed files in this pull request and generated 6 comments.
| File | Description |
|---|---|
| benchmark/topology_kv_candidate_schedule.py | Implements centroiding, block candidate scheduling, token expansion, and the dense vs selected-token SDPA benchmark runner. |
| benchmark/test_topology_kv_candidate_schedule.py | Adds correctness + reproducibility tests for centroiding/scheduling and a CUDA-gated benchmark smoke test. |
| benchmark/README.md | Documents how to run the new benchmark and shows example output/caveats. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
AI Code Review - PR #1160Status: BLOCKING Summary: P0/0 · P1/0 · P2/0 · P3/2 Non-blocking SuggestionsP3
Checklist Violations (2 fail / 54 total)General Principles Checklist
Strengths
|
AI Code Review - PR #1160Status: BLOCKING Summary: P0/0 · P1/0 · P2/1 · P3/1 Non-blocking SuggestionsP2
P3
Checklist Violations (1 fail / 54 total)General Principles Checklist
Strengths
|
AI Code Review - PR #1160Status: LGTM Summary: P0/0 · P1/0 · P2/2 · P3/1 lgtm ready to ci Non-blocking SuggestionsP2
P3
Checklist ✅ (54 items passed)Strengths
|
AI Code Review - PR #1160Status: LGTM Summary: P0/0 · P1/0 · P2/1 · P3/0 lgtm ready to ci Non-blocking SuggestionsP2
Checklist ✅ (44 items passed)Strengths
|
|
internal source has been updated, please review the changes! |
AI Code Review - PR #1160Status: BLOCKING Summary: P0/0 · P1/1 · P2/0 · P3/0 Blocking IssuesP1
Checklist Violations (2 fail / 50 total)General Principles Checklist
RTP-LLM Checklist
Strengths
|
AI Code Review - PR #1160Status: BLOCKING Summary: P0/0 · P1/1 · P2/0 · P3/0 Blocking IssuesP1
Checklist Violations (3 fail / 63 total)General Principles Checklist
RTP-LLM Checklist
Strengths
|
AI Code Review - PR #1160Status: LGTM Summary: P0/0 · P1/0 · P2/0 · P3/0 lgtm ready to ci Checklist ✅ (63 items passed)Strengths
|
|
internal source has been updated, please review the changes! |
AI Code Review - PR #1160Status: BLOCKING Summary: P0/0 · P1/1 · P2/0 · P3/0 Blocking IssuesP1
Checklist Violations (2 fail / 70 total)General Principles Checklist
RTP-LLM Checklist
Strengths
|
AI Code Review - PR #1160Status: LGTM Summary: P0/0 · P1/0 · P2/0 · P3/0 lgtm ready to ci Checklist ✅ (70 items passed)Strengths
|
|
internal source has been updated, please review the changes! |
|
以下为英文说明的中文翻译,供审核参考: 您好,最新 CI 仍失败于内部 |
Summary
This PR adds an opt-in benchmark for evaluating topology-derived KV candidate schedules during long-context decode attention.
The benchmark:
benchmark/with no serving-path behavior changes.This is a screening benchmark only. It does not claim an end-to-end RTP-LLM serving speedup, and it does not route production attention through sparse candidates.
Related follow-up: #1161
Benchmark
Environment:
Command:
Example output:
Validation
Results:
12 passedpy_compilepassedflake8passedNotes
scaled_dot_product_attention; only the attended token set changes.