Skip to content

feat: support silu_and_mul with triton - #1000

Closed
zhyncs wants to merge 2 commits into
sgl-project:mainfrom
zhyncs:act
Closed

zhyncs wants to merge 2 commits into
sgl-project:mainfrom
zhyncs:act

Conversation

@zhyncs

@zhyncs zhyncs commented Aug 9, 2024

Copy link
Copy Markdown
Contributor

Motivation

This should not be needed at the moment, just make a backup, do not merge.

Modification

Briefly describe the changes made in this PR.

Checklist

  1. Ensure pre-commit pre-commit run --all-files or other linting tools are used to fix potential lint issues.
  2. Confirm that modifications are covered by complete unit tests. If not, please add more unit tests for correctness.
  3. Modify documentation as needed, such as docstrings or example tutorials.

CI States

Latest PR Test (Base): ❌ Missing run-ci label -- add it to run CI tests.
Latest PR Test (Extra): ❌ Blocked -- run-ci is required first.

@zhyncs zhyncs closed this Aug 9, 2024
@zhyncs
zhyncs deleted the act branch August 9, 2024 09:33
efschu pushed a commit to efschu/htsglang that referenced this pull request Aug 29, 2026
sgl-project#798 calls itself "RANK-AGREED BY CONSTRUCTION" and it is -- for the DECISION.
What it does afterwards is not. `_pp_void_own_batch` deliberately leaves
`running_mbs` alone, "because the pass simply did not run, and it decodes
again next pass from the state it still holds". That retention is taken
rank-locally, it changes what the SLOT MEANS for the group, and nobody tells
the upstream.

Boot 46 read the result: sender and receiver both on slot 1, naming two
DIFFERENT requests -- ('054d07eb', 8192, 8470) = 278 rows against
('d72fbd70', 8192, 8494) = 302 tokens. Each side internally consistent; both
identity checks passed, because `mb_id` is the slot and not the occupant. The
surplus-receive reading of the same shape is excluded: it needs the receiver
BEHIND in slot index, and acceptance at :9017 proves the indices were equal.

Unconditional retention keeps a corpse -- once the upstream has moved the slot
on, nothing will ever be computed for the held request again, so the retention
protects no live work, only itself. Unconditional release is equally wrong,
and that is why this is not a revert: while the upstream still names the held
request, its resident decode work is exactly what the void was written to
preserve. The condition is the fix.

