Commit Graph

26 Commits

Author SHA1 Message Date
laoyao0822
47bd2fdf1f Reduce shared KV materialize synchronization
The shared-KV materialize path was spending time in Python-observed CUDA tensor predicates and dynamic-shape remap helpers. Keep the runtime changes that move the hot paged path to slot-based device remapping, while dropping the NVTX experiment from this commit so profiling annotations do not become part of the runtime surface yet.\n\nThe MLA read path now passes the real page table as the page remap source, which keeps paged topk indices tied to the same logical page-table domain used to build the dense materialized KV view.\n\nConstraint: CP shared KV still needs a dense per-call view before deeper Phase4/Phase5 layout changes remove the materialize cost.\nRejected: Keep NVTX ranges in this commit | user requested reverting NVTX instrumentation before commit\nRejected: Restore compact unique-page remap everywhere | it reintroduces CUDA sync-prone dynamic-shape ops on the hot paged materialize path\nConfidence: medium\nScope-risk: moderate\nDirective: Benchmark slot-remap buffer size against compact unique-page remap before treating this as the final performance path; Phase4/5 should reduce materialize instead of relying on this aggregation path.\nTested: git diff --check on changed files; python -m py_compile on changed runtime/backend/test files; grep confirmed NVTX symbols removed\nNot-tested: pytest blocked locally by missing pybase64 dependency; multi-node PD runtime not rerun
2026-04-28 04:09:19 +08:00
laoyao0822
d015e3fb01 Reduce CP shared KV current-chunk materialization
Phase 2 shared KV keeps persistent KV/index sharded across CP ranks but
uses a full-view compatibility layer before NSA topk and MLA attention.
For current-only prefill chunks, the current KV/index tensors have already
been CP all-gathered and reranged before being written to the sharded
persistent pool. This change adds a guarded current-reuse path that remaps
logical current locs to compact tensor rows and skips the shared-KV
materialize path for current-only MLA and NSA indexer reads.

Constraint: Existing NSA/MLA kernels still consume full-view/compact page tables; history and mixed current/history batches must keep the Phase 2 fallback.
Rejected: Make all history attention shard-aware in this patch | that requires global topk merge and distributed sparse attention and belongs to a later phase.
Confidence: medium
Scope-risk: moderate
Reversibility: clean
Directive: Do not remove the Phase 2 fallback until mixed/history shared-KV paths have correctness and performance coverage.
Tested: python -m py_compile on modified Python files
Tested: git diff --check on staged modified files
Not-tested: local pytest collection is blocked by missing pybase64 in this environment.
Not-tested: full long-context chunked prefill/decode performance in this commit step.
2026-04-26 23:29:34 +08:00
laoyao0822
f8fca72635 Expand prefill CP KV capacity by sharding persistent NSA KV
Prefill CP previously replicated NSA/MLA persistent KV on every CP rank, so CP8 consumed eight copies of KV memory while exposing only one rank of logical cache capacity. This change splits logical KV locs from per-rank physical storage, shards MLA latent KV and NSA index K/scale by deterministic page ownership, and keeps existing NSA attention kernels working through a full-view runtime materialization layer.

Mooncake PD transfer now sends each prefill CP rank's owned physical pages with explicit logical page positions so non-CP decode can reconstruct full-layout KV. The implementation is guarded by an explicit server flag and startup checks, and the design documentation records the implemented scope, debug environment, and Phase 3 boundary.

