Skip to content

Fix openai speculative execution - #456

Merged
Ying1123 merged 3 commits into
mainfrom
fix-spec
May 21, 2024
Merged

Ying1123 merged 3 commits into
mainfrom
fix-spec

Conversation

@Ying1123

Copy link
Copy Markdown
Contributor

No description provided.

@Ying1123
Ying1123 merged commit 3e684be into main May 21, 2024
@Ying1123
Ying1123 deleted the fix-spec branch May 21, 2024 00:01
@Ying1123 Ying1123 linked an issue May 21, 2024 that may be closed by this pull request
timethink pushed a commit to timethink/sglang that referenced this pull request Mar 9, 2025
vschandramourya pushed a commit to vschandramourya/sglang that referenced this pull request Feb 3, 2026
* Tool choice behavior.

* format

* Update python/sglang/private/server_args.py

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

---------

Co-authored-by: Copilot <[email protected]>
efschu added a commit to efschu/htsglang that referenced this pull request Aug 3, 2026
…ied for quantized experts (sgl-project#306)

Entropy-proven dead for GGUF expert bytes (H0 7.91-7.95 b/B, ceiling ~1.01,
measured 1.03 best); FP8 1.211x / INT8 1.131x survive only as pipelined
movers on <=2.83 GB/s links (both at their entropy ceilings); byte-plane
split trades ratio for sub-link decompress rates; ZFS already takes the
disk-image win. One free finding: hibernate sparse-write (12.64% zero
pages) -> sgl-project#456. 2064 verified round-trips, break-even formulas in the doc.
efschu added a commit to efschu/htsglang that referenced this pull request Aug 3, 2026
…e by default

SparseFileWriter sits under the torch.save container (python/sglang/srt/model_loader/sparse_write.py):
a byte sink that reads holes back as zeros, restore path untouched, HIBERNATE_VERSION
stays 2. Default is sparse; SGLANG_HIBERNATE_DENSE_WRITE=1 is the escape hatch back to
the prior dense write, which the rig-runbook documents as the better choice on this rig
(deliberate, not a contradiction).

Re-prices the sgl-project#306 lossless-ratio projection against a filesystem that already folds
zeros. Tests: tests/hibernate/test_sparse_write_456.py.

BOOT-PENDING: a real park/restore roundtrip on GPU state (DESIGN_456 §7) has not run;
tracked as an open GPU posten, not a merge blocker.
efschu added a commit to efschu/htsglang that referenced this pull request Aug 3, 2026
…annotation

ruff --select=UP037 flags the quoted self-reference as redundant under
this module's existing 'from __future__ import annotations'.
efschu pushed a commit to efschu/htsglang that referenced this pull request Aug 22, 2026
…the order does not matter

sgl-project#809 asks for a hybrid residency of the phase-flip weight images: a small
pinned share (a "hot head, in wave order"), the rest file-backed as today, and
a reload with prefetch overlap on the sgl-project#125 double-buffer pattern. The prior-art
gate falsified two of those three, and the third rests on a comparison nobody
has run. Recording that before writing code, because the cheapest outcome here
is the one where nothing is rebuilt.

THE OVERLAP IS ALREADY SHIPPED. `_staged_file_refill` (sgl-project#802, landed
2026-08-22, weights_arena.py:522) reads the file-backed image with bounded
preadv into sgl-project#720's pinned ring and overlaps the next chunk's read with the
previous chunk's H2D DMA -- depth streams, depth events, an inflight flag, and
a synchronize before a buffer is refilled. The depth is
SGLANG_PHASE_FLIP_REFILL_DEPTH, default 2: literally a double buffer.
Rebuilding it would be the sgl-project#720-verbatim mistake in a new place.

THERE IS NO HOT HEAD. `arena_refill` copies the whole payload and only then
checksums it; nothing reads the arena before that checksum passes. There is no
partial publication and no per-wave consumption, so WHICH bytes are pinned
cannot matter -- only HOW MANY. sgl-project#254's wave order exists because a MoE forward
consumes experts wave by wave; a flip consumes the arena once, whole. A "hot
head selection" would be a knob with no effect.

TWO OF THE THREE CITED NUMBERS ARE NOT IN THIS TREE. Grepped as rates over
python/sglang/srt/ and docs/dev/: zero hits for 2850, 4263, 1763 and 1844 as a
MiB/s, MB/s or GB/s figure, and the near-misses are named in the note so the
next reader does not "find" them by accident (1763 is a byte budget in an
affordability check and an NVML corridor floor; 1844 is a seam-staging free
memory delta). The pinned figure IS real: _PINNED_REF_LO_GBPS / _HI_GBPS =
4.93 / 8.88, phase_flip_boot.py:502-509. What the numbers that DO exist say:
pinned 4.93/7.08/8.88 GB/s per rank (sgl-project#690) against staged O_DIRECT 2651/2602/
3751 MiB/s per rank in the real flip on metal (sgl-project#802), i.e. roughly 1.8-2.6x --
but from two separate campaigns, never against each other, and the note says so
rather than presenting it as an A/B.

COMPRESSION IS DISCARDED, WITH THE ARITHMETIC, not deferred. This tree's own
ANALYSE_306 already ends "do not build sgl-project#306 as a codec", and sgl-project#456's sparse
write records a 0 byte win on /spinning because ZFS folds the same holes --
which is where the flip images live. Independently, at ratio 1.145 the bytes
saved are 12.7%, so a serial win needs decompression at 7.9x the read rate (64
GiB/s synthetic, 20-29 GiB/s at metal rates) and even a fully overlapped one
needs 9.29 GiB/s per rank, 10.07 GiB/s aggregate across three concurrent ranks.
The measured decompression ceiling in ANALYSE_306 is 4.3-4.8 GB/s. Both bars
are out of reach by 2-13x.

THE DANGER DIRECTION, AND THE ONE POSITION THIS DOES NOT REVERSE. The
file-backed arm exists so ~68.7 GiB of unreclaimable host RAM cannot OOM-kill a
swapless boot, and it refuses a missing or tmpfs image dir rather than
"silently allocating a pinned image the host ledger would then double-count as
reclaimable". The tree has ALREADY decided that image posts are registered but
not checked -- "a new refusal path here could break a boot that works today",
weights_arena.py:918-924. That decision stands. It does not bind a new,
opt-in, default-off pinned share, for its own stated reason: refusing a share
no current boot requests cannot break a boot that works today. So only the new
share may be checked, and a hybrid image must register exactly its pinned head
and nothing else, because the file-backed bytes are deliberately unregistered
(the registry sums NON-reclaimable bytes).

THE HAZARD ANY IMPLEMENTATION MUST HANDLE, recorded because it is silent:
_staged_file_refill takes O_DIRECT only when `at % 4096 == 0`. If reads resume
at an unaligned pinned-head boundary, EVERY chunk misses that test, the whole
refill falls back to the buffered fd -- 8304 -> 2595 MiB/s, a 3.2x regression
with no error and no log line -- and the pinned head costs more than it saves.
The head must be floored to _DIRECT_ALIGN.

NOT BUILT HERE, deliberately: the share's size is the whole feature, and the
comparison that would set it (pinned vs staged-O_DIRECT on ONE binary, same
load, same bytes) has never been run. A size derived from the two-campaign
mixture above would be the rig-fit the planner rules forbid, and shipping the
actuator with the size left as an unmeasured parameter would put a knob in the
tree nobody can set -- while a helper with no caller is exactly the defect
removed from planner/hicache_staging.py in this same branch. The A/B is named
as a window item, with the instrumentation that already exists for it
(_timed_arena_refill / refill_report).

Analysis only: no code changes, no test changes, no behaviour change.
codespell clean.
1195343015 pushed a commit to 1195343015/sglang that referenced this pull request Nov 30, 2026
…atalog (release/v0.5.23) (sgl-project#462)

* [CI] [PPU] recipe: Add multi-variant 810E coverage and expand model catalog (release/v0.5.23)

Port sgl-project#456 (51ca333) from yuhe/v1.0.0 onto release/v0.5.23 with zero
drift on existing ZW-M890P CI policies, preserving release/v0.5.23
v0523-* workflow/artifact naming, build_and_test.sh test legacy entry,
and sgl-project#460 fail-closed/keepalive fixes. Keeps scripts/ci/ppu/ppu_recipe.py
byte-identical to yuhe/v1.0.0@4da5838ffc (SHA-256
6b157d5d212acbc0646bf480753e16bdb4a801341a2f8845e51e3820c3b86acf).

Refs sgl-project#277

Signed-off-by: Yunzshi310 <[email protected]>

* [Fix] [PPU] recipe-ci: Support v0.5.23 ServerArgs parity fallback and reject IPv4 runtime_versions

Fix both Round-1 P1 findings:
1. Use getattr(sa_mod, 'SERVER_ARGS_SECRET_FIELD_NAMES', ()) in
   ppu_recipe.py (_build_sglang_serve_parser and
   verify_secret_flag_registry_parity) so release/v0.5.23 Pods running
   validate --all --require-sglang-parser do not fail with AttributeError.
2. Tighten VERSION_RE / SAFE_VERSION_RE / BASE_VERSION_RE from {1,3} to
   {1,2} in recipe_publish.py and recipe_container.sh to reject bare
   IPv4-shaped dotted quads (e.g. 10.20.30.40) from public artifacts.

New scripts/ci/ppu/ppu_recipe.py SHA-256:
ddb4ee4113cb4cf6a1f592b849db569c9289e5efe1bbe67509085c97390b0f63

Refs sgl-project#277

Signed-off-by: Yunzshi310 <[email protected]>

* [CI] [PPU] recipe-ci: Raise DeepSeek-V4-Flash model_sanity ready timeout to 6000s

DeepSeek-V4-Flash W8A8 DSPARK TP8 cold weight loading plus warmup on OAM-810E reached 2396s against the 2400s default model_sanity readiness budget. Raise MODEL_SANITY_READY_TIMEOUTS["deepseek-ai/DeepSeek-V4-Flash"] to 6000s alongside the 810E catalog backport while keeping ppu_recipe.py untouched.

Signed-off-by: Yunzshi310 <[email protected]>

---------

Signed-off-by: Yunzshi310 <[email protected]>
Torches97 pushed a commit to Torches97/sglang-for-sail that referenced this pull request Dec 1, 2026
…atalog (sgl-project#456)

* [CI] [PPU] recipe: Add multi-variant 810E coverage and expand model catalog

Integrates and refactors sgl-project#430 onto the sgl-project#420 multi-variant ppu-serving/v1 schema (thanks @Soda4542).

- Add OAM-810E board scheduling (1/4/8/16 cards), accuracy_<key>_<chip>.json golden resolution, and baseline_established: false collection until 810E goldens land
- Add a 2-machine OAM-810E pr_default gate in recipe_select.py (default PR fast_sanity runs <=3 core policies; touched or filtered 810E models expand on demand; nightly runs all 8)
- Consolidate 810E variants for DeepSeek-V4/V4.1/V4-Pro (using T-HEAD/DeepSeek-V4-Pro-0813-W4A8 <=96 chars plus static w8a8_810e catalog), GLM-5.3-Flash (+ 890P fp8), Kimi-K2.6, MiniMax-M3, Qwen3.8-27B, Qwen3.8-Flash-Next, and static GLM-5.3 w8a8_810e with zero 890P drift
- Add MiniMax-M3.1-Flash (890P fast_sanity + static 810E catalog) and static public catalogs for Kimi-K3, Kimi-K3.1, Qwen3.5-397B-A17B, and Qwen3.8-2.4T-A95B

Refs flytiger-eco#277

* [CI] [PPU] recipe: Enforce board/hardware admission and checked-in golden gate

Refs flytiger-eco#277

* [CI] [PPU] recipe: Fix 810E fast_sanity probe/JIT timeout and isort lint

Signed-off-by: Yunzshi310 <[email protected]>

* ci(ppu): move deepseek-v4-flash-810e-w8a8 to nightly model_sanity

Signed-off-by: Yunzshi310 <[email protected]>

---------

Signed-off-by: Yunzshi310 <[email protected]>
Torches97 pushed a commit to Torches97/sglang-for-sail that referenced this pull request Dec 1, 2026
…atalog (sgl-project#456)

* [CI] [PPU] recipe: Add multi-variant 810E coverage and expand model catalog

Integrates and refactors sgl-project#430 onto the sgl-project#420 multi-variant ppu-serving/v1 schema (thanks @Soda4542).

- Add OAM-810E board scheduling (1/4/8/16 cards), accuracy_<key>_<chip>.json golden resolution, and baseline_established: false collection until 810E goldens land
- Add a 2-machine OAM-810E pr_default gate in recipe_select.py (default PR fast_sanity runs <=3 core policies; touched or filtered 810E models expand on demand; nightly runs all 8)
- Consolidate 810E variants for DeepSeek-V4/V4.1/V4-Pro (using T-HEAD/DeepSeek-V4-Pro-0813-W4A8 <=96 chars plus static w8a8_810e catalog), GLM-5.3-Flash (+ 890P fp8), Kimi-K2.6, MiniMax-M3, Qwen3.8-27B, Qwen3.8-Flash-Next, and static GLM-5.3 w8a8_810e with zero 890P drift
- Add MiniMax-M3.1-Flash (890P fast_sanity + static 810E catalog) and static public catalogs for Kimi-K3, Kimi-K3.1, Qwen3.5-397B-A17B, and Qwen3.8-2.4T-A95B

Refs flytiger-eco#277

* [CI] [PPU] recipe: Enforce board/hardware admission and checked-in golden gate

Refs flytiger-eco#277

* [CI] [PPU] recipe: Fix 810E fast_sanity probe/JIT timeout and isort lint

Signed-off-by: Yunzshi310 <[email protected]>

* ci(ppu): move deepseek-v4-flash-810e-w8a8 to nightly model_sanity

Signed-off-by: Yunzshi310 <[email protected]>

---------

Signed-off-by: Yunzshi310 <[email protected]>
1195343015 pushed a commit to 1195343015/sglang that referenced this pull request Dec 2, 2026
…atalog (sgl-project#456)

* [CI] [PPU] recipe: Add multi-variant 810E coverage and expand model catalog

Integrates and refactors sgl-project#430 onto the sgl-project#420 multi-variant ppu-serving/v1 schema (thanks @Soda4542).

- Add OAM-810E board scheduling (1/4/8/16 cards), accuracy_<key>_<chip>.json golden resolution, and baseline_established: false collection until 810E goldens land
- Add a 2-machine OAM-810E pr_default gate in recipe_select.py (default PR fast_sanity runs <=3 core policies; touched or filtered 810E models expand on demand; nightly runs all 8)
- Consolidate 810E variants for DeepSeek-V4/V4.1/V4-Pro (using T-HEAD/DeepSeek-V4-Pro-0813-W4A8 <=96 chars plus static w8a8_810e catalog), GLM-5.3-Flash (+ 890P fp8), Kimi-K2.6, MiniMax-M3, Qwen3.8-27B, Qwen3.8-Flash-Next, and static GLM-5.3 w8a8_810e with zero 890P drift
- Add MiniMax-M3.1-Flash (890P fast_sanity + static 810E catalog) and static public catalogs for Kimi-K3, Kimi-K3.1, Qwen3.5-397B-A17B, and Qwen3.8-2.4T-A95B

Refs sgl-project#277

* [CI] [PPU] recipe: Enforce board/hardware admission and checked-in golden gate

Refs sgl-project#277

* [CI] [PPU] recipe: Fix 810E fast_sanity probe/JIT timeout and isort lint

Signed-off-by: Yunzshi310 <[email protected]>

* ci(ppu): move deepseek-v4-flash-810e-w8a8 to nightly model_sanity

Signed-off-by: Yunzshi310 <[email protected]>

---------

Signed-off-by: Yunzshi310 <[email protected]>
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.

Refactor the openai speculative execution module in interpreter

2 participants