Commit Graph

238 Commits

Author SHA1 Message Date
laoyao0822
f50e2b1e00 Prevent stale CP shared-KV contracts from corrupting prefill
CP shared-KV now uses CP-local current rows consistently across MLA/index current reuse, passes fp8 current-index K through the tai-kernel uint8 ABI, and clears the transient EAGLE CP-local hidden marker after draft capture. The disaggregation bootstrap also fingerprints the runtime source contract so prefill/decode mismatches fail fast instead of silently exchanging incompatible KV metadata.

Constraint: CP shared-KV batch paths flatten current K/V rows in CP-rank-local valid order, not global request order.

Constraint: tai-kernel current-index prepare validates current_index_k as uint8 bytes for fp8 payloads.

Rejected: Keep using global extend offsets for bs>1 current-index reuse | corrupts request-local bases once current_index_kv is CP-local.

Rejected: Infer CP-local EAGLE hidden semantics from tensor shape | static padding and bs>1 can make shape-based inference unsafe.

Confidence: medium

Scope-risk: moderate

Directive: Do not reintroduce forward_batch.out_cache_loc slicing in CP shared-KV current reuse without verifying CP-local owner-lane layout.

Tested: Remote container py_compile for touched runtime/test files.

Tested: Remote PYTHONPATH=python pytest -q test/registered/unit/layers/test_nsa_cp_utils.py test/registered/unit/mem_cache/test_cp_shared_kv_runtime.py test/registered/unit/disaggregation/test_common_conn_runtime_fingerprint.py (198 passed, 2 subtests passed).

Not-tested: Full remote ETE traffic after this commit; accept length and garbage-output recovery still require a fresh prefill/decode run.

