Skip to content

Llava video - #423

Closed
ZhangYuanhan-AI wants to merge 19 commits into
sgl-project:mainfrom
ZhangYuanhan-AI:llava_video
Closed

ZhangYuanhan-AI wants to merge 19 commits into
sgl-project:mainfrom
ZhangYuanhan-AI:llava_video

Conversation

@ZhangYuanhan-AI

Copy link
Copy Markdown
Contributor

No description provided.

HanHan009527 pushed a commit to HanHan009527/sglang that referenced this pull request Apr 7, 2026
efschu pushed a commit to efschu/htsglang that referenced this pull request Aug 16, 2026
…fuses most of it

Design only, no build. Persistent file per Feature-Analysen-Pflicht:
docs/DESIGN_423_striped_spill.md.

## The prior, answered rather than routed around

The rejected register already carries a sibling and it is BLOCKED:
planner/rejected.py:469-487, `path_bundling` -- "one transfer striped over both
lines" -- with the note that only the CHOICE of line per message class is
released (sgl-project#240). Different axis (network lines vs storage tiers), but the
reasoning transfers, and this design reaches the same shape independently from
arithmetic rather than by analogy.

## Striping unit: the page

32,768 B = one token x 16 attention layers, which is already what BlobStore.put
/get speaks (gdn_slot_executor.py:104-133) and already canonical under the sgl-project#706
Option A contract. Per-row striping would need a second index the canonical
form deliberately does not have.

## Ratios: proportional to MEASURED bandwidth, bound to identity

share_i = bw_i / sum(bw). Rates reuse overlap_schedule.CardLink (NVML UUID +
PCI BDF, measured provenance, refuses unknown cards) rather than a second rate
table -- keying rates by position instead of identity already cost a full
analysis in sgl-project#690.

## THE GATE, and it refuses the motivating case

Striping buys parallelism only across DISJOINT links. A spill is device->host,
so it leaves ONE GPU and crosses THAT GPU's single PCIe link before reaching
any tier. The tiers sit BEHIND the shared link, not beside it, so striping does
not widen it.

  GATE: stripe only when aggregate destination bandwidth is BELOW the source
  link bandwidth.

On this rig (no P2P, all PHB, x4 + x8 + x8; measured 6.4 / 13 / 13 GB/s):

  GPU0 (x4, 6.4 GB/s)  vs host RAM ~10 GB/s   -> NO GAIN, link-bound already
  GPU1/2 (x8, 13 GB/s) vs host RAM ~10 GB/s   -> up to ~3 GB/s (~23%) by adding NVMe

The RAID-0 intuition ("n tiers, n x bandwidth") holds nowhere on this hardware.
The gain is bounded by link - fastest_single_destination, which the tiers
cannot widen.

## Failure semantics by volatility class

RAID-0 has no redundancy, so the rule follows from what a lost stripe costs:
reconstructible KV may stripe (a miss, then recompute); NON-RECONSTRUCTIBLE
state -- GDN recurrent state mid-sequence, live conversation state -- may NOT,
because striping multiplies failure probability with no recovery, and that is
exactly what TieredGdnBlobStore exists to preserve. A half-present blob is
worse than an absent one: absent is detectable, half-present may not be. Any
striped path therefore needs a per-object completeness marker, the same
requirement sgl-project#706 found for partial page writes and for the same reason.

## Recommendation

DO NOT build striping for device->host spill. Build the half that pays if
anything: tier CHOICE per volatility class -- reconstructible bulk to the slow
tier, non-reconstructible state to the fast durable one -- which needs no
stripe index, no completeness marker and no multiplied failure probability.

Revisit when a source appears whose link exceeds any single destination
(host->multi-NVMe is the plausible one). Sections 1, 2 and 4 are reusable as
written; only the gate needs re-evaluating, and it is written to be
re-evaluated rather than assumed.

Held for GO. If the operator wants the mechanism built anyway to be ready for
hardware that would benefit, that is a legitimate call -- made knowing the gain
here is zero on one card and <=23% on the others.
efschu pushed a commit to efschu/htsglang that referenced this pull request Aug 16, 2026
Closes the gap my own sgl-project#423 analysis named: BlobStore.put(session_id, blob) took
no class, and TieredGdnBlobStore bound ONE tier at construction, so every blob
from a store went to the same place regardless of what losing it would cost.
The sgl-project#423 recommendation -- reconstructible bulk to the slow tier,
non-reconstructible state to the fast durable one -- was therefore unbuildable.

WHAT CHANGED

put() gains `volatility` and `tier_hint`, both optional. Resolution order:
explicit hint, explicit per-class map, sgl-project#407 registry, default tier.

BACKWARD COMPATIBLE BY CONSTRUCTION: volatility=None resolves to the default
tier, so an unclassified put is the pre-sgl-project#711 path byte-for-byte and no caller
is forced to classify. Pinned by a test that a legacy put is NOT re-routed even
when a class map exists.

THE SAFETY RULE FROM sgl-project#423, ENFORCED: non-reconstructible state with no durable
tier configured STAYS LOCAL rather than shipping to the generic default.
Losing it kills the request, so in-process is strictly safer than a tier that
can lose it independently -- local dies only with the process, which is already
fatal for the session.

An unknown class is refused LOUDLY. A typo must not silently pick the default
tier; that is exactly the failure this ticket removes, reappearing as a
spelling mistake.

A BUG THIS FEATURE COULD EASILY HAVE INTRODUCED, caught and fixed: pop() read
from self._tier while put() may now write to a per-class tier, so a blob on the
durable tier would have been reported unrecoverable. The manifest now records
the DESTINATION and pop reads from the tier that wrote it. Pinned by a
round-trip test through a non-default tier.

Failure fallback preserved per class: a refusing tier still means "stay local",
not "lose the blob".

11 hermetic tests including the CAN-FAIL on the single-tier world -- with one
tier and no class map both classes resolve to the same destination, which is
the defect, pinned so the gap cannot silently reopen.

Note on lint: the new annotations follow the file's existing typing.Optional/
Dict style rather than collections.abc. The file is uniformly the older style;
mixing would be worse than matching. Baseline findings unchanged in kind.
WhiteCmile added a commit to WhiteCmile/sglang that referenced this pull request Dec 1, 2026
…h (issue sgl-project#423)

The P2 switch (default off) and everything only its on-branch reached:
the env read and require check in dt_direct_ring, the
_target_dest_at_launch attribute, the launch-time per-row
reserve/authorize of candidate destinations with its rollback helper,
the RingPublishLaunch.destinations and RingPublishWave.launch_destinations
carriers, and the cleanup/park branches that consumed them.  The park-side
destination path (today's default) is unchanged.  Tests that only
exercised flag-on behaviour go with it; the at-launch publish tests that
guard the default path stay.
WhiteCmile added a commit to WhiteCmile/sglang that referenced this pull request Dec 1, 2026
Both deleted neighbouring flags: drop DT_TARGET_DEST_AT_LAUNCH (sgl-project#423) and
DT_RING_PUBLISH/_AT_LAUNCH (sgl-project#437) together; the Target no longer imports
anything from dt_direct_ring at that spot.

Co-Authored-By: Claude Opus 5.5 <[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.

2 participants