Commit Graph

10888 Commits

Author SHA1 Message Date
laoyao0822
5af232e9de Define the current-reuse boundary for shared KV Phase 3
Phase 2 expanded prefill CP persistent KV capacity by sharding KV at rest, but its compatibility runtime can still rebuild full-view KV/index buffers from sharded storage. This documents a narrower Phase 3 target: reuse current chunk KV/index that was already CP all-gathered and reranged, while leaving deeper history shard-aware work to Phase 4.

The new plan separates current-only and mixed current/history cases, defines fallback requirements to the Phase 2 full-view compatibility path, and records validation criteria before any runtime implementation starts.

Constraint: Phase 3 must reduce avoidable duplicate materialization without rewriting NSA topk or sparse attention kernels
Constraint: History KV/index access remains Phase 2 compatibility materialization until Phase 4
Rejected: Start with shard-aware topk/distributed attention | too broad for Phase 3 and harder to validate against the current Phase 2 baseline
Rejected: Remove all shared-KV runtime materialization immediately | history/prefix/chunked-prefill paths still need a compatibility fallback
Confidence: high
Scope-risk: narrow
Directive: Keep Phase 3 scoped to current chunk reuse; put selected-history and shard-aware algorithms in Phase 4 unless the design is explicitly revised
Tested: git diff --check for the two documentation files
Not-tested: Runtime behavior; documentation-only change
2026-04-26 05:57:33 +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
laoyao0822
76c830dda8 docs(cp): plan NSA prefill CP shared KV phase2 2026-04-24 16:31:03 +08:00
laoyao0822
7cc4e2dee8 docs(cp): design NSA prefill CP shared KV phase2 2026-04-24 06:06:31 +08:00
laoyao0822
e7a8c4b52f docs(cp): add NSA prefill CP dual all-gather explanation and Phase 1 plan
- nsa_prefill_cp_all_gather.md: explains why there are two all-gathers
  in current NSA prefill CP (per-layer KV/index gather vs tail output
  hidden gather), with data flow diagrams and involved file lists
- nsa_prefill_cp_phase1_narrow_output_collection.md: detailed Phase 1
  design plan covering batch-level eligibility, fallback conditions,
  affected modules, KV transfer impact, risks, and test matrix
2026-04-22 04:55:15 +08:00
laoyao0822
bc9a9f128b perf(cp): add narrow output collection for NSA prefill CP
Replace full hidden all-gather at prefill tail with per-request last-token
hidden collection, reducing communication from total_tokens x hidden_size
to cp_size x bs x hidden_size for both in-seq-split and round-robin modes.

- nsa/utils.py: add cp_collect_last_token_hidden() with mode-specific
  narrow collection helpers that only gather the last token hidden
- deepseek_v2.py: add _should_use_narrow_output_path() gate on
  DeepseekV2Model, fallback to full gather for EAGLE/return_logprob/
  capture_hidden batches
- logits_processor.py: add _is_compact_hidden_states() to bypass
  _get_pruned_states() when hidden is already compact
2026-04-22 04:55:06 +08:00
laoyao0822
7403f14511 feat(kernel): add quanted silu fusion kernel 2026-04-19 04:23:53 +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
a371eacd86 fix(deepgemm): add nsa init in deepgemm init 2026-04-19 04:23:48 +08:00
laoyao0822
d9b6e90b35 fix(dp_ctrl): fix imbalanced DP rank assignment
1. feat:update total tokens immediately

