Repository navigation
Improve the control of streaming and improve the first token latency in streaming - #117
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
…-project#117) * Add mechanism to the Transpiler for signaling invalid kernels due to smem usage * fixes for async transpilation * fix * update utils --------- Co-authored-by: xinhaoc <[email protected]>
efschu
added a commit
to efschu/htsglang
that referenced
this pull request
Jul 26, 2026
… cross-host TP Nordstern L1: the inter-rig leg of the transport registry. Same host-staged collective semantics as the gloo plane, UCX/RDMA instead of TCP. One registry entry plus two modules; no dispatch site changed. Binding: ctypes over libucp, not ucx-py or Cython. The deciding constraint is that UCX version parity requires loading a SPECIFIC library path -- ucx-py bundles its own UCX and so hard-codes one side of the mismatch instead of resolving it, and is asyncio-shaped, which is the wrong control flow for a synchronous collective on the bs=1 decode path. Cython needs a compiler and UCX headers per host; the second rig has the runtime libraries but not the -dev package. A subprocess bridge would add an IPC hop to a ~1.5 us path. ctypes needs no build step and takes the library from SGLANG_HTCCL_UCX_LIB. Struct layouts are mask-driven and over-allocated against future UCX appends, and the transcribed offsets are asserted at import. Version parity is enforced, not hoped for: mixed releases do not degrade, they fail at endpoint creation with the useless "invalid bandwidth 0.00". The rendezvous gathers each rank's version over the existing gloo cpu_group and refuses BEFORE any endpoint exists, naming every rank's version and library path and the remedy. Latency shaping, because bs=1 decode is the workload that matters: a single-step full exchange (all receives and sends posted together, one round trip at any world size), switching to a ring for all_reduce only above SGLANG_HTCCL_UCX_RING_MIB. Endpoints are persistent and wired up during construction so no decode step pays a handshake; staging views and the ctypes request struct are reused rather than rebuilt per call. handles() is deliberately size-independent, unlike shm's slot ceiling: the communicator asks each rank separately, so a size-dependent answer would let ranks disagree about whether a collective goes over UCX or gloo and hang the group. Staging buffers are strictly internal -- every result is allocated fresh, per the aliasing defect this file's neighbours already paid for. Ops: all_reduce, all_gather, broadcast, reduce_scatter, plus an internal barrier that also warms up the endpoints. Teardown barriers before closing so a departing rank cannot reset a peer that is still progressing.
efschu
added a commit
to efschu/htsglang
that referenced
this pull request
Jul 26, 2026
16 tests, no GPU and no second host: they run against UCX's own self/sm loopback, so they are safe while a GPU window is busy. Bindings (7): the hand-transcribed ucp_request_param_t offsets, which no higher-level test would localise if wrong; that the module imports with neither sglang nor torch, because the cross-rig harness loads it from a bare python3 on a host with no sglang; error-pointer decoding; real send/recv round trips both below and above the eager/rendezvous threshold; and that two concurrently posted transfers with swapped post order do not cross tags. Collectives (9): real multi-process ranks over a real UCX worker at world 2 and 3 -- 3 being the smallest size where the ring all_reduce and the multi-peer exchange stop being a pairwise swap. Every collective against a computed reference, including the two traps this code base has already been bitten by: same-shape results that alias, and reduce_scatter picking the wrong axis for dim >= 2 while every shape assertion still passes. Plus forced multi-chunk transfers, idempotent teardown, registry wiring, the size-independence of handles(), and the version-parity rejection. The 47 pre-existing HTCCL tests still pass.
efschu
added a commit
to efschu/htsglang
that referenced
this pull request
Jul 26, 2026
…tives green
scripts/nordstern/l1_ucx_crossrig.{py,sh}: one rank per rig, CPU tensors only,
so it runs without touching a GPU on either machine. Control plane and data
plane are deliberately split -- gloo rendezvous over the 1 GbE LAN, UCX with
UCX_TLS=rc and no TCP fallback over the RoCE link -- so a pass proves RDMA
actually carried the bytes rather than quietly degrading.
Results, main rig 10.10.10.1 <-> second rig 10.10.10.2:
version parity 1.18.1 vs 1.16.0 REJECTED at rendezvous with the remedy
named, before any endpoint existed; with rank 0 pointed at
/opt/ucx116 both ranks report 1.16.0 and proceed
correctness every collective green on both ranks; rendezvous+wireup
0.11 s
throughput median, per direction, while the reverse direction runs
simultaneously:
8 KiB 35 us 1.8 Gbit/s
64 KiB 75 us 7.0 Gbit/s
512 KiB 355 us 11.8 Gbit/s
4 MiB 1.61 ms 20.8 Gbit/s <- peak
32 MiB 23.6 ms 11.4 Gbit/s
barrier median 12 us, min 9.9 us
raw link ucx_perftest tag_bw unidirectional the same day: 3413 MB/s
(~27.3 Gbit/s), so the peak is ~76% of the unidirectional
budget while moving traffic both ways
Two gaps, both diagnosed rather than left as mysteries. Small-message cost is
software, not wire: a 12 us barrier against a ~1.5 us link is Python/ctypes
per-call overhead, already roughly halved by memoising staging views and
reusing the request struct, and it is the floor for bs=1 decode until the call
path gets shorter. The 32 MiB regression against 4 MiB is CPU-memory-bound,
not link-bound: V1 makes four passes over the payload (stage in, wire,
accumulate, stage out) and does not overlap them with the transfer; chunked
pipelining is the fix and belongs to L2.
FEATURES_VS_UPSTREAM row 21 records the binding decision, the parity design,
these numbers, and a step-by-step recipe for the GPU/model bring-up -- which
is deliberately NOT run yet. Note for whoever does: the development container
CT999 has no /dev/infiniband and no 10.10.10.x address, so GPU ranks must run
where both the cards and the NIC are visible.
efschu
added a commit
to efschu/htsglang
that referenced
this pull request
Jul 27, 2026
…probe Semantic pre-check on the two doubly-touched files: * environ.py -- disjoint regions. The tip's only hunk is at 319 (sgl-project#188 SGLANG_MEASURED_KV_BUDGET_CTX_ALLOWANCE_MIB); this branch's are at 525/544 (the HTCCL UCX transport knobs). Different Envs blocks, no shared symbol. * FEATURES_VS_UPSTREAM.md -- documentation only, additive sections. Merged before feat/htccl-ucx-l2, which builds on it (transport is in fact an ancestor of l2; kept as two merge commits so the sgl-project#117 and sgl-project#198 steps stay separately identifiable).
efschu
added a commit
to efschu/htsglang
that referenced
this pull request
Jul 27, 2026
The L2 hierarchical layer on top of sgl-project#117's UCX transport, merged second as planned. Semantic pre-check: environ.py regions unchanged from the sgl-project#117 check above (525/544, disjoint from the tip's 319). The new files it touches beyond sgl-project#117 -- layers/communicator.py, layers/linear.py, layers/moe/{__init__,utils}.py -- are untouched by every branch merged so far this window.
efschu
added a commit
to efschu/htsglang
that referenced
this pull request
Jul 27, 2026
…3-probe Docs-only, merged last as planned. Three CONTENT conflicts in FEATURES_VS_UPSTREAM.md, all because the docs branch was written before sgl-project#96, sgl-project#127 and sgl-project#117/sgl-project#198 landed. Resolved by taking the branch's editorial rules and re-applying them to the facts as they now stand, rather than by picking a side: 1. Row 12 (Weightless-KV lane). Took the branch's evidence tier ("Cross-checked" instead of "Implemented") and its determinism-harness sentence, and KEPT the per-ROLE KV precision paragraph that sgl-project#127 added this window -- content the docs branch never saw. 2. Row 21 (HTCCL, ucx transport). The branch's rule from 8f1fdcf is that detail sections compare against upstream sglang only, with foreign engines confined to the overview matrix. Applied that rule to the NEW ucx section that sgl-project#117/sgl-project#198 brought in: the whole Nordstern-L1 body is kept, and only its trailing seven-line vLLM/llama.cpp/ik_llama.cpp/UCC paragraph is replaced by the branch's sglang-only one-liner. 3. Guarded/descoped section, SWA-DCP Stage B. The docs branch states "neither branch is merged, so Stage B stays out of the main matrix". That became FALSE earlier in this same stack -- sgl-project#96 and sgl-project#186 are merged. Rewritten to say so, keeping the branch's tier vocabulary and its Window-3 H-series evidence (H4 boot, H5 needle byte-identical to a TP=1 solo-5090 oracle, H6/H7 green) and keeping HEAD's _plan_aware_dcp_group_q_head_counts paragraph. The +6-10% figure stays labelled an ex-ante design estimate: no throughput number has been taken for Stage B. OPEN DOC ITEM, deliberately not fixed here: that Stage B bullet still physically sits under the "Built and evaluated, then gated off" heading. The bullet now opens by contradicting its own section, which is honest but ugly; moving it into a numbered detail row plus an overview-matrix row is a doc restructure, not a merge resolution, and is left for a docs pass.
efschu
pushed a commit
to efschu/htsglang
that referenced
this pull request
Sep 29, 2026
…indem DEADMAN_FLIP_STALL
NF z30w-park, epoch 113: drain() hing im #1317c-Fortschrittszeugen
(GET {P}/get_server_info) am toten P-Ring. Der Zeuge lief nur mit dem
3600-s-Timeout der gemeinsamen Session. Deshalb kam statt eines
benannten Stopps ein blinder DEADMAN_FLIP_STALL.
Neu:
- Der Lesezugriff hat ein eigenes Timeout, PROGRESS_READ_TIMEOUT_S = 12 s.
Eine lebende Gruppe beantwortet den Read zwischen zwei Scheduler-
Iterationen, also innerhalb eines Forward-Passes. Der längste gemessene
ist ein P-16k-Chunk auf PP0 mit ~5,6 s (x135, sgl-project#117); 12 s ist das
Doppelte. Nicht 2 s: das würde einen gesunden P mitten im Chunk als
Stopp benennen. Mit 12 s bleibt es klar innerhalb der Flip-Stall-Wache.
- Läuft das Timeout ab, wirft der Read Weg2ProgressUnreachable. drain()
stoppt dann per do_stop("W3 Weg2DrainWitnessUnreachable", ...) mit dem
Gruppennamen und der Adresse des Einstiegsrangs. flip() kehrt danach
sofort zurück: kein W1-Zähler, kein Abort, kein Retry, kein Flip.
- Der P-Leg-1-Wächter liest das Timeout als Abwesenheit (prog=None). Dort
entscheidet weiter die Leg-1-Stall-Schranke.
Tests: test_weg2_drain_witness_timeout_0929 3 grün, gegen einen echten
aiohttp-Server mit hängendem Endpunkt: benannter W3 in unter 1,3 s bei
0,3-s-Schranke; antwortende Gruppe ohne Stopp; die Schranke deckt einen
gemessenen P-Chunk. test_weg2_drain_progress_1317c und
test_weg2_client_gone_h102: 24 grün.
Jiminator
added a commit
that referenced
this pull request
Oct 16, 2026
[Beam] Fix attention parallel groups and DP-attention embedding
yicyang
pushed a commit
to yicyang/sglang
that referenced
this pull request
Dec 1, 2026
* ci: switch Qwen3.5 35B target-only evaluation to TP2 - Rename the launcher and set its tensor parallel size to two. - Update the CI case and evaluation guide to use TP2. - Retain the existing accuracy gate pending TP2 validation. Signed-off-by: Xiake Sun <[email protected]> * ci: benchmark Qwen3.5 35B TP2 with 256 prompts at concurrency 8 Signed-off-by: Xiake Sun <[email protected]> * ci: reduce gh search per page size to avoid timeout Signed-off-by: Xiake Sun <[email protected]> --------- Signed-off-by: Xiake Sun <[email protected]>
yicyang
added a commit
to yicyang/sglang
that referenced
this pull request
Dec 1, 2026
…ch and docs - qwen4_ci.py: Qwen3.5-35B-TP2-Base fails when its server log lacks the FlyDSL GDN decode or, after the performance phase, the SDMA all-reduce line, so a missing mori cannot pass silently. Accuracy-only runs, which may stay below the 2048-token threshold, only require the decode line. - test_qwen4_ci.py: cover the check and give the sgl-project#117 workload test a server log with both lines. - benchmark/qwen4_seq_parallel: two-GPU correctness and layer timing for the Qwen3.5 SDMA all-reduce; README section with the serving results. - Evaluation guide: the 35B TP2 launcher's SDMA / mori requirement and the new CI check. Signed-off-by: Ethan Yang <[email protected]>
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.