Co-authored-by: OmX <omx@oh-my-codex.dev>
2026-06-04 20:22:29 +08:00
laoyao0822
3d6007246b Stabilize CP shared-KV batch padding semantics
CP shared-KV bs>1 exposed three distinct padding domains: valid cache rows, CP page-tail compute rows, and MLP-sync flattened static padding. The previous implementation mixed these domains in direct-write and index top-k paths, so real requests failed when q/out_cache_loc lengths matched valid rows while metadata aliases described compute rows.\n\nThis change makes compute split strip only proven flattened static padding, keeps valid cache writes strict except for extend_num_tokens-proven static tails, marks CP-local EAGLE draft hidden state explicitly, and selects NSA index top-k query metadata by the actual q/weight row count.\n\nConstraint: CP shared-KV cache writes must never persist dummy page-tail or MLP static padding rows.\nConstraint: EAGLE draft hidden state can be CP-local before full CP metadata is visible in prepare_mlp_sync_batch.\nRejected: Use compute_padding_enabled as direct-write truncation proof | it silently accepts unknown out_cache_loc tails.\nRejected: Always consume compute q metadata in index top-k | actual q/weights can be valid-only after CP split.\nConfidence: medium\nScope-risk: moderate\nDirective: Do not collapse valid rows, CP compute padding, and MLP static padding into one length condition; use explicit provenance.\nTested: remote py_compile for touched NSA files\nTested: remote targeted CP shared-KV padding/top-k regressions\nTested: remote pytest test_nsa_cp_utils.py test_cp_shared_kv_layout.py test_cp_shared_kv_runtime.py -k 'not test_tai_current_slot_fill_sparse_page_self_test_passes_on_installed_kernel' => 228 passed, 1 deselected, 5 warnings, 2 subtests passed\nNot-tested: full ETE replay after the final index top-k fix\nNot-tested: TAI current-index fast path dtype fallback
2026-06-04 07:25:11 +08:00
laoyao0822
99b669f8b9 Reduce prefill EAGLE memory pressure under CP shared KV
Prefill CP only needs the local hidden shard for DeepSeek NextN draft extend. The change adds a draft shared-KV path that captures target hidden locally, feeds only the CP-local slice into the draft model, and keeps draft KV writes/transfers on the same shared logical-to-physical page mapping as target KV.\n\nDebug logs are gated behind SGLANG_CP_DRAFT_SHARED_KV_DEBUG and cover scheduler pool selection, KV manager buffer registration, local physical writes, prefill sender filtering, transfer pages, and decode commit metadata so ETE runs can prove draft KV is sharded rather than full-concatenated on a prefill rank.\n\nConstraint: Prefill runs CP while decode remains DP, so prefill must avoid full hidden/KV materialization but decode still receives full logical KV pages.\nRejected: Keep draft extend on full hidden state | preserves correctness but wastes prefill memory and defeats CP shared-KV intent.\nRejected: Transfer draft KV with a separate mapping | target and draft pools share req_to_token logical indices, so duplicating mapping adds risk without benefit.\nConfidence: medium\nScope-risk: moderate\nDirective: Do not remove the debug logs until ETE evidence confirms draft MLA/index writes and transfer pages are CP-sharded on all ranks.\nTested: Remote compileall for changed CP draft, transfer, scheduler, NSA index, MLA write, and EAGLE files.\nNot-tested: Full GLM-5 EAGLE ETE with SGLANG_CP_DRAFT_SHARED_KV_DEBUG=1 after this logging addition; local pytest intentionally not run.
2026-05-13 22:29:18 +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
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
kpham-sgl
6d160b42bb [Spec][Ngram] 1/N: Reference based Speculative Decoding refactor (#20393) 2026-03-22 00:55:10 -07:00
ehuaa
fa0d8f6629 perf: avoid unnecessary gpu-cpu sync in eagle_info (#20266)
Co-authored-by: root <qianhao@zhejianglab.org>
2026-03-19 19:37:29 -07:00
Jincong Chen
c77d7c629e [Bugfix] Fix MTP prefill cuda graph logging (#20279)
Co-authored-by: gemini-code-assist[bot] <176961590+gemini-code-assist[bot]@users.noreply.github.com>
2026-03-17 16:36:52 -07:00
Hubert Lu
67f02681c9 [AMD] Support speculative decoding v2 for aiter backend on ROCm/HIP (#17450)
Co-authored-by: kkHuang-amd <wunhuang@amd.com>
Co-authored-by: HaiShaw <hixiao@gmail.com>
2026-03-11 17:01:01 -07:00
Xuhao Zhang
57b093dc34 [NPU]MindSpore backend support eagle3 (#17098)
Co-authored-by: wangtiance <tiancew@qq.com>
Co-authored-by: Tiance Wang <wangtiance@gmail.com>
Co-authored-by: gemini-code-assist[bot] <176961590+gemini-code-assist[bot]@users.noreply.github.com>
Co-authored-by: ronnie_zheng <zl19940307@163.com>
2026-03-11 09:11:19 +03:00
Qiaolin Yu
09a118fafe Support return_logprob for spec v2 (overlap safe) (#19801)
Co-authored-by: Ratish1 <ratish1501@gmail.com>
Co-authored-by: Ratish1 <formula733@gmail.com>
Co-authored-by: hnyls2002 <lsyincs@gmail.com>
2026-03-10 15:38:27 -07:00
Junrong Lin
69158e9d9f [Bugfix] Skip _mamba_verify_update for idle batch (#20167) 2026-03-10 14:53:01 +08:00
Liangsheng Yin
ffb4b6f4c1 [Core] Replace server_args mutation hack with explicit MemoryPoolConfig for draft worker init (#20183) 2026-03-09 11:45:54 -07:00
sjqgogogogo
eb4ba1bde2 Feature/support longcat flash lite (#17838)
Co-authored-by: sunjiaqi11 <sunjiaqi11@meituan.com>
Co-authored-by: ispobock <ispobaoke@gmail.com>
2026-03-09 23:00:11 +08:00
shuwenn
72f6dfcc31 fix: add ModelScope cache lookup and speculative path support (#20098) 2026-03-07 22:23:16 -08:00
kpham-sgl
346a4131cf [Spec] Refactor NaN/OOB checks to async maybe_detect_* with env-var control (#19899)
Co-authored-by: hnyls2002 <lsyincs@gmail.com>
2026-03-05 13:51:05 -08:00
Chenxi Li
86c5617787 [BUG]: fix prevent illegal memory access in Mamba SSM tracking during EAGLE speculative verification (#19415)
Co-authored-by: ConnorLi96 <ConnorLi96@users.noreply.github.com>
2026-03-04 21:13:21 -08:00
hlu1
9457c049e1 [Qwen3.5] Enable MTP spec_v2 and add test for nvidia/Qwen3.5-397B-A17B-NVFP4 (#19391) 2026-03-04 14:01:25 -08:00
qwe
562c3ff2d0 [Feature] implement the standard multi-layer MTP for step3p5 (#18564)
Co-authored-by: mei ran <meiran0528@gmail.com>
Co-authored-by: yhyang201 <yhyang201@gmail.com>
2026-03-03 22:48:53 -08:00
zhangheng
e4b708d3e9 [Spec V2] Support specV2 for mamba hybrid attention (#18808)
Co-authored-by: Yi Zhong <207368749+vincentzed@users.noreply.github.com>
Co-authored-by: yizhang2077 <1109276519@qq.com>
Co-authored-by: Hanming Lu <hanming@x.ai>
2026-02-27 00:36:01 +08:00
Cheng Wan
6e54361608 Refactor CUDA graph input buffers with shared buffer pool (#19180) 2026-02-24 02:24:40 -08:00
Baizhou Zhang
2472e47d73 Revert "Refactor graph input buffers (#18991)" (#19173) 2026-02-23 13:09:54 +08:00
Cheng Wan
84c67c8be0 Refactor graph input buffers (#18991) 2026-02-20 18:09:31 -08:00
dongjiyingdjy
8b4c364960 refactor context parallel state (#17213)
Co-authored-by: Shunkang <182541032+Shunkangz@users.noreply.github.co>
2026-02-13 23:18:17 +08:00
ant-yy
d97eb111a3 Support LingV2_5 model (#18598)
Co-authored-by: zhangkaihong.zkh <zhangkaihong.zkh@antgroup.com>
Co-authored-by: 有禾 <zhangdonghao.zdh@antgroup.com>
Co-authored-by: yudian0504 <138860534+yudian0504@users.noreply.github.com>
Co-authored-by: 悠扬 <youyang.zmy@antgroup.com>
Co-authored-by: xinxingyang <xinxing.yangxx@antgroup.com>
Co-authored-by: zmy460290 <zmy460290@antgroup.com>
2026-02-13 16:09:15 +08:00
Liangsheng Yin
d29e331491 [Spec] Move forward timeout before verify to fix Eagle v1 filter mismatch (#18760) 2026-02-12 20:58:34 -08:00
Scott Lee
c59b9223e6 Add spec_accept_histogram request statistic (#18332) 2026-02-12 21:09:21 +08:00
Qiaolin Yu
4a1b50bb2d Fix idle batch predict dtype in spec v2 (#18379) 2026-02-10 10:29:13 +08:00
Zheng Li
27c447653d model: support Qwen3.5 (#18489)
Co-authored-by: 瑀澈 <yuche.lz@alibaba-inc.com>
2026-02-10 00:27:59 +08:00
Liangsheng Yin
875ad6cf35 Tiny rename for spec related fileds. (#18468) 2026-02-09 00:10:39 -08:00
Yingchun Lai
a1189068fa fix: fix the wrong return value type of draft model runner (#18105)
Co-authored-by: Liangsheng Yin <lsyincs@gmail.com>
2026-02-08 20:51:35 -08:00
Yuhao Yang
980d2936cd model: support Step-3.5-Flash (#18084)
Co-authored-by: ltd0924 <ltd0924@sina.com>
2026-02-03 00:40:07 +08:00
Siyuan Chen
578b119bc6 [BugFix] Fix server crashes when req.grammar and ngram spec are enabled (#17585) 2026-01-30 11:57:42 -08:00
Liangsheng Yin
85d077f44d Introduce global alloc_len_per_decode & clean check decode memory (#15115) 2026-01-26 10:26:20 -08:00
Ke Bao
ce8a6ac690 Evict swa kv cache during decoding (#17220) 2026-01-19 22:36:52 +08:00
YAMY
a45e0e5df4 [SPEC_V2] Enable cudagraph draft_extend for trtllm_mla_backend and Acclen Fix for DP under cudagraph mode (#16974) 2026-01-18 15:56:21 +08:00
Ke Bao
7f8a58fffb Refactor prefix cache type checking (#17028) 2026-01-15 11:28:13 +08:00
chenxu214
53dca74f47 Bugfix: EagleDraftWorker has not attribute "eagle_use_aux_hidden_state" (#16480) 2026-01-12 20:14:35 +08:00
chenxu140
38a88479c6 llama model and llama eagle3 model support dp-attn (#15268) 2026-01-12 08:54:56 +08:00
Liangsheng Yin
75da784d48 Tiny simplify draft worker init. (#16446) 2026-01-09 11:20:29 +08:00
Lianmin Zheng
fb04e7e3c8 [Auto Sync] Update schedule_batch.py, common.py, eagle_info... (20260105) (#16519)
Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
Co-authored-by: cctry <shiyang@x.ai>
2026-01-08 02:35:46 -08:00
YAMY
12cde0df99 [SPEC_V2] Fix Acclen drop when enabling DP Attention for Spec-Overlap (#16310) 2026-01-05 11:39:23 +08:00
Izzy Putterman
3dfff6ae3c Eagle: GPT-OSS Eagle v2 support (#14920)
Signed-off-by: Izzy Putterman <iputterman@nvidia.com>
2025-12-30 14:23:07 -08:00
Liangsheng Yin
ba67e006a7 Refactor speculative algorithm registry. (#16168) 2025-12-31 01:24:22 +08:00
Gaoji Liu
7518dc3532 feat(SpecEagleV2): add standalone_worker_v2 (#12625)
Co-authored-by: liugaoji.lgj <liugaoji.lgj@alibaba-inc.com>
2025-12-30 17:55:04 +08:00
Liangsheng Yin
be3828a13b Tiny cleanup duplicate code for multi-layer eagle worker. (#16004) 2025-12-28 18:08:20 +08:00
Ke Bao
7b7e357f61 Separate swa and local attention chunk cache eviction (#15820) 2025-12-26 09:34:22 +08:00
Liangsheng Yin
cb719c74ad [2/N] clean duplicate code of logprob processing in spec. (#15593) 2025-12-24 15:21:13 +08:00
Liangsheng Yin
3c882db3ad Adjust wrong mtp meaning introduce by mimo (#15632)
Co-authored-by: gemini-code-assist[bot] <176961590+gemini-code-assist[bot]@users.noreply.github.com>
2025-12-23 02:06:46 +08:00
Liangsheng Yin
8766a1dd24 [1 / N] Clean up logprob utils (#15509) 2025-12-22 03:12:25 +08:00