The signal is already on the wire, so this reads and adds nothing:
`_pp_admission_incoming_effective` is the upstream's rid set for the pass, and
it is reset to None unconditionally at the top of every pass ("a pass that
receives nothing must inherit neither half"), so a stale read is impossible by
construction and no freshness stamp is needed.

WHAT IS CUT HERE IS THE CONDITION, NOT THE RELEASE, and not out of caution in
general. `pp_queue_orphaned_chunked_req` carries an explicit legality argument
for a request displaced out of `self.chunked_req` -- "no door leads to it at
all". A resident decode request is not that animal: it is reachable through
`running_mbs`, and queueing it would be the double admission the same
docstring prohibits. Dropping wedged (corpse R), refusing wedged (sgl-project#995); a
third form that double-admits would be the third bill. Which of the two kinds
occupies the slot at the moment of divergence cannot be read from the desk, so
the probe reports it, and that field decides the shape of the release.

Denominator incremented before any return, every exit a named reason, every
reason counted -- so "did not fire" stays separable from "was never asked".
Emitted on the existing off-path admission site beside sgl-project#998/#997d, never on
the receive path.

Evidence: desk, executed. All six exits reachable plus out-of-range; MOVED-ON
can fire; seen == sum(reasons) == 8. Belegstufe: DESK-BEWIESEN.
efschu pushed a commit to efschu/htsglang that referenced this pull request Aug 29, 2026
…was measured first

sgl-project#1000 asked the wrong field. `_pp_admission_incoming_effective` carries rids
and is provably fresh, and it is EMPTY on every pass that is not an admission:
boot 47 counted 4361 empty against 8 voids, and the branch "occupant held AND
decision non-empty" never occurred once in 4372 passes. A field that carries
the right quantity and is empty on the path in question does not answer the
question. Freshness was checked; POPULATION was not. That check now runs
before the build, not after the boot.

The carrier was already there, and the send site already reads it:
`_pp_send_admission_decision(..., launched=self.mbs[mb_id] is not None, ...)`
is evaluated after `self.mbs[mb_id] = plan.batch_to_run`, so the occupant of
this pass is in scope at exactly that point -- reduced to a bool. This puts
the identity beside the bool. The message states its own population as a
contract ("SENT EVERY PASS, EVEN WHEN EMPTY") and is never gated on rank
position, and boot 47 measured it independently at 4361/4372 arrivals.

Cost, named before building: one dict key, at most eight rid strings, on a
message that already travels every pass. No new wire, no new rendezvous, no
arity change -- the same extension pattern sgl-project#978 used for its launched chain,
with an absent key reading as legacy behaviour.

Sentinel kept apart and proven over the real codec: absent key -> None ("this
sender said nothing" -- PP0, a legacy sender, a pass that heard nothing);
empty tuple -> "I hold nothing", a legitimate answer. They do not collide.

Still acts on nothing. The release stays uncut until the specimen says whether
the occupant is a chunked continuation (where the existing mover's legality
argument covers it) or resident decode work (where it does not).

Evidence: desk, executed. Six exits reachable, seen == sum(reasons) == 6,
sender helper returns (), ('x','y') and () out of range, sentinel round-trip
checked. Belegstufe: DESK-BEWIESEN.
efschu pushed a commit to efschu/htsglang that referenced this pull request Sep 1, 2026
…ot end a pass PP0 launched

`_pp_void_retracted_pass` let ONE downstream rank decide that the GROUP's
pass ran nowhere. Its own docstring named the return trip that made that
safe -- "the void output carries the observed local match home, and PP0's
guard learns it as a floor" -- and sgl-project#969 CUT V had already deleted that
emitter (`_PP_VOID_OUTPUT_KEY`: zero originating senders at ca0ee3a).
The verdict therefore travelled downstream only. PP0's `mbs[slot]` stayed
set while the last rank's did not, so no output was ever sent and PP0
blocked in `_do_recv` until the deadman -- the exact invariant `_do_recv`'s
own comment relies on ("sender and receiver ask one question of one batch").

Measured, twice, and the second is on the stall second itself:
  1068cap    07:34:02-09  sgl-project#797 void on rank 1 ONLY (no void/retract line on
                          PP0 or PP2); PP0 parked, PP2 spinning.
  1069cohort 08:00:54/55  sgl-project#791 unhonourable on PP1, told=12493 local=8397
                          then told=13399 local=12493 -- `local` exactly one
                          pass behind `told`. After 08:00:55 only ranks 1
                          and 2 emit at all (slot_occupant / output_fill /
                          width_agreement run to the takedown at 08:13:32,
                          4177 and 7973 lines; rank 0 emits nothing).

That last measurement also refutes the occupant-sleep node as the halting
member: ranks 1 and 2 are alive and turning; the `sgl-project#1000 SLOT-OCCUPANT
reasons={'no-statement'}` spin is an INERT probe whose carrier sgl-project#1015 EDIT-F
made permanently None. The only halting member is PP0's unbounded output
receive.

Repairing the return trip would repair a compensation layer for a rank-local
verdict, which is the arc the sgl-project#968 order forbids continuing; under
upstream-minimal the repair carries the burden of proof and the deletion does
not. So the verdict is deleted and the disagreement is DETECTED instead
(RAENGE-NIE-UNEINS: a detected divergence stops the group, never a
compensating wait):

  * `_pp_assert_told_honourable` replaces it -- an unhonourable told names
    rank, slot, rid, told and local and raises. No clamp: clamping to this
    rank's own local match is rank-local geometry, i.e. sgl-project#631.
  * The chain-receive throttle arm gets a horizon
    (SGLANG_PP_OCCUPANT_HORIZON_S, default 90 s, 0 disables) and a named
    stop. Taking the arm is legitimate and frequent; outliving it never is.
  * `PpChainReceiver.recv` is bounded the way its sibling `consume_up_to`
    already was (runaway guard + reported counter), and the launcher now
    sets SGLANG_PP_CHAIN_RECV_STALL_S=60 -- the sgl-project#824 mechanism has existed
    since 2026-08-24 and shipped disabled by default, which is why it never
    fired in either stall.

(A-i) is WITHDRAWN rather than built: its counter proof is blind at that site
(the rendezvous bumps `sent` only on recv entry) and the DEFER one-shot is
itself compensation for the rank-local verdict this commit deletes, so its
trigger is removed at the source. Its two red-first tests are replaced by
zombie tests for the deletion.

Desk evidence: hermetic import + AST (deleted verdict absent, watchman and
horizon present, recv bounded); test_968_deletion_falsifiers 24 passed,
1 failed -- test_C_the_void_relay_is_wired_or_deleted_but_never_half_built,
which stays red until the relay SYMBOLS are swept out too. The relay is
already unreachable at runtime (no rank originates a void any more, and
`_pp_absorb_void_output` has no caller in production), so that sweep is a
dead-code deletion scheduled beside this commit, not a runtime dependency of
it. Belegstufe: DESK-BEWIESEN. Boot pending.
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