fea:record request in da controller local
2026-04-09 01:37:13 +08:00
laoyao0822
cc11cac77c fix(b_overlap): single batch overlap dim not match 2026-04-09 01:37:13 +08:00
laoyao0822
6efa9b4350 fix(disaggregation): check_status not found case crackdown 2026-04-09 01:37:13 +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
laoyao0822
101100e25b feat(eplb): add eplb warmup-only mode
Freeze expert layout after the initial EPLB warmup rebalances so heavy workloads avoid recurring rebalance memory spikes and OOMs.
2026-04-08 06:46:26 +08:00
laoyao0822
d5ec233834 feat(mtp): add tbo mtp support 2026-04-08 06:45:27 +08:00
laoyao0822
1c04d6078b feat(token_limit): limit input token < 131072
4.max_tokens=131072,input<131072时不报错
5. 输入长度超过131072时,报错,且报错内容含有以下字符串,以便被网关识别
"is longer than the model's context length"
2026-04-08 06:34:03 +08:00
laoyao0822
7c524ccacc feat(tool_call): changed return type of tool_call
Update the tool call response format so that all non-first chunks in a tool call have type: null.
2026-04-08 06:27:12 +08:00
laoyao0822
9b5ecc8c1f feat(drain): graceful shutdown and admin drain
feat: add admin drain to sglang
2026-04-08 06:13:42 +08:00
laoyao0822
150d4db41d feat(scheduler): support scheduler recv skip in dp 2026-04-08 06:10:42 +08:00
663459d2ef feat(deepgemm): deepgemm jit and init in model_runner
1. fix and tune deepgemm
2026-04-08 06:05:06 +08:00
2ae0237d3e fix(deepep): tuning and enhance deepep on single node
feat(deepep): enhance single node deepep
2026-04-08 05:36:31 +08:00
e72880b467 feat(eplb): add eplb warmup 2026-04-08 05:21:54 +08:00
XDaoHong
2d288ba8c9 [Bugfix] fix npu get kv_item_lens in PD separation when use ASCEND_US… (#15852)
Co-authored-by: ZhengdQin <zhengdqin@gmail.com>
2026-03-23 15:56:47 +08:00
kpham-sgl
59cb9a9da6 [Spec][Ngram] 3/N: Fix synchronization issues in Ngram.cpp (#21186)
Co-authored-by: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-23 00:37:07 -07:00
Lianmin Zheng
814202704b ci: unify PR test suite naming (#21187) 2026-03-23 00:18:45 -07:00
yudian0504
3d312643b9 [BUGFIX] Fix CP residual size mismatch crash when tp_size == attn_cp_size (#21170) 2026-03-23 00:12:58 -07:00
Lianmin Zheng
7757a9ddd0 ci: remove IS_BLACKWELL env var; auto-detect Blackwell (#21118) 2026-03-22 23:44:48 -07:00
Even Zhou
54fdb357d3 [CI][NPU] Fix git report dubious ownership (#21162) 2026-03-23 14:36:35 +08:00
kpham-sgl
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
Cheng Wan
d6b12c401c Revert "[bugfix] Fix PPMissingLayer AttributeError when Using PP" (#21189) 2026-03-22 23:28:36 -07:00
Zhiqiang Xie
13f4f010d8 HiSparse for Sparse Attention (#20343) 2026-03-22 23:09:31 -07:00
Alison Shao
44db0c59cf [CI] Fix cutlass import error: restore nvidia-cutlass-dsl force-reinstall (#21182)
Co-authored-by: Alison Shao <alison.shao@mac.lan>
2026-03-22 22:41:01 -07:00
Lianmin Zheng
7050011dee Enable JIT clamp_position and resolve_future_token_ids on ROCm (#21116) 2026-03-22 22:33:54 -07:00
Yuhao Yang
32a85ef128 [diffusion] CI: auto-skip diffusion tests when required pipeline class is missing from diffusers (#21139) 2026-03-23 12:15:21 +08:00
Shangming Cai
a094eb9c21 Temporarily disable flaky qwen3 cp test in CI (#21178) 2026-03-22 21:13:52 -07:00
Mohammad Miadh Angkad
d8a5b1dbaf [Bugfix] Work around FlashInfer unified transport issue on GB (#20039) 2026-03-22 21:10:25 -07:00
Xiaoyu Zhang
a94d67d44b [SKILL] fix(bench): Support model-specific DenoisingStage variants in… (#21137) 2026-03-23 12:08:00 +08: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
yuumn
889e8489e9 [diffusion] model: support FireRed-Image-Edit (#20862)
Co-authored-by: yuumn <1010797597@qqã.com>
2026-03-23 10:27:07 +08:00
Cishoon
999bad5aba Fix VRAM leak in overlap scheduling with structured output (#20640) (#20697) 2026-03-22 17:07:39 -07:00
Yilong Zhao
343998865a perf: pad max-num-requests in decode cuda graph for higher coverage (#20978) 2026-03-22 17:06:16 -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
Xiaoyu Zhang
c1fe5de69c [Diffusion] Clean up diffusion Triton kernels and modernize custom op registration (#21122)
Co-authored-by: gemini-code-assist[bot] <176961590+gemini-code-assist[bot]@users.noreply.github.com>
2026-03-22 22:38:57 +08:00
Ke Bao
2406ddfdb8 Add ut guide to test skills (#21130) 2026-03-22 20:55:37 +08:00
Brayden Zhong
009eee85a0 CUTLASS FP8 Blockwise GEMM improvement of SM120 (#20887) 2026-03-22 17:55:54 +08:00