Commit Graph
541 Commits
Author SHA1 Message Date
laoyao0822 91fa31bcac Enable compute-owner KV layout by page-aligning NSA CP split
Phase 5 needs each current KV page to have exactly one CP compute owner before local KV/index direct writes can be safe. This change teaches in-seq NSA prefill CP to produce page-aligned split metadata under shared-KV mode, threads page size into the metadata builders, and fixes local pair splitting so unequal page-aligned zigzag segments do not corrupt topk inputs.

Constraint: Phase 5 direct-write layout requires page ownership to be expressible at page granularity
Constraint: Short page-unit batches remain on the token-balanced fallback to avoid zero-page segment risk
Rejected: Split local q/weights by half | page-aligned zigzag segments can have unequal token counts
Confidence: medium
Scope-risk: moderate
Directive: Do not enable compute-owner direct writes unless nsa_cp_metadata.page_aligned is true and local loc ownership is verified
Tested: python3 -m py_compile python/sglang/srt/layers/attention/nsa/utils.py python/sglang/srt/layers/attention/nsa/nsa_indexer.py python/sglang/srt/models/deepseek_v2.py python/sglang/srt/models/deepseek_nextn.py test/registered/unit/layers/test_nsa_cp_utils.py
Not-tested: Local pytest collection is blocked in this environment by missing pybase64; container/runtime tests were not rerun during this commit step
2026-05-01 00:54:32 +08:00
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
kpham-sglandClaude Opus 4.6 bc4aaab6a1 [Spec][Ngram] 2/N: Rename branch length to max trie depth (#21181)
Co-authored-by: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-22 23:35:25 -07:00
Shangming Cai a094eb9c21 Temporarily disable flaky qwen3 cp test in CI (#21178) 2026-03-22 21:13:52 -07:00
fanghao 2b47bd3a34 [Bug Fix] Fix non-streaming request abort failure when --enable-metrics is enabled (#20625) 2026-03-22 19:58:49 -07:00
Ziang Li ce0541404f [FlashInfer v0.6.6][RL] Support fp8-last-n-bf16 RL for flashinfer_trtllm_routed moe backend (#20214) 2026-03-22 11:17:01 -07:00
Ke Bao 2406ddfdb8 Add ut guide to test skills (#21130) 2026-03-22 20:55:37 +08:00
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
kpham-sgl 6d160b42bb [Spec][Ngram] 1/N: Reference based Speculative Decoding refactor (#20393) 2026-03-22 00:55:10 -07:00
Bowen Liandkinza99 3bc595acbc [FlashAttn] Add fused triton kernel for normal_decode_set_metadata (#20778)
Co-authored-by: kinza99 <dh18324568312@163.com>
2026-03-22 15:12:29 +08:00
KnightLTCandMcZyWu a0862f00c2 dbrx instruct npu support (#17121)
Co-authored-by: McZyWu <zhuoyun.wu.23@ucl.ac.uk>
2026-03-21 17:10:35 +08:00
Alison ShaoandAlison Shao 852e112ebf [Qwen3.5] Fix broken pipeline parallelism layer splitting (#21070)
Co-authored-by: Alison Shao <alison.shao@Mac.attlocal.net>
2026-03-21 01:02:51 -07:00
Baizhou Zhang 9ca68a5904 Remove flaky test for test_lora_update.py (#21088) 2026-03-21 00:52:40 -07:00
Qiaolin Yu 3f883ebf2e Fix test_qwen35_models (#21081) 2026-03-21 00:22:38 -07:00
Lianmin Zheng dba6fb3d30 Fix streaming logprobs corruption caused by shared mutable list reference (#21030) 2026-03-21 00:18:48 -07:00
Baizhou Zhang 67cad3e69e Revert "Support CuteDSL mm_fp4 backend" (#21077) 2026-03-20 22:47:47 -07:00
Liangsheng Yin 9614271ae4 [Test] Fix flaky multi-instance memory occupation test (#21074) 2026-03-20 22:19:03 -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
fzyzcjy 146700db68 Add e2e demo test in dump comparator (#21031) 2026-03-20 22:41:01 +08:00
fzyzcjy 6703cc4484 Enhance output formatting in dump comparator (#21029) 2026-03-20 22:04:50 +08:00
fzyzcjy fdbcb8156e Refactor dp_utils to use ParallelAxis enum in dump comparator (#21028) 2026-03-20 22:04:20 +08:00
fzyzcjy 154395ab7d Support s≡t dimension name equivalence in dump comparator (#21027) 2026-03-20 22:03:34 +08:00
fzyzcjy cc22601d28 Validate replicated axes orthogonality in dump comparator (#21026) 2026-03-20 22:02:40 +08:00
fzyzcjy 2f01950a0e Support jointly-determined axes inference in dump comparator (#21025) 2026-03-20 22:01:26 +08:00
fzyzcjy ecd7e40d20 Support dependent axis auto-resolution in dump comparator (#21024) 2026-03-20 21:56:39 +08:00
Lianmin Zheng 104b10f70a refactor: consolidate is_in_ci (jit_kernel, sgl-kernel benchmarks, tests) (#21009) 2026-03-20 05:55:36 -07:00
Lianmin Zheng c1da420799 ci: run Stage A CUDA tests as stage-a-test-small-1-gpu on 5090 (#20988) 2026-03-20 02:55:16 -07:00
Lianmin Zheng a0a4dae67f Revert "Fix DeepSeek V32 FP4 test" (#21003) 2026-03-20 02:19:28 -07:00
Baizhou Zhang c82d20d48e Fix DeepSeek V32 FP4 test (#20984) 2026-03-20 01:04:32 -07:00
Lianmin Zheng cea79530f8 ci: merge CPU default and stage-a-cpu-only suites (#20992) 2026-03-20 00:04:55 -07:00
Liangsheng Yin 6ad78b008b Consolidate streaming session tests (4 files → 3, fewer server starts) (#20961) 2026-03-19 19:13:28 -07:00
Leon Gao 63c38aba5e Fix token leak with logprob_start_len=0 in streaming sessions (#20557) 2026-03-19 15:37:27 -07:00
Brayden Zhong b42b9f6e1a Support CuteDSL mm_fp4 backend (#18801) 2026-03-19 14:20:01 -07:00
c562e0d13b [feat] Enhance Kimi-K2/K2.5 function call and reasoning detection (#19552)
Co-authored-by: alfredyyang <alfredyyang@tencent.com>
Co-authored-by: Xinyuan Tong <115166877+JustinTong0323@users.noreply.github.com>
2026-03-19 12:57:57 -07:00
billishyahao 2ee7f41e25 [AMD] add mori ep normal tbo unittest (#20941) 2026-03-19 11:52:25 -07:00
YC Yen-Ching Tseng 9e629d31fd [AMD] CI - Fix AMD CI (multimodal test, move flaky test to non-deterministic group) (#20815) 2026-03-19 11:50:19 -07:00
Shangming Cai 4c52b7fcc6 [CI] Improve PP consistency check success rate (#20838)
Signed-off-by: Shangming Cai <csmthu@gmail.com>
2026-03-19 19:12:50 +08:00
Ethan (Yusheng) Su 7f6f1a3ab1 [LoRA][II] Add fused MOE LoRA Triton kernel and tests (#19711) 2026-03-18 19:58:14 -07:00
Liangsheng Yin 8b9482e665 fix(dp-attn): consistent overlap disable decision across DP ranks (#20853) 2026-03-18 15:16:39 -07:00