Repository navigation
Conversation
NorthmanPKU
pushed a commit
to NorthmanPKU/sglang
that referenced
this pull request
May 16, 2025
… muGraphs (sgl-project#147) * Update a state field to the transpileresult * compile issues * update interface * add missing files * add a constraint that each stensor can have at most 1 swizzled dim
NorthmanPKU
added a commit
to NorthmanPKU/sglang
that referenced
this pull request
May 16, 2025
* initial impl * format * fix bugs and add a docu * add more operators * a functional version for the nki_rms_norm example * Triton transpiler first version (sgl-project#144) * Initial version. Generated demo can run. * clear json --------- Co-authored-by: Jianan Ji <[email protected]> Co-authored-by: Jianan Ji <[email protected]> * bug fix * bug fix * Triton Transpiler Update (sgl-project#150) * Initial version. Generated demo can run. * clear json * Dynamic scheduling of search with OpenMP (sgl-project#142) * fork-join working * improve gqa * modified z3 caching * tested different threads * did format.sh * redundant code * modified num threads * Formal verification for equivalence checking between MuGrpahs (sgl-project#141) * set default strides for outputs * checkpoint * Support input/output stride specification in search * undo changes in cmake files * fix json key error * refactor search code a bit & initialize symbolic verification * checkpoint * debug * fix * fix * format * remove debug code * [Transpiler] Allow the transpiler to return errors for untranspilable muGraphs (sgl-project#147) * Update a state field to the transpileresult * compile issues * update interface * add missing files * add a constraint that each stensor can have at most 1 swizzled dim * 1. Debug offset 2. Add TritonProfiler 3. Add mask for 'power of 2' limit 4. Add min 16 tl.dot() limit --------- Co-authored-by: Jianan Ji <[email protected]> Co-authored-by: Jianan Ji <[email protected]> Co-authored-by: Kit Ao <[email protected]> Co-authored-by: Mengdi Wu <[email protected]> Co-authored-by: Zhihao Jia <[email protected]> * [NKI] Allow NKI transpiler to report descriptive errors for valid mugraph to proceed to (sgl-project#151) next mugraph * Add Triton Transpiler doc (sgl-project#152) * Initial version. Generated demo can run. * clear json * 1. Debug offset 2. Add TritonProfiler 3. Add mask for 'power of 2' limit 4. Add min 16 tl.dot() limit * triton doc --------- Co-authored-by: Jianan Ji <[email protected]> Co-authored-by: Jianan Ji <[email protected]> * fix unbalanced parenthesis in matmul transpose (sgl-project#154) --------- Co-authored-by: NorthmanPKU <[email protected]> Co-authored-by: Jianan Ji <[email protected]> Co-authored-by: Jianan Ji <[email protected]> Co-authored-by: Gabriele Oliaro <[email protected]> Co-authored-by: Kit Ao <[email protected]> Co-authored-by: Mengdi Wu <[email protected]> Co-authored-by: segfault <[email protected]>
NorthmanPKU
added a commit
to NorthmanPKU/sglang
that referenced
this pull request
May 16, 2025
* initial impl * format * fix bugs and add a docu * add more operators * a functional version for the nki_rms_norm example * Initial version. Generated demo can run. * clear json * Triton transpiler first version (sgl-project#144) * Initial version. Generated demo can run. * clear json --------- Co-authored-by: Jianan Ji <[email protected]> Co-authored-by: Jianan Ji <[email protected]> * bug fix * bug fix * 1. Debug offset 2. Add TritonProfiler 3. Add mask for 'power of 2' limit 4. Add min 16 tl.dot() limit * Triton Transpiler Update (sgl-project#150) * Initial version. Generated demo can run. * clear json * Dynamic scheduling of search with OpenMP (sgl-project#142) * fork-join working * improve gqa * modified z3 caching * tested different threads * did format.sh * redundant code * modified num threads * Formal verification for equivalence checking between MuGrpahs (sgl-project#141) * set default strides for outputs * checkpoint * Support input/output stride specification in search * undo changes in cmake files * fix json key error * refactor search code a bit & initialize symbolic verification * checkpoint * debug * fix * fix * format * remove debug code * [Transpiler] Allow the transpiler to return errors for untranspilable muGraphs (sgl-project#147) * Update a state field to the transpileresult * compile issues * update interface * add missing files * add a constraint that each stensor can have at most 1 swizzled dim * 1. Debug offset 2. Add TritonProfiler 3. Add mask for 'power of 2' limit 4. Add min 16 tl.dot() limit --------- Co-authored-by: Jianan Ji <[email protected]> Co-authored-by: Jianan Ji <[email protected]> Co-authored-by: Kit Ao <[email protected]> Co-authored-by: Mengdi Wu <[email protected]> Co-authored-by: Zhihao Jia <[email protected]> * triton doc * [NKI] Allow NKI transpiler to report descriptive errors for valid mugraph to proceed to (sgl-project#151) next mugraph * dtype consistence & del generated code * 1. MIRAGE_ROOT in kernel.py 2. add paras in kernel.py 3. rm tqdm in loop and redundant notes 4. rm redundant output in get_input_dim_expr * ignore * add tqdm to requirements * run all iters in a single subprocess * 1. Support directly calling graph as funcs 1.1. add execute_mugraph() in generated code 1.2. change __call__ to support several backends 1.3. other relative modify 2. fix some errors in triton transpiler including mask form and matmul op --------- Co-authored-by: Zhihao Jia <[email protected]> Co-authored-by: Jianan Ji <[email protected]> Co-authored-by: Jianan Ji <[email protected]> Co-authored-by: Gabriele Oliaro <[email protected]> Co-authored-by: Kit Ao <[email protected]> Co-authored-by: Mengdi Wu <[email protected]> Co-authored-by: segfault <[email protected]>
shawlleyw
added a commit
to shawlleyw/sglang
that referenced
this pull request
Dec 16, 2025
initialize paras parallel states
rucnyz
added a commit
to rucnyz/sglang
that referenced
this pull request
Jun 2, 2026
) t10 was a 180-line README of 6 unimplemented stress tests — no code, no results. The 'pre-round-9' banner + dead links to N3_GAPS.md made it pure maintenance burden. What was promised: (A) inline-scorer vs daemon conflict rate <1% under traffic (B) /aginfer/state under 50-concurrent-poller load → PARTIAL: verify/t17/ Stage 7 covers single-walker + traffic (C) daemon restart mid-Run-K consistency (D) program_tracker GC at 24h synthetic load (E) 10k-event webhook flood drain time (F) DISK tier round-trip (BLOCKED on Mooncake L3 wiring T20-future) Tracking as sgl-project#147 so the unwritten coverage stays visible without the dead README cluttering verify/. Each flavor will land as its own verify/<descriptive>/ dir when written. verify/README.md row 10 marks pending.
rucnyz
added a commit
to rucnyz/sglang
that referenced
this pull request
Jun 2, 2026
…er_args into sglang launch Audit (subagent) caught: T22 commit 2beb3a3 shipped the GET/PUT plumbing but the launch path never called fetch_bootstrap_thresholds. sglang's scheduler kept booting AginferWebhookFirer from CLI defaults — the exact 'last-known-values fallback' DESIGN §10 'Threshold parity' forbids and that round-14 removed. G9 (theta drift between sglang webhook fire and daemon admission gate) was not actually closed. This commit closes it. New helper python/sglang/srt/managers/aginfer_webhook.py: bootstrap_thresholds_into_server_args(server_args, *, timeout_s=10): 1. No-op if aginfer_notify_url is None (legacy / daemon-less). 2. fetch_bootstrap_thresholds(notify_url); on ANY failure (unreachable, timeout, malformed shape, etc): logger.error('Deployment-ordering bug — daemon must be up before sglang. Halting.') + sys.exit(1). No silent fallback (round-14 / DESIGN §6 step 1). 3. Overwrite each server_args.aginfer_<theta_hi|lo|crit> + aginfer_heartbeat_s with the daemon's view. 4. If the CLI value differs from the sglang hardcoded default, the operator explicitly passed a non-default that disagrees with the daemon (DESIGN §6 step 3). Log a WARNING naming the override so the launch flag isn't silently moot. Wired from python/sglang/srt/server_args.py::prepare_server_args AFTER ServerArgs.from_cli_args(), BEFORE returning — guarantees the scheduler subprocess that constructs the firer sees the daemon-canonical values. verify/t22 — 4 new stages (8 total, all GREEN): A4 no-notify-url => no-op (legacy / daemon-less untouched) A5 daemon-up, operator-at-defaults => all 4 fields overwritten, no false-positive WARN A6 operator-explicit-disagreement (theta_hi=0.5 vs daemon 0.85) => daemon wins + WARNING line fires (DESIGN §6 step 3) A7 daemon unreachable => _exit_func(1) called (injectable for tests; defaults to sys.exit), ERROR line names the deployment-ordering bug, server_args NOT mutated (no partial-application) Test design note: A7 injects _exit_func via the helper's keyword arg so the verify can assert exit-was-called(1) without actually terminating the test process. Production callsite uses sys.exit. What changed for the operator: * Daemon-managed deploy (--aginfer-notify-url set): sglang halts at startup if daemon is down. CLI threshold flags are advisory — daemon wins. WARN log fires when an explicit CLI flag disagrees so the operator sees the override. * Daemon-less deploy (no --aginfer-notify-url): unchanged. What's still follow-up: * Daemon-side runtime broadcast (SIGHUP / admin endpoint enqueues PUT /aginfer/thresholds via outbound queue). The bootstrap side alone closes G9; the broadcast side is an ergonomics add-on for operator-driven threshold tuning. * Phase B live integration (launch daemon + sglang together, verify sglang's firer ends up with daemon's values). Lives in verify/integration_stress (sgl-project#147) when those tests get written. Log: dev/aginfer/verify/t22/results/20260601_t22_g9_closure_pass.log
rucnyz
added a commit
to rucnyz/sglang
that referenced
this pull request
Jun 2, 2026
…s against real sglang+daemon stack The ONLY verify that launches a full sglang + daemon process pair and pushes traffic through. Per-task verifies (T7/T8/T36/T42/T164/…) mock sglang; this one tests the actual wire path Run K uses. Six flavors (60s shared sglang+daemon stack except F): A proxy hot-path under load — 24 concurrent chats × 60s B state-dump under sustained traffic — /aginfer/state @ 2 Hz under chat load C event-router fan-in throughput — 200 webhook events D migrate under traffic — outbound + chat concurrently E threshold PUT atomicity — PUT/GET concurrent with traffic F dead-sglang resilience — separate daemon vs dead sglang port Run4 (2026-06-01): all 6 PASS. Headline: A: 10488 req, 100% success, p99=272 ms (Qwen3-0.6B) B: 159 samples, p99_max=33.9 ms — UNDER sgl-project#160's 50 ms F3-revisit ceiling C: 200/200 events accepted D: 200/200 migrate batches OK E: 268/268 PUTs OK, 0 torn reads of daemon's GET /aginfer/thresholds F: daemon stays alive, /health responsive, no false-positive fatal State worth recording (caught during wire-up): * SGLANG_ENABLE_UNIFIED_RADIX_TREE=1 required; default HiRadixCache returns {"unsupported_tree_cache":...} for /aginfer/state * --aginfer-notify-url required for sglang's update_aginfer_thresholds to do anything (otherwise returns ok=False reason="no webhook firer") * Daemon MUST launch before sglang — sglang's T22 sgl-project#165 bootstrap GETs daemon/aginfer/thresholds at launch and halts on failure (deployment-ordering bug per daemon/aginfer_webhook.py) F's positive-case integration is structurally hard from the event path (state-fetch fails before outbound queue populates); T164 stages B0/C0 own the positive integration of escalate-to-fatal. F here covers the complementary negative (low-traffic dead-sglang must NOT escalate) — DESIGN §10 contract that sgl-project#164's both-axis trigger was designed to prevent false-positives on. Side-finding worth a follow-on: B's p99_max=34 ms beats sgl-project#160's 50 ms F3-revisit threshold under realistic load. Earlier sgl-project#160 trigger may have been a different config; worth re-examining whether sgl-project#160 is still load-bearing.
efschu
added a commit
to efschu/htsglang
that referenced
this pull request
Jul 21, 2026
…+ FP8-27B TP=3 validation Reusable measurement module (energy.py): boots a serving config with CUDA graphs ON, drives a batch-bucket sweep (bs 1/4/16) under two workloads (code + prose, temp 0), measures prefill/decode tok/s, and integrates NVML board power per-phase (prefill window vs decode window) -> J/token. Ingests measured rows (provenance "measured") that pass the results_store guard; the dashboard now prefers measured over the roofline estimate. Energy detail: - Whole-rig energy = SUM of all GPUs' NVML board power (GPU-only; EXCLUDES CPU/RAM/PSU losses -- NOT wall-socket power; labelled as such everywhere). - PER-CARD breakdown from each card's OWN integrated power (never total/N), plus per-card compute-share from the uneven-TP ratio (torch->NVML mapped by UUID, avoiding the device-order trap). Surfaces the measured compute-share vs power-share divergence. - kWh/1M-token = J/token / 3.6, derived at render time (not stored). - Cost layer: a ct/kWh price input drives ct-per-1M-token for prefill/decode (per workload + per card + total). Shared JS helpers (kwhToCt / jPerTokToCt Per1M / kwhBandToCt) so sgl-project#147 (HiCache kWh-saved -> money saved band) and sgl-project#148 (virtual-rig estimate -> cost) plug into the same conversion. Schema: ResultEntry gains `workload` + `per_card_energy`. Validated on Qwen3.6-27B-FP8, TP=3 uneven-DCP (rank-tp-ratio 28591,16464,16464 -> 8:4:4 vision-head split), kv fp8_e4m3, CUDA graphs ON, on the live 5090+2x3080 rig (no P2P). Measured decode: 40 tok/s @bs1 .. 427 tok/s @bs16; code ~= prose decode (base decode is content-independent, as expected). The roofline decode estimate for this config was ~25 tok/s @bs1 (interconnect discount x0.341) vs measured 40 -> the no-P2P/3-card discount is ~1.6x too harsh but same order of magnitude. Per-card @bs16: RTX 5090 carries 46% of the compute yet draws the LEAST power (~222 W) while each 27%-share 3080 draws ~240 W -- the Blackwell card is the efficient workhorse; the Ampere 3080s cost disproportionate energy per unit work. Cost @30 ct/kWh (code): decode 13.7 ct/1M @bs16 .. 147 ct/1M @bs1; prefill ~2-4 ct/1M. Tests: test_energy.py (per-card integration, ingest-guard, kWh derivation, launch shape) -- 8 new; full planner suite green (128).
efschu
added a commit
to efschu/htsglang
that referenced
this pull request
Jul 21, 2026
… + dashboard band
The HiCache serves prefill tokens from a RAM (host) / disk (storage) prefix
cache instead of recomputing them. Each recovered token is an avoided prefill
recompute -> energy saved. This adds a persistent, per (model, config_label)
accumulator that grows across sessions and converts the running recovered-token
total into a kWh / EUR-cent saving BAND for the config-planner dashboard.
Signal: sglang:cached_tokens_total{cache_source=...} (metrics_collector.py),
restricted to the HiCache RAM/disk tiers -- cache_source="host" (RAM) and
"storage_*" (disk backend). The on-GPU radix tier "device" and the "total"
fallback label are excluded (they are not the RAM/disk offload). Recording is a
/metrics counter snapshot (delta since last, reset-guarded), not a boot.
Hard rules enforced:
* saved_J = recovered_tokens * J_per_prefill_token -- NOTHING deducted for the
RAM/disk fetch (that power is sunk cost); a bare multiply, deliberately.
* von-bis BAND, not a point: edges = min/max measured j_per_prefill_token
across buckets.
* persistent per (model, config_label): JSON store, atomic save, accumulates.
* saved_kWh = saved_J / 3.6e6 ; saved_ct = saved_kWh * price_ct_per_kwh.
* provenance discipline: a measured J/prefill-token band is never overwritten
by an estimate (mirrors results_store.py).
New:
* hicache_savings.py -- accumulator module + store + Prometheus source parser.
* webui.py -- /api/hicache_saved GET (read) + POST (record delta), and a
"HiCache energy SAVED" stat block in the measured panel (per-config + grand
total von-bis band, price-reactive).
* test_hicache_savings.py -- 23 tests (metric source filtering, band min/max,
no-fetch-deduction invariant, counter delta/reset, persistence round-trip,
provenance discipline, grand-total band, webui GET/POST).
Tests: planner suite 172 -> 195 passed (offline; no GPU / no server boot).
efschu
added a commit
to efschu/htsglang
that referenced
this pull request
Jul 21, 2026
…at-zero graphs One full-width strip of headline tiles at the top of the landing page: decode + NON-CACHED prefill tok/s, MTP accept + adaptive-k, per-tier cache hit (device/host/storage), live J/token + tokens/kWh (NVML watts sum / active-phase rate), prefill/decode cost in ct/1M, and the sgl-project#147 saved-cost band (host-RAM + disk tiers only, VRAM tier excluded). Graph semantics: 60s ring per tile, drop to 0 ONCE within a 2s grace after the last nonzero sample, then the buffer FREEZES (no eternally scrolling zero flatline); new activity resumes appending. Sparklines render one fixed pixel bucket per sample (samples*px SVG, no smoothing, no CSS stretching), newest at the right edge. Gauges (accept rate) are sampled only while decode is active instead of faking a zero. The old lower 'throughput / spec / cache' block MOVED into the strip (container removed, no duplication); per-card GPU charts stay below. Tiles show '--' plus the enable-metrics hint on metrics_error. Tests: planner unit suite 530 passed, 1 skipped (was 525/1) -- 5 new webui tests for the strip container/tile ids, removed duplicate block, freeze-grace + pixel-bucket markers, and the sgl-project#147 saved-tile wiring. Page JS validated with esprima (parse OK).
efschu
added a commit
to efschu/htsglang
that referenced
this pull request
Jul 22, 2026
…+ FP8-27B TP=3 validation Reusable measurement module (energy.py): boots a serving config with CUDA graphs ON, drives a batch-bucket sweep (bs 1/4/16) under two workloads (code + prose, temp 0), measures prefill/decode tok/s, and integrates NVML board power per-phase (prefill window vs decode window) -> J/token. Ingests measured rows (provenance "measured") that pass the results_store guard; the dashboard now prefers measured over the roofline estimate. Energy detail: - Whole-rig energy = SUM of all GPUs' NVML board power (GPU-only; EXCLUDES CPU/RAM/PSU losses -- NOT wall-socket power; labelled as such everywhere). - PER-CARD breakdown from each card's OWN integrated power (never total/N), plus per-card compute-share from the uneven-TP ratio (torch->NVML mapped by UUID, avoiding the device-order trap). Surfaces the measured compute-share vs power-share divergence. - kWh/1M-token = J/token / 3.6, derived at render time (not stored). - Cost layer: a ct/kWh price input drives ct-per-1M-token for prefill/decode (per workload + per card + total). Shared JS helpers (kwhToCt / jPerTokToCt Per1M / kwhBandToCt) so sgl-project#147 (HiCache kWh-saved -> money saved band) and sgl-project#148 (virtual-rig estimate -> cost) plug into the same conversion. Schema: ResultEntry gains `workload` + `per_card_energy`. Validated on Qwen3.6-27B-FP8, TP=3 uneven-DCP (rank-tp-ratio 28591,16464,16464 -> 8:4:4 vision-head split), kv fp8_e4m3, CUDA graphs ON, on the live 5090+2x3080 rig (no P2P). Measured decode: 40 tok/s @bs1 .. 427 tok/s @bs16; code ~= prose decode (base decode is content-independent, as expected). The roofline decode estimate for this config was ~25 tok/s @bs1 (interconnect discount x0.341) vs measured 40 -> the no-P2P/3-card discount is ~1.6x too harsh but same order of magnitude. Per-card @bs16: RTX 5090 carries 46% of the compute yet draws the LEAST power (~222 W) while each 27%-share 3080 draws ~240 W -- the Blackwell card is the efficient workhorse; the Ampere 3080s cost disproportionate energy per unit work. Cost @30 ct/kWh (code): decode 13.7 ct/1M @bs16 .. 147 ct/1M @bs1; prefill ~2-4 ct/1M. Tests: test_energy.py (per-card integration, ingest-guard, kWh derivation, launch shape) -- 8 new; full planner suite green (128).
efschu
added a commit
to efschu/htsglang
that referenced
this pull request
Jul 22, 2026
… + dashboard band
The HiCache serves prefill tokens from a RAM (host) / disk (storage) prefix
cache instead of recomputing them. Each recovered token is an avoided prefill
recompute -> energy saved. This adds a persistent, per (model, config_label)
accumulator that grows across sessions and converts the running recovered-token
total into a kWh / EUR-cent saving BAND for the config-planner dashboard.
Signal: sglang:cached_tokens_total{cache_source=...} (metrics_collector.py),
restricted to the HiCache RAM/disk tiers -- cache_source="host" (RAM) and
"storage_*" (disk backend). The on-GPU radix tier "device" and the "total"
fallback label are excluded (they are not the RAM/disk offload). Recording is a
/metrics counter snapshot (delta since last, reset-guarded), not a boot.
Hard rules enforced:
* saved_J = recovered_tokens * J_per_prefill_token -- NOTHING deducted for the
RAM/disk fetch (that power is sunk cost); a bare multiply, deliberately.
* von-bis BAND, not a point: edges = min/max measured j_per_prefill_token
across buckets.
* persistent per (model, config_label): JSON store, atomic save, accumulates.
* saved_kWh = saved_J / 3.6e6 ; saved_ct = saved_kWh * price_ct_per_kwh.
* provenance discipline: a measured J/prefill-token band is never overwritten
by an estimate (mirrors results_store.py).
New:
* hicache_savings.py -- accumulator module + store + Prometheus source parser.
* webui.py -- /api/hicache_saved GET (read) + POST (record delta), and a
"HiCache energy SAVED" stat block in the measured panel (per-config + grand
total von-bis band, price-reactive).
* test_hicache_savings.py -- 23 tests (metric source filtering, band min/max,
no-fetch-deduction invariant, counter delta/reset, persistence round-trip,
provenance discipline, grand-total band, webui GET/POST).
Tests: planner suite 172 -> 195 passed (offline; no GPU / no server boot).
efschu
added a commit
to efschu/htsglang
that referenced
this pull request
Jul 22, 2026
…at-zero graphs One full-width strip of headline tiles at the top of the landing page: decode + NON-CACHED prefill tok/s, MTP accept + adaptive-k, per-tier cache hit (device/host/storage), live J/token + tokens/kWh (NVML watts sum / active-phase rate), prefill/decode cost in ct/1M, and the sgl-project#147 saved-cost band (host-RAM + disk tiers only, VRAM tier excluded). Graph semantics: 60s ring per tile, drop to 0 ONCE within a 2s grace after the last nonzero sample, then the buffer FREEZES (no eternally scrolling zero flatline); new activity resumes appending. Sparklines render one fixed pixel bucket per sample (samples*px SVG, no smoothing, no CSS stretching), newest at the right edge. Gauges (accept rate) are sampled only while decode is active instead of faking a zero. The old lower 'throughput / spec / cache' block MOVED into the strip (container removed, no duplication); per-card GPU charts stay below. Tiles show '--' plus the enable-metrics hint on metrics_error. Tests: planner unit suite 530 passed, 1 skipped (was 525/1) -- 5 new webui tests for the strip container/tile ids, removed duplicate block, freeze-grace + pixel-bucket markers, and the sgl-project#147 saved-tile wiring. Page JS validated with esprima (parse OK).
2 of 5 tasks
2 of 20 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.
Related to #143.