Repository navigation
Bump version to 0.1.6 - #68
Merged
Merged
Conversation
5 tasks done
timethink
pushed a commit
to timethink/sglang
that referenced
this pull request
Mar 9, 2025
NorthmanPKU
pushed a commit
to NorthmanPKU/sglang
that referenced
this pull request
May 16, 2025
…quired. (sgl-project#68) * Include headers into package tu support JIT * Update INSTALL.md
pi314ever
pushed a commit
to pi314ever/sglang
that referenced
this pull request
Jul 10, 2025
* warmup time addition in throughput log warmup time is stored in hpu_graph_runner and logged by accessing scheduler's internal state * Fix print Correct the warmup time being printed twice * Fix print Correct the warmup time being printed twice
key4ng
pushed a commit
to key4ng/sglang
that referenced
this pull request
Nov 9, 2025
apinge
referenced
this pull request
in apinge/sglang
Dec 9, 2025
[Feature] [ROCM] integrate hipblas bf16 gemm kernel for VIT
vschandramourya
pushed a commit
to vschandramourya/sglang
that referenced
this pull request
Feb 3, 2026
* feat: enable dsv3 fp4 ut * upd * upd * upd * upd * upd * upd * upd * upd * upd * upd
xq25478
pushed a commit
to xq25478/sglang
that referenced
this pull request
Apr 3, 2026
* chore: cleanup * Merge branches 'RemoteSpec-v057','RemoteSpec-v057-dev-yw' into 'RemoteSpec-v057-dev-yw' * feat & perf: wait & pre-verify * fix(cpp zmq) * fix: resolve memory leak for prefix caching requests in Draft mode (sgl-project#64) * chore: debug some log * chore: correct log in draft * feat: add retry_fail_ratio arg to control the trigger of retry * perf: zmq pack send/recv @zhangyu * fix(zmq):添加 ZMQ 链路耗时分析 * perf: skip req.origin_input_ids send when spec_cnt > 0 * perf: only send req.sampling_params when spec_cnt = 0 to reduce transfer time * perf: pre-verify wait logic add. * perf: adjust draft sleep time when recv draft tokens * perf: let draft recv full batch * chore: adjust time cnt * chore: add some time count log * perf: Target optimize * perf: wait for draft tokens & add DraftCircuitBreaker * fix: adjust first token in first pad token position * perf: optimize 2 step verify logic * perf: optimize tensor init
efschu
added a commit
to efschu/htsglang
that referenced
this pull request
Jul 18, 2026
…rve default (sgl-project#95) All 4 errors were red at the base commit: sgl-project#68 changed the --rank-auto-reserve-mib default from the flat 2048 MiB to the demand-derived 'auto' sentinel without updating this test. - test_defaults now asserts the 'auto' sentinel (ServerArgs.AUTO_RANK_MEMORY_RESERVE_MIB) instead of int(...) == 2048. - The three TestAutoRatio arithmetic tests pin rank_auto_reserve_mib=2048 explicitly: their documented budget math (min(total - 2048, free - 1024)) is exact and device-independent that way, while the 'auto' default would route through the capacity-tier derivation (which needs the device capacity and cuda_graph_config the short-circuited ServerArgs stub lacks). - New test_auto_reserve_auto_derives_from_demand completes the stub for the 'auto' path (real default CudaGraphConfig, mocked get_device_memory_capacity, capture term disabled) and asserts the wiring: budgets == min(total - derived_rank_auto_reserve_mib(...), free - 1024), uniform cards still collapse to the even split. No production code touched; the auto-derive path behaves correctly on a minimal ServerArgs once the stub is complete. File green: 63/63 (was 59/63 at base).
efschu
added a commit
to efschu/htsglang
that referenced
this pull request
Jul 18, 2026
…rve default (sgl-project#95) All 4 errors were red at the base commit: sgl-project#68 changed the --rank-auto-reserve-mib default from the flat 2048 MiB to the demand-derived 'auto' sentinel without updating this test. - test_defaults now asserts the 'auto' sentinel (ServerArgs.AUTO_RANK_MEMORY_RESERVE_MIB) instead of int(...) == 2048. - The three TestAutoRatio arithmetic tests pin rank_auto_reserve_mib=2048 explicitly: their documented budget math (min(total - 2048, free - 1024)) is exact and device-independent that way, while the 'auto' default would route through the capacity-tier derivation (which needs the device capacity and cuda_graph_config the short-circuited ServerArgs stub lacks). - New test_auto_reserve_auto_derives_from_demand completes the stub for the 'auto' path (real default CudaGraphConfig, mocked get_device_memory_capacity, capture term disabled) and asserts the wiring: budgets == min(total - derived_rank_auto_reserve_mib(...), free - 1024), uniform cards still collapse to the even split. No production code touched; the auto-derive path behaves correctly on a minimal ServerArgs once the stub is complete. File green: 63/63 (was 59/63 at base).
efschu
added a commit
to efschu/htsglang
that referenced
this pull request
Jul 22, 2026
Measures from the sgl-project#69 investigation (T72; two predictions honestly corrected during implementation): 1. Shape-aware MMVQ/MMQ dispatch (sm<9, K-quants only): re-measurement at the REAL TP=2 down-proj shard (K=8704) corrected the analysis -- MMQ wins from M>=5 there (not M>=3; that held only for the K=17408 full shape which does not exist under TP). Rules: M>=8 -> MMQ (wins on all measured shapes, up to 2.27x), M>=5 & K>=8192 -> MMQ. Single-stream decode gain is ZERO (verify M=4 untouched) -- the predicted +2-3 tok/s does not materialize at TP=2/num_spec=3; the real gain sits in bs>=2 verify and M=5-8 prefill chunks. Quality: 32-step logprob-ID identity vs base (IDs identical, maxdelta 0.000000 on normal prompts; crafted M=8 probe shows one near-tie flip at kernel relmax 3.1e-4 -- the sgl-project#66-documented class). Kill switch SGLANG_GGUF_SHAPE_DISPATCH=0; SGLANG_GGUF_MMVQ_SAFE still wins. 2. ssm_out GEMM tile measure: FALSIFIED, nothing built -- the "290 GB/s bad tile" premise was a bytes-accounting artifact (96 calls/iter = 2 weight-stream passes; per call the GEMM runs at 630 GB/s = 87% peak, standalone bench reproduces the trace time). All layout variants <=3% delta. Predicted +4 tok/s does not exist. 3. (sgl-project#70) Capture-safe dequant: over-cap dequants during CUDA-graph capture now row-chunk through the persistent sgl-project#63 workspace (_mul_mat_dequant_chunked); eager path byte-identical. The exact previously-OOMing boot (Q4-XL-MTP without mrr cap) now captures: verify 0.24 GB (was 1.42), draft-extend bs=4 at 0.09 GB (was 1.19 GiB OOM); maxKV 213,546 @mrr=4, bs=4 burst coherent. 4. (sgl-project#68) --rank-auto-reserve-mib defaults to 'auto': reserve derived as stock_runtime_reserve + decode_max_bs x (2D+1) x 2 MiB x colocated_ranks (three spec graph families counted, no magic constants). TP=3-uneven default boot: formula yields 4400 MiB/GPU, one-boot convergence, full bs-list captured, decode 90.08/80.40 (91.1-class). Honest cost: maxKV 450,752 vs 546,560 with the hand-tuned M29 recipe (-17.5%, formula over-reserves ~0.9 GB/rank) -- documented; hand-tuning remains possible via explicit values. The analogous even-path memfrac multiplier was built and REVERTED after an A/B showed it regressed the flagless multimodal TP=2 boot (rationale in code). 5. The historical 32k KV cap lived only in the t66 boot script (not in repo code); removed there. Uncapped recipe boot: maxKV 95,402 at baseline-exact decode (67.78/54.24, accept 3.346). Regressions: 27B FP8-MTP recipe max_total 487,616 exact, coherent; flagless Q6 TP=2 sizing byte-identical to stock.
efschu
added a commit
to efschu/htsglang
that referenced
this pull request
Jul 22, 2026
… beats llama.cpp) Closes the last GGUF TP=2 gap from the sgl-project#69 investigation. The legacy mul_mat_vec_q_nc kernel ran one warp per row walking every K-block serially; for Q6_K (qi=32, vdr=1 -> 1 block/warp) that is a fully serial dependent-load chain, and 32-thread blocks cap sm86 occupancy -> the measured 322 GB/s (45% peak) at M=4 vs Q8_0's ~600 GB/s. The tuned mul_mat_vec_q_nc_kq (faithful port of llama.cpp master's generic mul_mat_vec_q: 4/2-warp K-split, 2 rows/block y-load amortization) restores the parallel K-split. Gated by SGLANG_GGUF_KQ_KERNEL (default on when the tuned wheel is present); legacy kernel is the kill-switch fallback and stays bit-identical. Non-K-quant types and nvecs==1 stay on the legacy path bit-identically. Follow-on: with the tuned MMVQ now beating MMQ at every measured M, the sgl-project#72 K-quant MMQ reroute (_kquant_prefers_mmq) is a regression for tuned wheels -> gated off when the tuned kernel is active (probe op ggml_mmvq_kq_tuned registered in common_extension.cc, detected via hasattr + env in gguf.py). Requires a rebuilt sgl_kernel wheel (cu13, archs 80;86;90;120a) for the tuned path; graceful legacy fallback without. Numerics: the K-split reorders accumulation -> declared divergence, NOT bit-parity. Proven equivalent by teacher-forced argmax identity. Validation (thermal-gated, GPUs 0 MiB after): - Microbench Q6_K M=4 tuned vs legacy: RTX 3080 (sm86) 561 vs 322 GB/s (1.73x, >=550 target met); down-proj 3.22x; all M=2..8 win and now beat MMQ. RTX 5090 (sm120) 1981 vs 1138 (+74%). - E2E decode Q6_K_XL MTP, D1 code/prose: TP=2 (2x3080) tuned 88.38/72.22 vs legacy kill-switch 67.86/54.17 (+30%/+33%) -- beats llama.cpp 79.6; TP=3 uneven tuned 118.01/98.62 vs 91.1-class base (+29.5% code) -- far above llama.cpp's 74.5-79.6. - Teacher-forced argmax identity tuned vs legacy: 100/100 positions, 0 mismatches (the ~1e-4 divergence never flips greedy top-1 at identical context; 1024-tok long-forms cascade after a rare tie-flip = expected, sgl-project#66 class). accept-neutral, coherence perfect, conc-8 8/8 no crash. - 27B-FP8: structurally untouched (change is confined to the GGUF K-quant MMVQ path; FP8/compressed-tensors never call it) -- not E2E-run. Note: TP=3 first boot OOM'd at graph capture with reserve 2048 -> reserve 3500 + cuda-graph-max-bs-decode 8 fixes it (not a kernel issue; the sgl-project#68/sgl-project#79 sizing class).
efschu
added a commit
to efschu/htsglang
that referenced
this pull request
Jul 22, 2026
…rve default (sgl-project#95) All 4 errors were red at the base commit: sgl-project#68 changed the --rank-auto-reserve-mib default from the flat 2048 MiB to the demand-derived 'auto' sentinel without updating this test. - test_defaults now asserts the 'auto' sentinel (ServerArgs.AUTO_RANK_MEMORY_RESERVE_MIB) instead of int(...) == 2048. - The three TestAutoRatio arithmetic tests pin rank_auto_reserve_mib=2048 explicitly: their documented budget math (min(total - 2048, free - 1024)) is exact and device-independent that way, while the 'auto' default would route through the capacity-tier derivation (which needs the device capacity and cuda_graph_config the short-circuited ServerArgs stub lacks). - New test_auto_reserve_auto_derives_from_demand completes the stub for the 'auto' path (real default CudaGraphConfig, mocked get_device_memory_capacity, capture term disabled) and asserts the wiring: budgets == min(total - derived_rank_auto_reserve_mib(...), free - 1024), uniform cards still collapse to the even split. No production code touched; the auto-derive path behaves correctly on a minimal ServerArgs once the stub is complete. File green: 63/63 (was 59/63 at base).
efschu
added a commit
to efschu/htsglang
that referenced
this pull request
Jul 22, 2026
…rve default (sgl-project#95) All 4 errors were red at the base commit: sgl-project#68 changed the --rank-auto-reserve-mib default from the flat 2048 MiB to the demand-derived 'auto' sentinel without updating this test. - test_defaults now asserts the 'auto' sentinel (ServerArgs.AUTO_RANK_MEMORY_RESERVE_MIB) instead of int(...) == 2048. - The three TestAutoRatio arithmetic tests pin rank_auto_reserve_mib=2048 explicitly: their documented budget math (min(total - 2048, free - 1024)) is exact and device-independent that way, while the 'auto' default would route through the capacity-tier derivation (which needs the device capacity and cuda_graph_config the short-circuited ServerArgs stub lacks). - New test_auto_reserve_auto_derives_from_demand completes the stub for the 'auto' path (real default CudaGraphConfig, mocked get_device_memory_capacity, capture term disabled) and asserts the wiring: budgets == min(total - derived_rank_auto_reserve_mib(...), free - 1024), uniform cards still collapse to the even split. No production code touched; the auto-derive path behaves correctly on a minimal ServerArgs once the stub is complete. File green: 63/63 (was 59/63 at base).
efschu
added a commit
to efschu/htsglang
that referenced
this pull request
Jul 26, 2026
…ffload freed The reclaim needs no second sizing path. _profile_available_bytes derives the KV budget from a live free-memory reading taken after the weights are resident, so VRAM the offload hands back is already inside it -- provided the release has happened, on every rank, before anyone measures. sgl-project#123's eager install (right after load_model, ahead of pool sizing) supplies the first half. What was missing is everything that makes that hold rather than happen to hold: 1. Ordering invariant. A FusedMoE layer still waiting to install when the pool is sized would release its experts on its first forward, i.e. after sizing: the pool is then sized against the pre-offload footprint and later collides with the resident buffers. That was the sgl-project#77 "known limitation", and nothing prevented a refactor from restoring it silently. _assert_expert_offload_installed makes it a loud rank-local ValueError, matching the rank-local budget errors already in this function. Weightless workers (meta model, no expert weights) are skipped. 2. Group-ordered release. get_available_gpu_memory reads mem_get_info(), which is driver-level and therefore sees co-located siblings, while the caching allocator only returns freed blocks at empty_cache(). Every rank empties its own cache inside its own reading, unsynchronized -- so a rank that reads early counts a sibling's already-released expert weights as still occupied. Below the offload that skew was small. At f=0.25 on the 122B run it is the whole reclaim (~18 GiB on the shared card), landing in the co-location and min-reduce terms as pure noise. _expert_offload_release_sync makes it collect -> empty_cache -> barrier, so no rank measures before every rank has released. 3. Rank-uniform verdict. The reclaim changes the pool the whole TP group shares, so "is it present" is a MIN over the group, not a rank-local answer: a rank that released nothing (MoE-free shard, failed install falling back to fully-resident) makes the group take the plain path instead of half the ranks synchronizing while the other half measures unsynchronized. Rank-local test first, then the collective -- and both gate terms are env vars, hence world-uniform, so the collective can never be entered by a subset. 4. Accounting. [offload-kv-regain] logs the released device/host bytes next to the KV budget they are part of, so the win is readable from a boot log and a regression shows up as a drop there instead of an unexplained smaller pool. No new budget term, so the sgl-project#68 graph-capture reserve is untouched: the reclaim arrives as free bytes and is spent net of the same reserves (derived_rank_auto_reserve_mib / reserve_for_graph_mb, both folded in earlier) as any other free byte. Tests: test/registered/unit/model_executor/test_expert_offload_kv_regain.py, 27 CPU cases, no GPU -- collectives and memory readings mocked. green 27/27 after the change red before it: with the ordering hook removed but the new symbols kept, test_release_precedes_the_measurement fails (['read'] != ['all_reduce','collect','empty','barrier','read']) and test_pending_install_aborts_before_any_measurement fails ("ValueError not raised") test_reclaim_lands_one_to_one_and_spares_the_graph_reserve passes on both sides, as it should: that invariant is sgl-project#123's, and this commit only pins it down so it cannot drift. Regression, same interpreter/venv: unit/distributed/test_uneven_tp_memory.py 33/33 OK unit/server_args/test_uneven_tp_args.py 71/71 OK unit/server_args/test_rank_kv_ratio_args.py 26/26 OK unit/server_args/test_swa_pool_sizing.py 15/15 OK tests/moe_offload/test_planner.py 18/18 OK tests/moe_offload/test_capturable_planner.py 27/27 OK unit/model_executor/test_pool_configurator.py 25 errors -- pre-existing, identical error set before and after this change (diffed); unrelated cause (stub ModelRunner lacks swa_pool_sizing). Default path: the diff is additive only, and both gates are off without SGLANG_MOE_RESIDENT_EXPERT_FRACTION < 1.0, so the no-offload sizing path takes no extra collective and no extra cache operation (test_default_path_untouched asserts the call log is exactly ['read']). GPU validation still outstanding; no GPU on this lane.
efschu
added a commit
to efschu/htsglang
that referenced
this pull request
Jul 30, 2026
…r reserve demand DERIVED from its own posts (per built rung: flashinfer float workspace + captured tokens at sgl-project#68 coefficient, mode-aware offload/resident reduction) instead of guessed — charged to the solo-draft GPU only; one helper feeds installed reserve, pinned advisory and sgl-project#265 fundability so they cannot drift; sgl-project#707 geometry derives GPU0 4160->5344 (clears the measured 4554 want); explicit reserve never inflated silently, pinned/boot errors now carry concrete ladder-aware suggestions; docstring overclaim fixed; 23 new tests, 121/121 uneven_tp_args, 2345 sweep failure set unchanged
3 of 4 tasks
WhiteCmile
added a commit
to WhiteCmile/sglang
that referenced
this pull request
Oct 27, 2026
… fallback (CI review) Address the CI review findings on PR sgl-project#68: - _ring_publish_cleanup snapshots the record the first time the wave's seq word is visible. A wave deferred on a full arena no longer re-reads the ring: the Draft consumes records and the producer wraps, so the old seq word could never reappear and the wave (with its source reservation and parked requests) stranded forever. - publish() DirectRingError is pre-launch validation (ring not serving, geometry, credit): no record can appear, so the launch path restores the in-place lease and falls back to park instead of quarantining a healthy slot and failing the wave closed on an owner-revocation race. Exceptions from the extension call remain fail-closed (the kernel may be out). - _retire_cancelled_transfer_identity now drops _unconfirmed_direct, _direct_tasks_by_transfer, _held_direct_source_done and _held_direct_results. A cancelled identity has no Coordinator confirmation task and the unconfirmed timeout only sweeps transfers with held results, so these entries leaked per finished row and the unconfirmed leak weakened the Coordinator queue-capacity bound. - The held-ring-push tombstone scan is gated on DT_RING_PUBLISH_AT_LAUNCH: park staging never publishes finished rows, so with the flag off (the default) the scan is pure hot-loop overhead. - TargetCandidateArena.reserve() peeks the free list and claims the slot only after every fallible step (generation bound, lazy wait-stream and pinned-buffer allocation): an exception no longer permanently loses a FREE slot's arena capacity. - The tombstone regression test runs the real _release_held_ring_pushes and asserts the terminal bookkeeping (no mocked release), a deferral test simulates the ring lapping under a deferred wave, and a new test pins the pre-kernel publish failure to the park fallback.
WhiteCmile
added a commit
to WhiteCmile/sglang
that referenced
this pull request
Oct 28, 2026
…stone scan, revert arena free-list (CI review round 6) CI review on PR sgl-project#68 requested changes on three findings: - dt_draft_engine: tombstoned launch-only rows were inspected only after candidate compute created the wave's held push; a ring wrap in between erased the sole terminal signal and held the wave forever. The record take now scans the destination region while the ring generation is still observable: a tombstone retires the row before admission, a live triple is latched onto the task as its arena destination. Held-push rows that never resolve within the record deadline retire as cancelled via the unconfirmed-direct timeout instead of holding the wave indefinitely. - dt_target: an arena-retained wave's retried cleanup unconditionally wrote its old seq into the modulo-reused destination slot, clobbering a newer wave's published destinations. Cleanup now checks record-slot ownership before writing (skip + Coordinator-copy fallback when reused) and drops a wave whose slot wrapped before its first snapshot instead of polling a seq word that can never reappear. While any wave is arena-retained the session's ring publication is backpressured (launch falls back to park, park falls back to the Python publication path), so the slot cannot be reused in the first place; in-flight candidate pushes still complete and drain the arena, so the gate lifts. - dt_candidate_p2p: the free-list / persistent CUDA stream / pinned-buffer refactor was leftover from the abandoned launch-time destination reservation design; revert to the baseline reserve() so allocation and reuse behavior is unchanged for every deployment, including the flag-off default path (Occam). CPU contracts: 14/14 in the Q15b file, including new coverage for the take-time scan, the held-push expiry, the backpressure fallback, the wrapped-slot drop, and the skipped destination write. Full test_dt_* CPU suite matches the baseline failure set (all in ci/known-failures).
WhiteCmile
added a commit
to WhiteCmile/sglang
that referenced
this pull request
Oct 30, 2026
The §7.1 take-time destination latch (PR sgl-project#68 round 6) replaces the ring-record task with a copy carrying candidate_destination when DT_RING_PUBLISH_AT_LAUNCH=1, but _confirm_direct_task still required candidate_destination is None to treat a differing Coordinator copy as the same ring-record task. With the flag on, the first confirmation therefore raised "Coordinator task differs from its direct dispatch" and killed the Draft. direct_ring_seq alone proves ring-record identity; drop the stale destination check so the Coordinator copy is adopted for its scheduling metadata either way. CPU dt tests: 167 passed, 10 failed (byte-identical to ci/known-failures).
5 tasks
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
No description provided.