Constraint: Phase 2 must preserve existing NSA attention/index kernels via runtime full-view materialization
Constraint: Decode side remains non-CP and receives full KV through Mooncake
Rejected: Shard-aware NSA attention in this change | belongs to Phase 3 because it requires distributed topk/softmax/output contracts
Rejected: Request-contiguous CP ownership | unstable under chunked prefill and tied to attention split mode
Confidence: medium
Scope-risk: broad
Directive: Do not enable round-robin CP shared KV without wiring runtime materialization/PD transfer contracts for that split mode
Directive: Keep SGLANG_DEBUG_CP_SHARED_KV disabled for perf measurements; it intentionally enables CUDA-syncing diagnostics
Tested: Remote py_compile for shared-KV touched Python files in g0034 container
Tested: Remote pytest selected cp_shared/shared_kv/nsa suite: 37 passed, 34 deselected
Not-tested: Full GLM5 multi-node throughput/regression run after final doc update
Not-tested: Phase 3 shard-aware runtime, round-robin CP mode, and non-Mooncake PD backends
2026-04-26 04:11:17 +08:00
wxiwnd
91facd5bb2 perf(disaggregation): fast-path common decode result processing 2026-04-19 04:23:48 +08:00
wxiwnd
14c40f4e7d perf(disaggregation): slice decode waiting queue for prebuilt batches 2026-04-19 04:23:48 +08:00
wxiwnd
6237271fc9 perf(disaggregation): compact decode queues in one pass 2026-04-19 04:23:48 +08:00
wxiwnd
9470d6d8dc perf(disaggregation): compact prefill bootstrap queue in one pass 2026-04-19 04:23:48 +08:00
wxiwnd
09acec1908 perf(disaggregation): cache static buffer metadata 2026-04-19 04:23:48 +08:00
wxiwnd
53a04a9a97 perf(disaggregation): reuse req pool freelists and alloc_extend tensors 2026-04-19 04:23:48 +08:00
laoyao0822
ef607c35c9 fix(spec_v2): support EAGLE with spec_v2
1. add pass for spec_v2 in base_attn

2. fix: EAGLE with spec_v2 overlap Grammar accept_token failed

Signed-off-by: wxiwnd <wxiwnd@outlook.com>
2026-04-09 01:37:13 +08:00
Lianmin Zheng
814202704b ci: unify PR test suite naming (#21187) 2026-03-23 00:18:45 -07:00
Ke Bao
2406ddfdb8 Add ut guide to test skills (#21130) 2026-03-22 20:55:37 +08:00
Shunkangz
bb737d7a82 Support Qwen3 MoE context parallel (#18233)
Co-authored-by: Shunkang <182541032+Shunkangz@users.noreply.github.co>
Co-authored-by: Jiying Dong <87510204+dongjiyingdjy@users.noreply.github.com>
2026-03-22 01:27:20 -07:00
shuwenn
6c91590e1b [HiCache] refactor: hicache normalization flow and compatibility checks (#19669) 2026-03-20 18:38:44 -07:00
Zijun Gao
576e397b6e [Test] Add unit tests for srt/sampling (#20891) 2026-03-20 23:38:48 +08:00
Lianmin Zheng
cea79530f8 ci: merge CPU default and stage-a-cpu-only suites (#20992) 2026-03-20 00:04:55 -07:00
Xinyuan Tong
d1e95af282 Upgrade transformers==5.3.0 (#17784)
Signed-off-by: Xinyuan Tong <xinyuantong.cs@gmail.com>
Co-authored-by: Kangyan-Zhou <zky314343421@gmail.com>
Co-authored-by: Alison Shao <alisonshao@mac.lan>
Co-authored-by: Mick <mickjagger19@icloud.com>
2026-03-18 13:50:43 -07:00
Viacheslav
30a35ecd90 Add gigachat3.1 parser (#19886)
Signed-off-by: Viacheslav Barinov <vvadbarinov@sberbank.ru>
Signed-off-by: Viacheslav Bv <viacheslav.teh@gmail.com>
Co-authored-by: Viacheslav Barinov <vvadbarinov@sberbank.ru>
2026-03-17 22:45:01 -07:00
Ke Bao
7f99319c56 Add evict policy ut (#20787) 2026-03-17 22:06:14 +08:00
Jay Shaik
e4d06b3db2 Fix /generate JSON serialization for non-finite top_logprobs (#20714) 2026-03-16 20:07:12 -07:00
roikoren755
5ef5806160 [Nemotron] Small reasoning parser fix (#20284) 2026-03-16 13:29:40 -07:00
pansicheng
97b2a89334 [RadixTree][8/N Refactor]: unify lock interface (#20330) 2026-03-16 11:49:51 +08:00
Liangsheng Yin
116aef8504 [Test] Move embedding tests into test/registered/embedding/ and unit/ (#20642) 2026-03-15 14:48:43 -07:00
Ke Bao
c3483e8e97 [CI] Move existing unit tests into unit directory (#20631) 2026-03-15 23:25:18 +08:00
Ke Bao
e2be31824f [CI] Add ut coverage tool (#20628) 2026-03-15 21:13:45 +08:00
Ke Bao
0cff070828 [CI] Add READMEs for unit test directory structure (#20626) 2026-03-15 20:27:05 +08:00