Commit Graph
10929 Commits
Author SHA1 Message Date
Cheng Wan b8109b5d63 config: retire the last process-global config field reads (#33338)
`get_server_args().<field>` reads one process's startup record. Nine sites still
did that for a value that has a namespace: the attention backend (5),
`skip_tokenizer_init` (2), the draft-aware `load_format`, and a chunked-prefill
size in `sglang.kernels`. They now read `get_exec().kernel` / `get_serving()` /
`get_model()` / `get_schedule()`, so they see the resolved value including
post-publish overrides.

The multimodal processor's device selection moves to the instance it was
constructed with rather than to a namespace: `base_gpu_id` differs per worker (the
encode-server DP workers each specialise their own copy), so no process-global
value can stand in for it, and engines sharing a tokenizer process each need their
own. Branch order, the NPU preprocess patches, and the case that leaves "device"
unset are unchanged.

What stays on `get_server_args()` is the derived API — `@property` and method
members computed from several fields plus the HF config
(`mamba_cache_chunk_size`, `get_model_config()`, `enable_mamba_extra_buffer*`) —
plus three config-intent reads of live-shadowed sizes, each of which needs an
answer the live topology property cannot give (the DSA indexer's PP gate must
short-circuit before touching the PP group, `allocation`'s DCP gate asks whether
DCP was configured at all, and the CUDA-IPC recycler runs where no group exists).

A new AST ratchet pins both shapes it can see — the direct call and an alias
bound from it in the same function — at 0 and 12 respectively, exempting the
derived APIs and those three sites by name. The alias-form baseline is not zero:
those reads are mostly per-runner fields in model code, and lowering them is the
next slice.

Two fixtures stopped faking config: `test_dllm_fdfo_kv_reuse` rebound
`allocation.get_server_args` to a SimpleNamespace, which silently stops
intercepting the moment a reader migrates; it publishes a real config instead.
2026-08-02 21:24:42 -07:00
Cheng Wan aa3bbbc6e8 observability: publish the generated forward-pass-metrics endpoint to the bags (#33337)
When --forward-pass-metrics-ipc-name is left unset the reporter generates an
endpoint and has to hand it to external consumers (the documented contract is
that they read it back from the server config). That readback is the scheduler's
get_internal_state, which already reports get_context().resolved_server_args_dict(),
so the write moves to get_context().override and the read alongside it to
get_observability() — the endpoint still shows up in /server_info's
internal_states, and the ServerArgs instance stops being a message bus.

The test's server_args stand-in (a SimpleNamespace with a hand-rolled override)
becomes a real published config, so the reporter exercises the same accessors as
production.

Writer ratchet 19 -> 18.
2026-08-02 21:24:11 -07:00
Cheng Wan 0b3e8bedd1 config: keep runtime hicache and weight-version updates off ServerArgs (#33336)
The scheduler's runtime HiCache attach/detach wrote its own ServerArgs so the
internal-state readback would show the change; that readback already reports
the resolved config, so the writes become get_context().override(...) and the
namespace readers see them too.

The tokenizer side is per-engine — several Engines can share one process — so
its control-plane updates (weight version, model path + load format, HiCache
attach/detach) stay with the manager instead of moving to the process-global
bags. TokenizerManager gains record_config_updates / config_value /
resolved_config_dict, and the readbacks that used to observe the instance write
(/server_info, /model_info, the HiCache status endpoint, the gRPC bridge) now
overlay those updates onto the startup config.

test_server_info's stub grew the real manager instead of a SimpleNamespace, so
the overlay it now exercises cannot drift from production.

Writer ratchet 26 -> 19.
2026-08-02 21:23:38 -07:00
Cheng Wan 9bc8848fcf spec: build every draft worker from a draft ServerArgs copy (#33335)
EAGLEWorkerV2, StandaloneWorkerV2, MultiLayerEagleWorkerV2 and
FrozenKVMTPWorkerV2 wrote the draft's context_length onto the ServerArgs
instance they share with the target worker, and the scheduler wrote the draft's
load_format onto that same object just before creating them. The target's config
carried draft values from then on, and anything constructed later in the process
inherited them.

Scheduler.maybe_init_draft_worker now makes one draft copy through
draft_server_args_copy() and hands it to both the worker factory and the worker,
so every algorithm gets it — the four built-ins, dflash/dspark (which deepcopy
it again inside build_draft_tp_worker), and anything registered through
SpeculativeAlgorithm.register. The copy starts from the config the process
resolved, not from the pristine seed, so load-time overrides made before this
point (the chunked-prefix gate, the SM100 GDN prefill default) are part of what
the draft sees; context_length and load_format are applied on top.

The construction runs under a preserved publish of that copy, the shape
build_draft_tp_worker already used. Weight loading reads the bags rather than the
instance it was handed — Inkling's ModelOpt scale normalization keys on
load_format — so the draft has to be built with its own config published, and
the target's is back in the slot when construction returns.

The EAGLE hot-token-map write is deleted, not moved. init_token_map runs from
alloc_memory_pool, long after the draft's TpModelWorker built its ModelConfig,
and hot_vocab_size is only ever read off model_config.hf_config, which
json_model_override_args reaches at ModelConfig construction. The write could not
affect the draft model; only the shared instance saw it. hot_token_id is
unchanged, so a draft checkpoint that declares hot_vocab_size behaves as before.

Tests: draft_server_args_copy carries the target context_length, a configured
draft load_format and any load-time override while leaving the target's instance
alone; and the scheduler handoff pins that the factory and the worker both
receive the copy, that the copy is the published config during construction, and
that the target's is restored afterwards.

Writer ratchet 31 -> 26.
2026-08-02 21:22:52 -07:00
Cheng Wan ebb1c88d23 config: stop writing config onto the published ServerArgs at three sites (#33334)
Each of these wrote a value after resolution so a later reader would find it on
the instance. None of them needed the instance: one write was redundant, and the
two that carry a value the resolved-config readback reports move to
get_context().override, which the readback overlays.

- The SM100 GDN prefill default was written onto ServerArgs and read back one
  line later by initialize_linear_attn_config. It is now the return value of
  flashinfer_gdn_prefill_default, threaded into initialize_linear_attn_config
  (an explicit --linear-attn-prefill-backend still wins) and recorded with
  get_context().override so /server_info reports the backend in effect.
- The XGrammar fallback recorded grammar_backend="none" on the instance. No code
  reads the field after the factory reads it once, but get_internal_state
  reports the whole resolved config, so the fallback now lands there instead:
  the readback tells the truth and the seed keeps the requested backend.
- UnifiedRadixCache.init_hicache re-applied the direct-IO layout fixup that
  __post_init__ already applies: init_hicache only runs when hierarchical cache
  is on, which is exactly when _handle_hicache normalizes page_first to
  page_first_direct (pinned by test_hicache_io_backend_and_mem_layout_
  compatibility::direct_with_page_first). Three fixtures reached the fixup by
  building ServerArgs(model_path="dummy"), whose resolution is skipped, so they
  now declare the layout resolution would have produced.

Writer ratchet 34 -> 31.
2026-08-02 21:22:05 -07:00
Baizhou Zhang e824b24250 [CP] Fuse zigzag attention into a single call (#33137) 2026-08-02 20:46:42 -07:00
Mark 741e33db81 fix(sampling): reject conflicting structural tag constraints (#32525) 2026-08-02 20:24:55 -07:00
Liangsheng YinandMick dd6ddc053b [Fix] Drop deprecated multimodal processor residency state (#33308)
Co-authored-by: Mick <mickjagger19@icloud.com>
2026-08-02 20:02:53 -07:00
28a2472f95 [DeepSeek-V4] Fix nvcc 13 crash building the topk_v2 kernel (#32910)
Co-authored-by: guptaishaan <guptaishaan@users.noreply.github.com>
Co-authored-by: Xiaoyu Zhang <1182563586@qq.com>
2026-08-03 10:59:42 +08:00
Liangsheng YinandMick 4bc593fdc8 [Perf] Broadcast single-image DP vision embedding instead of pad-to-max all-gather (#33307)
Co-authored-by: Mick <mickjagger19@icloud.com>
2026-08-02 19:39:53 -07:00
Liangsheng Yin 2a7a299c27 [Spec] Support sampling in the DSPARK graph-folded draft proposal (#33298) 2026-08-02 18:46:39 -07:00
5d2dbb35a6 [rust-server] PD disaggregation support (#33125)
Co-authored-by: Claude Fable 5 <noreply@anthropic.com>
Co-authored-by: Cursor <cursoragent@cursor.com>
Co-authored-by: Rain Jiang <rain-jiang@outlook.com>
2026-08-02 18:32:59 -07:00
Rain JiangandKan Wu c844244da5 support dp attn with client lb (#33105)
Co-authored-by: Kan Wu <wukanustc@gmail.com>
2026-08-02 18:32:35 -07:00
kangwangamd 12eadf86f1 [AMD] Enable mamba JIT transfer kernel on ROCm (fix transfer_kv_mamba NameError) (#31741) 2026-08-02 16:40:17 -07:00
Cheng Wan 88e5a0f635 test: stand up the config tiers two unit tests read from (#33294) 2026-08-02 15:46:34 -07:00
Yuwei AnandClaude Opus 5 8cc941a672 [BCG][4/N] Enable bcg on megamoe & flashinfer a2a backend (#33150)
Co-authored-by: Claude Opus 5 (1M context) <noreply@anthropic.com>
2026-08-02 14:56:03 -07:00
Mohammad Miadh Angkad ec741e4161 Fix DSpark loading for hybrid DSV4 NVFP4 (#33276) 2026-08-02 18:05:09 +00:00
Yuwei AnandClaude Opus 5 1a3bea77f2 [Feat] DCP + HiCache L2 Support (ported from kimi-k3) (#33112)
Co-authored-by: Claude Opus 5 (1M context) <noreply@anthropic.com>
2026-08-02 23:35:27 +08:00
f8e62a9224 [NPU] Add PR test cases (#32392)
Co-authored-by: Claude <noreply@anthropic.com>
Co-authored-by: sglang-npu-bot <sglangnpu@163.com>
2026-08-02 23:00:02 +08:00
70fe2e0dd5 [diffusion] model: support minimax-h3 (#33275)
Co-authored-by: zhenaozhenfu <zhenaozhenfu@minimaxi.com>
Co-authored-by: BBuf <1182563586@qq.com>
Co-authored-by: andyluo7 <andy.luo@amd.com>
Co-authored-by: Zijie Xia <zijie_xia@icloud.com>
Co-authored-by: Claude Fable 5 <noreply@anthropic.com>
Co-authored-by: chao-xue <877184285@qq.com>
Co-authored-by: Cursor <cursoragent@cursor.com>
2026-08-02 22:32:37 +08:00
Liangsheng Yin 558c9bdcc2 [misc] Improve benchmark determinism and dataset API coverage (#33255) 2026-08-02 01:39:50 -07:00
Alison Shao 43be25b2b7 [CI] Graceful teardown for kv_canary and EAGLE spec fixtures (#32829) 2026-08-02 01:09:59 -07:00
8d106c3d79 [NPU] Enable automatic ascend_attn selection for vision attention and graph runners (#31948)
Co-authored-by: litao.dream <litao.dream@bytedance.com>
Co-authored-by: Xinyuan Tong <xinyuantong.cs@gmail.com>
2026-08-02 15:09:51 +08:00
Tao Liandlitao.dream a0b7bcf592 [Feature] Support return_hidden_states="last" (#30177)
Co-authored-by: litao.dream <litao.dream@bytedance.com>
2026-08-02 15:09:33 +08:00
sonle5 1685d29f21 [AMD] Fix DeepSeek-V4 fused-RMS FP8 scale metadata on gfx950 (#31727) 2026-08-02 00:06:09 -07:00
Bingxu Chen 37be4e9247 [AMD] Speed up DSV4 MoE weight loading from mmap views (#32315) 2026-08-01 23:47:47 -07:00
Thomas Wang 7e509f690e [AMD] Fix DeepSeek-V4 FP4 MoE expert memory bloat (#31450)
AITER specific
2026-08-01 23:42:21 -07:00
056474cdb0 feat: Session-reference-aware Unified Radix Cache for agentic multi-turn workloads (#29173)
Co-authored-by: Ishan Dhanani <ishandhanani@gmail.com>
Co-authored-by: hzh0425 <hzh0425@apache.org>
Co-authored-by: ispobock <ispobaoke@gmail.com>
2026-08-02 13:43:55 +08:00
131bd51b01 [Spec] Add trtllm_mha support for Gemma 4 MTP draft attention backend (#25545)
Co-authored-by: Cursor <cursoragent@cursor.com>
Co-authored-by: Claude Opus 5 (1M context) <noreply@anthropic.com>
2026-08-01 16:16:04 -07:00
e2cf21b9e5 [Kimi K3] Add reasoning, tool-call, and OpenAI serving support (#33025)
Co-authored-by: hnyls2002 <lsyincs@gmail.com>
Co-authored-by: Liangsheng Yin <hnyls2002@gmail.com>
Co-authored-by: A-transformer <cl5743590921@gmail.com>
2026-08-01 14:57:23 -07:00
Zhangheng f1b41a5b3d [CP]: FIx some issue for glm5.2 cp v2 (#33100) 2026-08-01 13:50:10 -07:00
Brayden Zhong e0ba311026 Disable breakable CUDA graph for NemotronH (#33130) 2026-08-01 20:48:58 +00:00
Jackey HuaandClaude Opus 5 00a219f6c9 [Quant] Keep the flashinfer_deepgemm FP8 GEMM to 1 <= M < 32 (#32843)
Co-authored-by: Claude Opus 5 <noreply@anthropic.com>
2026-08-02 00:36:13 +08:00
Cheng Wan 7071cfb873 runtime_context: per-role namespace enforcement behind SGLANG_ROLE_NAMESPACES (#33172)
publish(role=...) has recorded provenance since the namespace split; this
wires the enforcement the role was reserved for. SGLANG_ROLE_NAMESPACES
selects the mode:

- off (default): no bookkeeping; the mode gate in config_bag stays a
  dead-branch-prunable check under dynamo (bag reads run inside compiled
  forwards — pinned by a fullgraph test).
- record: audit mode — collect (role, namespace) pairs per process and
  persist each new pair immediately to SGLANG_ROLE_NAMESPACES_OUT (worker
  teardown skips atexit), plus a per-process stderr summary at exit.
- enforce: a bag read outside the role's ROLE_NAMESPACE_SETS entry fails
  closed with an actionable error; None entries mean full tree.

Sets are filled only where audits back them: dp_controller reads only
exec (record-mode plain + DP-attention smokes agree with the module's
static read set — the elastic-EP gate). tokenizer observed zero bag
reads (per-instance managers read self.server_args by design) but keeps
the full tree until the multi-tokenizer disagg shape (TokenizerWorker's
get_disagg read) is audited; encoder / expert_backup /
weight_cache_daemon likewise await their deployment shapes.

Verified end-to-end: DP-attention smoke under enforce boots and serves
with zero violations.
2026-08-01 08:59:49 -07:00
Cheng Wan 47d8b5b749 config: route parallel config-leaf reads through get_parallel() (#33170)
The parallel namespace joins the accessor migration: 106 config-leaf reads
(enable_dp_lm_head, enable_dp_attention, pp_async_batch_depth, dp_size,
ep_join_rank_offset, dwdp_size, ...) flip from get_server_args()/
self.server_args to get_parallel(), which serves config leaves from the
published parallel bag via __getattr__.

- ParallelContext.__getattr__ is restructured to stay dynamo-traceable
  (object.__getattribute__ graph-breaks): gate helpers such as
  enable_moe_dense_fully_dp() run inside compiled model forwards. A
  fullgraph regression test pins the pattern.
- The five live-shadowed topology sizes (tp/pp/dcp/attn_cp/moe_dp_size)
  keep their server_args reads: the live @property wins on the accessor,
  and conditionally-initialized groups would fail loud at unconditional
  call sites.
- Elastic-EP scale writers (ep_size/dp_size x4 in model_runner) reroute
  to get_context().override together with their remaining instance
  readers (expert_location gpus-per-node paths); the ServerArgs.override
  ratchet drops 39 -> 35.
- The expert placement helpers (compute_logical_to_rank_dispatch_
  physical_map, _compute_logical_to_all_physical_map,
  _prefer_same_node_experts) now read everything from the bags and drop
  their server_args parameter; their unit tests publish the config they
  need instead of stubbing it.
2026-08-01 08:58:39 -07:00
Cheng Wan df55e911d6 Fix the chunked-prefix-cache gate writing config the backends never read (#33168)
The load-time gate (maybe_disable_chunked_prefix_cache) wrote its
ServerArgs instance while every reader has moved to the published
config: the attention backends assert / branch on
get_schedule().disable_chunked_prefix_cache when they initialize, so the
flip never reached them and a backend outside
CHUNKED_PREFIX_CACHE_SUPPORTED_ATTENTION_BACKENDS kept chunked prefix
enabled.

Reroute the writer through get_context().override (which writes the
published bags) and flip the two remaining instance reads — the gate's
own log check and the prefill cuda-graph runner's capture flag — to the
bag. A regression test pins the three contracts: the gate lands on the
bag, the pristine ServerArgs instance stays untouched, and the
draft-worker guard never writes.

The ServerArgs.override call-site ratchet drops 39 -> 38.
2026-08-01 08:57:28 -07:00
JemmaFan 2fd78ec2d7 [AMD] Derive AITER verify tokens-per-req from input shape (#31221) 2026-08-01 00:29:25 -07:00
33ecf4bcd8 Add pr tests (#31952)
Co-authored-by: Claude <noreply@anthropic.com>
Co-authored-by: sglang-npu-bot <sglangnpu@163.com>
Co-authored-by: Cherry_ming <136634645@qq.com>
2026-08-01 15:03:21 +08:00
Sugar920 fd96a35fb0 add NPU GSM8K accuracy tests for 7 models (#32649) 2026-08-01 14:22:57 +08:00
Mohammad Miadh Angkadandhnyls2002 c0d06a6547 [CI] Fix runtime context setup in flat logprob tests (#33179)
Co-authored-by: hnyls2002 <lsyincs@gmail.com>
2026-07-31 22:46:24 -07:00
fb207b72b0 feat(kernels): port standalone Kimi K3 kernels (#32890)
Co-authored-by: Claude Opus 5 <noreply@anthropic.com>
Co-authored-by: hnyls2002 <lsyincs@gmail.com>
Co-authored-by: zhangxiaolei <zhangxiaolei.666@bytedance.com>
2026-08-01 13:26:47 +08:00
jacky.cheng 0d186f49be [AMD][Fix] Restore aiter-padded MoE weight dims for serialized checkpoints (#33090)
AMD only change
2026-07-31 22:09:37 -07:00
bae8eb8d6c [minimax-m3] fp8 attention GEMMs on SM100 (fp8_e4m3 KV + trtllm_mha) (#30971)
Co-authored-by: qiuyue <qiuyue@minimaxi.com>
Co-authored-by: xuebi <xuebi@minimaxi.com>
Co-authored-by: Xiaoyu Zhang <1182563586@qq.com>
2026-08-01 09:39:52 +08:00
Andrew Tulloch e6a4cefc69 perf(startup): skip unused PyTorch headers for KV VMM allocator stub (#33126) 2026-07-31 18:32:36 -07:00
Cheng Wan 934a13ce3e [Inkling] Hold the short-conv per-step state on one metadata struct (#33116) 2026-07-31 18:11:35 -07:00
Sam Shleifer 58974ca16c [perf] Assemble flat prompt top logprobs scheduler-side as numpy arrays (#32223) 2026-07-31 18:00:51 -07:00
Liangsheng Yin ca07917c58 [Fix] Bound FULL_MASK verify-mask reuse by the captured max_bs (#33127) 2026-07-31 17:50:40 -07:00
Khoa Pham 1496bfee93 [Kimi] Support DCP + DSpark (ported from kimi-k3 branch) (#32828) 2026-07-31 17:39:00 -07:00
Yuwei AnandClaude Fable 5 3e0f7c3f30 [BCG][3/N] Enable bcg on dsa & deepep a2a backend (#31987)
Co-authored-by: Claude Fable 5 <noreply@anthropic.com>
2026-07-31 16:45:18 -07:00
Ethan (Yusheng) Su 3c5f115741 Split #32584 into 2/2: [LoRA] Shard attention LoRA by attn-TP and allow dynamic LoRA with dp attention (#32708) 2026-07-31 15:37:13 -07:00