Skip to content

add cert functionality - #223

Closed
nivibilla wants to merge 1 commit into
sgl-project:mainfrom
nivibilla:ssl_cert
Closed

nivibilla wants to merge 1 commit into
sgl-project:mainfrom
nivibilla:ssl_cert

Conversation

@nivibilla

Copy link
Copy Markdown
Contributor

No description provided.

@nivibilla nivibilla closed this Feb 23, 2024
@nivibilla
nivibilla deleted the ssl_cert branch February 23, 2024 18:39
@nivibilla

Copy link
Copy Markdown
Contributor Author

made by mistake, see #224 for the new PR

vschandramourya pushed a commit to vschandramourya/sglang that referenced this pull request Feb 3, 2026
IzacharyI pushed a commit to IzacharyI/sglang that referenced this pull request Mar 18, 2026
IzacharyI added a commit to IzacharyI/sglang that referenced this pull request Mar 31, 2026
* Move and adaptation of GDN opt from Qwen3next to Qwen3.5 (sgl-project#215)

* rm 3*copy after casual conv, do q/k/v split in causal_conv1d_update_split_qkv kernel during decode time

* Add fused Sigmoid and mul triton kernel

* add fused gdn gating and  sigmoid func for prefill phase

* Add fused causal conv1d fwd split qkv kernel

* Add fused cumsum_kkt, solve_tril, and merge_recompute kernels for prefill optimization

* Increase parallel params for chunk_gated_delta_rule_fwd_kernel

* add chunk o kernel opt

* Add sigmoid and mul for shared expert module

---------

Co-authored-by: yixionghuo <[email protected]>

* [Fix] Load weights error in compressed-tensors

* Fuse 4 GDN input projections (qkv/z/b/a) into single GEMM (sgl-project#219)

* Revert "Fuse 4 GDN input projections (qkv/z/b/a) into single GEMM (sgl-project#219)" (sgl-project#223)

This reverts commit 17b0749.

* Fuse 4 GDN input projections (qkv/z/b/a) into single GEMM (sgl-project#225)

* [Fix] Core dump issue in stress test

---------

Co-authored-by: zachYao <[email protected]>
Co-authored-by: root <[email protected]>
rucnyz added a commit to rucnyz/sglang that referenced this pull request Jun 7, 2026
…a pegged subpool

Root cause of the ours_full A3 daemon arm being net-negative (agents starve,
5/32 trials, resume=0): two coupled over-restrictions made resume structurally
impossible whenever a subpool is permanently pegged (A3 swa ~0.99).

1. joint_decide: the pressure and resume phases were MUTUALLY EXCLUSIVE — the
   pressure phase ran whenever ANY subpool crossed theta_hi, and resume lived
   only in the else-branch. With swa pegged the pressure phase is always
   active → resume never fired → the daemon paused monotonically and agents
   starved. Fix: extract _resume_plan() and run it ALONGSIDE the pressure
   plan (return plan + _resume_plan()). Admission becomes a feedback
   controller — pause the heavy programs, resume the ones that fit, as running
   programs finish and free capacity — instead of monotonic pausing.

2. capacity_fits: rejected even a ZERO-re_use resume because the pegged
   subpool already exceeds theta_hi from OTHER programs' load
   (forecast + 0 > theta_hi·cap). A resume that adds 0 bytes to a subpool
   can't make it worse, so it must not be blocked by pressure it doesn't
   contribute to. Fix: skip zero-add subpools; gate only the ones the resume
   actually grows. This is the un-starve path for dropped-units programs.

Net contract: a paused program resumes as soon as IT fits per-subpool
(zero weight on the pegged axis), regardless of pressure on other axes; a
program that WOULD grow the pegged subpool stays suppressed (stage D). So the
plan under pressure carries BOTH the pressure response AND the un-starve
resume.

verify/joint_decide stage D-press-resume pins it (dropped-units program
resumes even under pressure; pressure still acted on). Mutation-tested: both
the decouple and the capacity_fits relaxation are independently necessary.
Stage D (suppress non-fitting resume), D-starve, admission_controller all
still green.

Still open for A3 do-no-harm: TOCTOU evict-storm on hot session-tail leaves
(sgl-project#223), and a real-stack smoke to confirm resume>0 + agents progress.
rucnyz added a commit to rucnyz/sglang that referenced this pull request Jun 7, 2026
The live ours_full A3 arm produced ~956 remove_hbm_not_device_leaf/cycle with
migrate_applied=0.  Debug-log probe in _dispatch_plan showed every dispatched
remove-HBM had daemon_leaf=True, residence=[HBM], add=[] remove=[HBM] (a
DROP).  It is NOT a filter bypass (the sgl-project#210 filter correctly passes them —
they ARE device leaves at dump time): it's a dump-vs-apply TOCTOU.  A
device-leaf popular-prefix node gains a device-KV child before the migrate
applies (a concurrent request extends that prefix), so the remove is rejected
at apply.  The dump keeps reporting it as a leaf, so it is re-proposed every
event → a systematic reject storm.  (The age distribution refuted a "hot
session-tail" hypothesis — the DROP targets are mid-age popular prefixes, so
the right fix is reactive, not a recency guard.)

Fix: on a leaf-reject APPLY_FAILED (remove_*_not_*_leaf / remove_not_leaf) the
handler cools the failed hash down (router.evict_cooldown, wall-clock backoff,
AGINFER_EVICT_COOLDOWN_S=5s).  kv_scheduler.handle drops any REMOVE migrate
for a cooled hash before dispatch (pure-ADD migrates for the same hash still
pass — only the failing op is backed off) and prunes expired entries.  So a
doomed remove is proposed at most once per cooldown window instead of every
event; when the node stabilises (gains a host backup) or sglang evicts it
itself, the cooldown expires and it can be migrated again.  Backoff, not value
math — wall-clock is acceptable (DESIGN §10 forbids time.* only in the V_u
transition path).

verify/kv_scheduler_value_rule stage G0 pins _filter_cooled_evicts (cooled
REMOVE dropped, cooled pure-ADD kept, non-cooled/expired kept).  25/25 +
joint_decide + admission green.

Pairs with sgl-project#213 (decouple resume from pressure).  Next: real-stack smoke to
confirm resume>0 + apply_failed≈0 + agents progress (A3 do-no-harm).
rucnyz added a commit to rucnyz/sglang that referenced this pull request Jun 7, 2026
… tail (proactive)

The value-gate does NOT structurally fix sgl-project#223: evicting the hot session tail
to DRAM is net-POSITIVE (HBM holding at high occ is dear, DRAM preserves the
bytes), so cost<0 and the relief knapsack takes it. But it is FUTILE — at
TOOL_CALL_END the session resumes and extends the tail, the frontier leaf
gains a device child by apply time, and sglang rejects
remove_hbm_not_device_leaf (dump→apply TOCTOU, ~10^2-10^3 wasted removes/cycle).
This is against the §7 decision-set table's intent (TOOL_CALL_END tail = a
PROMOTE candidate, "about to reuse").

Fix: joint_decide relief adds condition (c) — suppress remove-HBM for a
reuse-imminent (TOOL_CALL_END) tail. Genuine HBM pressure is relieved by the
MEMORY_PRESSURE events' cold-unit top-k, not by evicting the hot frontier.
The per-hash cooldown (committed earlier) stays as the reactive backstop for
the residual same-tick race on the pressure path.

Deep test: verify/joint_decide stage K (TOOL_CALL_END hot tail under pressure
→ no remove-HBM; same unit under MEMORY_PRESSURE → still evictable, relief not
crippled). DESIGN §9 relief filter documents condition (c).
rucnyz added a commit to rucnyz/sglang that referenced this pull request Jun 7, 2026
…guard to SUB_RETURN when implemented (audit observation)
rucnyz added a commit to rucnyz/sglang that referenced this pull request Jun 9, 2026
…ding holders

Kills the TP=4 A3 remove_hbm_not_device_leaf reject storm (1384/cycle,
187 hot units re-failing ~15x). Root cause is persistent TOCTOU, not a
mis-identification: a session-tail leaf is a device-leaf *at dump time*
only in the brief gap between an active program's forward passes (its
lock_ref oscillates per pass; the dump samples a released instant). By
apply time the state is up to ~840ms stale and the holder has re-locked
its tail, so sglang rejects.

Fix: gate on the program-level signal, which is STABLE across the
per-pass oscillation. _holder_actively_decoding(u, state) returns True
iff any holder pid has T26 per_program_usage[pid].hbm.inflight > 0 (a
request in the running batch). migrate_candidates skips remove-HBM for
such units, after the existing sgl-project#210 structural leaf guards. Node-level
lock_ref is the wrong signal (0 at the dump instant). Tool-parked
holders (inflight empty) keep their idle tail evictable -- the core
demote-during-the-tool-gap relief. Absent/cold-start inflight never
suppresses.

Layers cleanly with sgl-project#223 (reactive post-reject cooldown) and sgl-project#210
(structural leaf guards); sgl-project#224 is the proactive complement.

Audit (sgl-project#225 follow-ups): holders come from add-only session_ids, so the
guard slightly over-approximates (safe direction -- forgoes a valid
demote, never proposes an invalid one); bounded small under temp-0
linear agentic decode. Re-run must confirm migrate_applied>0 + HBM occ
drops, not merely that rejects fell to zero.

Tests: verify/joint_decide A-inflight (active blocked, parked/zero/
no-hbm/cold preserved, shared + multi-subpool blocked). DESIGN.md
§7/§9 apply-feasibility pre-filter subsection. All pure suites green.
rucnyz added a commit to rucnyz/sglang that referenced this pull request Jun 9, 2026
…ler interface

Pre-existing breakage at HEAD (not from sgl-project#224/sgl-project#227/sgl-project#228): the t40 stub
policy/router lagged the kv_scheduler.handle() interface that evolved
with the §9 joint_decide wiring.

  * _DeclinePolicy / _MigratePolicy: add costs=default_costs() + pi_u
    (handle() reads policy.costs/policy.pi_u for the §7 migrate
    candidate generator; real OursGreedyPolicy carries both).
  * _FakeRouter: add theta_hi/theta_lo (admission thresholds) +
    heartbeat_s (§8 forecast horizon).
  * B1b "hints alongside a migrate": post-sgl-project#194 the migrate comes from
    value-gated joint_decide, not the policy Action — so drive genuine
    HBM pressure (95% occ + h_max>0) and use MEMORY_PRESSURE, NOT
    TOOL_CALL_END (whose sgl-project#223 reuse-imminent carve-out suppresses the
    tail demote).  _state_json gains optional pressure/h_max knobs
    (defaults preserve prior behavior).

Production unaffected (real policy/router always had these). T40 17/17
green (1 e2e skipped).
rucnyz added a commit to rucnyz/sglang that referenced this pull request Jun 18, 2026
…r — the decision-loop foundation

The sgl-project#251 blocker (verified): the value model is in-engine but INERT — nothing in
python/sglang/srt/ calls joint_decide; the decision brain still runs out-of-process in
the daemon over HTTP. This starts relocating it.

New: python/sglang/srt/mem_cache/aginfer/scheduler_driver.py — AginferDriver, the
in-engine decision entry. Increment 1 extracts the PURE post-joint_decide decision
subsystem (no transport):
  - update_demote_apply_rate(units): the sgl-project#240 saturation-yield apply-rate EMA.
  - decide(...): runs the in-engine joint_decide, then the sgl-project#223 evict-cooldown filter
    and the sgl-project#240 saturation yield; returns the final plan (empty = no-op = do-no-harm).
  - filter_cooled_evicts: the sgl-project#223 filter, single-sourced here.

daemon/kv_scheduler.py now DELEGATES to the driver (behaviour-identical): the inline
handle() decision block (joint_decide + filters), _update_demote_apply_rate, the
remove-HBM pending-demote record, and _filter_cooled_evicts all route through
AginferDriver. The daemon still does fetch + dispatch (next increments).

Tests (the user-mandated regression net):
  - NEW verify/scheduler_driver: 16 server-free checks — EMA up/down/grace/relax,
    sgl-project#223 cooldown filter, sgl-project#240 yield (strips remove-HBM, keeps promote/non-HBM,
    no-op when EMA healthy = do-no-harm), daemon-delegates-to-driver identity.
  - Regression GREEN, unchanged: kv_scheduler_value_rule (25 stages, exercises the
    delegated filter + decide latency), joint_decide (incl sgl-project#223/sgl-project#215), admission_controller
    (8), s2_holder_scorer. integration_stress needs a live GPU stack (not run here).

Impl_PLAN.md §8 refreshed with the adversarially-verified roadmap: the blocker, the
mandatory admission→router split, the 9-step ordered plan, and the hard unsolved problems
(driver cadence under load, dump latency, cross-rank admission, crash isolation).
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant