Skip to content

Avoid implicit field-based side channel in Scheduler planning - #29408

Merged
fzyzcjy merged 25 commits into
mainfrom
tom/refactor-scheduler-batch-field/op5
Jul 10, 2026
Merged

fzyzcjy merged 25 commits into
mainfrom
tom/refactor-scheduler-batch-field/op5

Conversation

@fzyzcjy

@fzyzcjy fzyzcjy commented Jun 26, 2026 •

Copy link
Copy Markdown
Collaborator

get_next_batch_to_run and its callee tree (plus the disaggregation analogues get_next_disagg_prefill_batch_to_run / get_next_disagg_decode_batch_to_run and their trees) used self.cur_batch / self.last_batch / self.running_batch as an implicit in/out side channel. This PR makes those reads and writes explicit: the batch state is passed in as parameters and returned out via a NextBatchPlan struct. The fields stay on self (they have legitimate readers elsewhere), but the planning methods no longer touch them.

  • get_next_batch_to_run(running_batch, last_batch) -> NextBatchPlan; callers store plan.running_batch back and run plan.batch_to_run.
  • The leaf builders (get_new_batch_prefill, the disagg roots) thread running_batch in and out the same way; get_new_batch_prefill returns a NextBatchPlan like the others.
  • A guard test (test_scheduler_decision_batch_params.py) asserts via inspect.getsource that these methods take the batches as explicit parameters and contain no self.running_batch / self.last_batch / self.cur_batch token — turning "no hidden channel" into an executable invariant.

Mental model: the scheduler's core will eventually be split out (e.g. a stateless SchedulerPlanner); this removes the hidden coupling that would make such a split leak self.* access.

No behavior change: the event loops still own the fields and update them every iteration from the returned plan.

Equivalence audit

Verified behavior-preserving by an independent read-only Codex audit (verdict: PROVEN). It confirmed that for every changed signature the caller passes the same value previously read from self.* and writes the returned running_batch back to the same field at the same point in the loop — including the PP running_mbs[mb_id] slots, the disagg prefill/decode trees, and the MLX/pd-mux paths — and that no returned plan is dropped.

Known residual (not a behavior change): the DLLM prefill helpers (dllm/mixin/scheduler.py) still read self.running_batch internally after assigning it, so that branch is outside the guard test's scope. Codex confirmed it mutates the same ScheduleBatch object without rebinding, so behavior is unchanged; fully threading it is a follow-up.


CI States

Latest PR Test (Base): 🚫 Run #29061151142
Latest PR Test (Extra): 🚫 Run #29061150984

fzyzcjy added 11 commits June 26, 2026 16:07
…h slots

abort_request's "method 3" (aborting already-running requests) scanned only
self.running_batch plus a stale self.cur_batch. Under pipeline parallelism the
scheduler keeps per-microbatch-slot state in running_mbs[] / mbs[], and at abort
time self.running_batch is aliased to just the current slot while self.cur_batch
holds the previous step's batch. So an abort (or abort_all) only reached requests
in the current slot and the previous one; requests decoding in any other slot's
running_mbs (or still in flight in mbs) were never marked FINISH_ABORT and kept
running to completion. This only manifests with more than two microbatch slots,
since with two the current and previous slots already cover both.

Fix: under PP, scan every running_mbs and mbs slot (id-deduped); the non-PP path
keeps scanning running_batch + cur_batch as before.

Add a scripted-runtime regression test (pp_size=4, pp_max_micro_batch_size=1) that
forces one decode request into each microbatch slot and asserts abort_all releases
all of them.
Two independent cur_batch reads are dropped/replaced, both behavior-preserving:

1. is_fully_idle: the `self.cur_batch is None or self.cur_batch.is_empty()` term
   never changes the result.
   - Under PP it is a subset of self._pp_microbatches_drained() (which scans every
     running_mbs and mbs slot), so it is already covered.
   - Without PP, every is_fully_idle caller runs at the top of the event loop
     (flush, health check, weight update, pause), where self.cur_batch and
     self.last_batch both hold the previous iteration's batch and are therefore
     equal -- so the adjacent last_batch term already covers it.
   Drop the redundant term.

2. abort_request: the non-PP branch reads self.last_batch instead of
   self.cur_batch. abort runs at the top of the loop before the next batch is
   assigned, so cur_batch still holds the previous iteration's batch and equals
   last_batch -- the two reads are identical here.
…state

`self.cur_batch` was a scheduler-wide attribute written by every event loop
(normal, overlap, PP, disagg prefill/decode, MLX) but its only cross-thread
reader is the watchdog, which uses it purely as a debugging signal
(`is_active` / `dump_info`). All in-loop consumers can read the batch from a
local instead.

Rename the field to `cur_batch_for_debug` to make the watchdog its sole
legitimate user, and stop every other site from depending on it:

- `launch_batch_sample_if_needed` now takes the current batch as a parameter
  instead of reading `self.cur_batch`; all three callers pass their local
  `batch`.
- The PP loops bind a local `cur_batch` and only mirror it into
  `cur_batch_for_debug` for the watchdog; `_pp_launch_batch` takes that local
  `cur_batch` as a parameter instead of reading `self.mbs[mb_id]`.

Tests that poke the attribute directly are updated to the new name.
…thods

First step of removing the hidden self.*_batch in/out channel from the
scheduling decision tree: get_next_batch_to_run, is_disable_overlap_for_batch,
process_prefill_chunk, and get_next_disagg_prefill_batch_to_run no longer read
self.last_batch. Each takes last_batch as an explicit parameter, and every
caller passes it (the event loops pass self.last_batch; PP passes the value it
already loaded from its microbatch slot). The field stays on self for its other
readers (pause, observers, invariant checker). Behavior-preserving.
Continue removing the hidden self.running_batch in/out channel, starting from
the leaves of the decision tree:

- get_new_batch_prefill / _get_new_batch_prefill_raw take running_batch and
  return (new_batch, running_batch); the MIXED-chunk reset now rebinds the local
  and is returned to the caller instead of overwriting self.running_batch.
- _abort_on_running_timeout and get_new_prebuilt_batch take running_batch as a
  read-only parameter.

Every caller (the decision-tree roots, the PP / disagg / pd-mux event loops, and
the direct-call unit tests) passes self.running_batch and stores the returned
value back. The roots still touch self.running_batch for their own logic; that
is removed in the following commits.

The dllm subtree (get_new_batch_dllm and its helpers) is experimental and not
exercisable on the current hardware, so it is left intact behind a single
running_batch sync at get_new_batch_dllm's entry rather than threaded through.
Behavior-preserving.
…lf.running_batch

get_next_batch_to_run now takes running_batch and last_batch as explicit
parameters and returns a NextBatchPlan(batch_to_run, running_batch) struct; its
body no longer reads or writes self.running_batch / self.last_batch. The MIXED
chunked-prefill running reset and the decode update now flow out through the
returned plan.

Every caller (event_loop_normal, event_loop_overlap, the PP loop, the MLX
overlap loop, and the direct-call unit tests) passes self.running_batch and
stores plan.running_batch back to the field it owns (running_mbs[mb_id] for PP).
The PP load/store of self.running_batch is kept so process_input_requests
(e.g. pause) still sees the current microbatch's batch.

NextBatchPlan is a msgspec.Struct defined in schedule_batch.py. Behavior-preserving.
…turn

Black reformatting of the lines touched while threading running_batch, plus the
test mock for get_new_batch_prefill now returns (None, running_batch) to match
the method's new tuple return.
get_next_disagg_prefill_batch_to_run now takes running_batch and returns a
NextBatchPlan; process_prefill_chunk takes running_batch. Neither reads
self.running_batch anymore. The non-PP disagg prefill event loops store
plan.running_batch back; the PP disagg prefill loop passes its microbatch-slot
running batch into process_prefill_chunk and get_new_batch_prefill.
Behavior-preserving.
get_next_disagg_decode_batch_to_run now takes running_batch and returns a
NextBatchPlan; its body no longer reads or rebinds self.running_batch (the
prebuilt-merge takeover and the decode update flow out through the plan). The
non-PP disagg decode event loops and the PP disagg decode loop pass
self.running_batch and store plan.running_batch back. Behavior-preserving.
…it params

inspect the source of every batch decision method (get_next_batch_to_run, the
prefill/decode roots, and their running/last-batch leaves) and assert it never
references self.running_batch / self.last_batch / self.cur_batch, locking in the
explicit-parameter contract. The dllm subtree and update_running_batch are
intentionally out of scope and excluded from the list.
The other batch-decision methods (get_next_batch_to_run and the disagg
analogues) already return a NextBatchPlan. get_new_batch_prefill returned a
bare (batch, running_batch) tuple, forcing every caller to positionally
unpack two values. Return the same NextBatchPlan struct so all decision
methods share one interface and callers read named fields.

@gemini-code-assist gemini-code-assist Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code Review

This pull request refactors the scheduler's batch decision-making methods to eliminate implicit state access via self by explicitly passing running_batch and last_batch as parameters and returning updates via a new NextBatchPlan struct. A guard test is also added to prevent future regressions. The review feedback points out that get_new_batch_dllm still assigns self.running_batch = running_batch, thereby re-introducing the implicit side-channel. The reviewer recommends refactoring this method to return a NextBatchPlan, updating its call site, and adding it to the guard test's list of checked methods.

Important

The consumer version of Gemini Code Assist on GitHub is being sunset. Starting June 18, 2026, new organization installations will be blocked, and all code review activity will officially cease on July 17, 2026.
For more details on the timeline and next steps, please review the Help Documentation.

Comment on lines +30 to 36
def get_new_batch_dllm(
self: Scheduler, running_batch: ScheduleBatch
) -> Optional[ScheduleBatch]:
"""Generate a new batch for DLLM (Diffusion LLM) scheduling."""
self.running_batch = running_batch
if self.enable_priority_preemption:
self.running_batch.batch_is_full = False

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

high

The assignment self.running_batch = running_batch re-introduces the implicit field-based side channel on self that this PR aims to eliminate.

To maintain consistency with the rest of the scheduler refactoring:

  1. Refactor get_new_batch_dllm to accept running_batch and return a NextBatchPlan instead of Optional[ScheduleBatch] (remember to import NextBatchPlan from sglang.srt.managers.schedule_batch).
  2. Replace all internal references to self.running_batch with running_batch within this method.
  3. Add get_new_batch_dllm to DECISION_METHODS in test_scheduler_decision_batch_params.py to ensure it is covered by the guard test.
Suggested change
def get_new_batch_dllm(
self: Scheduler, running_batch: ScheduleBatch
) -> Optional[ScheduleBatch]:
"""Generate a new batch for DLLM (Diffusion LLM) scheduling."""
self.running_batch = running_batch
if self.enable_priority_preemption:
self.running_batch.batch_is_full = False
def get_new_batch_dllm(
self: Scheduler, running_batch: ScheduleBatch
) -> NextBatchPlan:
"""Generate a new batch for DLLM (Diffusion LLM) scheduling."""
if self.enable_priority_preemption:
running_batch.batch_is_full = False

Comment on lines 2697 to +2698
if self.dllm_config is not None:
new_batch = self.get_new_batch_dllm()
new_batch = self.get_new_batch_dllm(running_batch)

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

high

Since get_new_batch_dllm should be refactored to return a NextBatchPlan (to avoid implicit side-channels and keep consistency with get_new_batch_prefill), we should update the call site here to unpack the plan and update running_batch explicitly.

Suggested change
if self.dllm_config is not None:
new_batch = self.get_new_batch_dllm()
new_batch = self.get_new_batch_dllm(running_batch)
if self.dllm_config is not None:
dllm_plan = self.get_new_batch_dllm(running_batch)
new_batch = dllm_plan.batch_to_run
running_batch = dllm_plan.running_batch

Comment on lines +25 to +26
SchedulerDisaggregationDecodeMixin.get_new_prebuilt_batch,
SchedulerDisaggregationDecodeMixin.get_next_disagg_decode_batch_to_run,

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

medium

Once get_new_batch_dllm is refactored to remove references to self.running_batch, add it to DECISION_METHODS so that the guard test can enforce the "no hidden channel" invariant for the DLLM path as well.

    SchedulerDisaggregationDecodeMixin.get_new_prebuilt_batch,
    SchedulerDisaggregationDecodeMixin.get_next_disagg_decode_batch_to_run,
    Scheduler.get_new_batch_dllm,

@fzyzcjy

fzyzcjy commented Jun 26, 2026

Copy link
Copy Markdown
Collaborator Author

/tag-and-rerun-ci

@fzyzcjy

fzyzcjy commented Jun 26, 2026

Copy link
Copy Markdown
Collaborator Author

/tag-and-rerun-ci extra

@fzyzcjy fzyzcjy added bypass-fastfail run-ci CI: run the baseline test suite on this PR run-ci-extra CI: also run the extra suite (requires run-ci) labels Jun 26, 2026
fzyzcjy added 3 commits June 26, 2026 17:10
The batch result processor already holds the failing `req`, yet it built a
synthetic `AbortReq(rid=req.rid)` and re-dispatched through the full rid-based
`abort_request` machinery, which scans every queue/batch only to relocate the
req in hand and finally set `to_finish` (abort "method 3"). Set
`req.to_finish = FINISH_ABORT()` directly, matching the idiomatic in-hand
termination used by the running-timeout abort.

For a single request this reproduces the exact net effect (only method 3 can
apply to an in-flight req). For `n > 1` parallel sampling, where rids are
`f"{rid}_{i}"`, it also avoids the `startswith` rid-prefix aliasing that could
over-abort sibling samples (e.g. aborting `R_3` would match `R_30`).

This removes the only mid-iteration caller of `Scheduler.abort_request`, which
now runs solely from the top-of-loop input path.
@fzyzcjy

fzyzcjy commented Jul 9, 2026

Copy link
Copy Markdown
Collaborator Author

Automated investigation posted by an AI agent (Claude Code) on behalf of @fzyzcjy. All raw evidence is linked below so the claims can be independently audited.

test_vlm_offline_throughput is a deterministic main failure (server SIGBUS), not a flake — and not caused by this PR chain

TL;DR

test/registered/perf/test_bench_serving_1gpu_part2.py::TestBenchServing1GPUPart2::test_vlm_offline_throughput fails because the Qwen2.5-VL server process is killed by SIGBUS (exit code -7) shortly after startup. It reproduces on a clean, single-test run of plain upstream/main, so it is unrelated to this stacked PR chain. It is deterministic, so a retry does not help.

Root cause (from full CI logs)

  • The failure surfaces on the client as aiohttp ClientPayloadError: Response payload is not completed for every request, because the server drops all connections at once.
  • The underlying error is Exception: Server process exited with code -7 in popen_launch_server → the server child is killed by signal 7 = SIGBUS (a native shared-memory / mmap fault).
  • No CUDA coredump is produced on any attempt — consistent with SIGBUS being a host memory fault rather than a CUDA fault.
  • The harness retry() wrapper relaunches the server up to its max; the server comes fully up each time (Uvicorn running, GET /model_info 200 OK) and then immediately SIGBUSes again, ending with retry() exceed maximum number of retries.
  • It is on the VLM / multimodal /dev/shm IPC path (CI even runs cleanup_stale_shm at startup; the model is Qwen/Qwen2.5-VL-3B-Instruct).

Evidence (all auditable)

# Where Code under test Result Link
1 This PR (op5) extra-a-test-1-gpu-large (1), attempt 3 op5 branch FAIL — same ClientPayloadError, no coredump https://github.com/sgl-project/sglang/actions/runs/28936293209/job/86012773225
2 Isolated single-test probe upstream/main @ 2b3d9ad375 FAIL — Server process exited with code -7 (SIGBUS), 3 relaunches all SIGBUS https://github.com/sgl-project/sglang/actions/runs/28997593004
3 Isolated single-test probe (repeat) upstream/main @ 1c9eb6bb0b running — result will be posted as a reply https://github.com/sgl-project/sglang/actions/runs/28998279442

Probes #2/#3 run only test_vlm_offline_throughput on the real 1-gpu-h100 runner (the 1-gpu-large mapping), so there is no 600s file-timeout or sibling-test confound.

Aggregate observed so far: 0 pass / 6 fail across the op5 branch (4) and clean main (2).

Why retry is not a fix here

The test framework already retries the whole server launch to its maximum, and every relaunch dies with SIGBUS. Adding a CI-level retry would burn more GPU time and still end red. This is a real, deterministic server crash that needs a code fix.

Suspected area (not yet bisected)

SIGBUS on the multimodal shared-memory path. The most suspicious recent main commits touching /dev/shm / SHM helpers:

Happy to bisect main with the same ~4-minute single-test GPU probes to pin the exact introducing PR if that is wanted.

@fzyzcjy

fzyzcjy commented Jul 9, 2026

Copy link
Copy Markdown
Collaborator Author

Follow-up to the investigation above (AI agent, Claude Code, on behalf of @fzyzcjy).

Probe #3 result: FAIL — upstream/main @ 1c9eb6bb0b, single test on 1-gpu-h100, no coredump artifact.
Run: https://github.com/sgl-project/sglang/actions/runs/28998279442

Same failure family (VLM server dies → all client requests fail → retry() exceed maximum number of retries). The proximate manifestation varied slightly vs probe #2: here the server reached health 200 and the benchmark started (1/200) before the server vanished (ConnectionRefused), whereas probe #2 died at launch with Server process exited with code -7 (SIGBUS). In both, the resource_tracker warnings report escalating leaked shared-memory objects (here 93 → 118) as the server tears down — consistent with the multimodal /dev/shm IPC path being the culprit.

Updated tally: 0 pass / 7 fail — op5 branch (4) + clean main (3). Deterministic; retry does not help.

@fzyzcjy

fzyzcjy commented Jul 9, 2026 •

Copy link
Copy Markdown
Collaborator Author

Consolidated investigation summary — automated, posted by an AI agent (Claude Code) on behalf of @fzyzcjy. Every claim in the "auditable evidence" table is backed by a linked CI run so it can be independently verified.

test_vlm_offline_throughput: deterministic main failure (VLM server crash), unrelated to this PR chain

Test: test/registered/perf/test_bench_serving_1gpu_part2.py::TestBenchServing1GPUPart2::test_vlm_offline_throughput
Model: Qwen/Qwen2.5-VL-3B-Instruct · Runner: 1-gpu-h100 (the 1-gpu-large mapping)

Verdict

  • The Qwen2.5-VL server process dies shortly after startup; the client then sees aiohttp ClientPayloadError: Response payload is not completed for every request (server dropped all connections at once).
  • Reproduces on a clean, single-test run of plain upstream/main → not caused by this stacked PR chain.
  • Deterministic → a retry does not fix it. The harness retry() wrapper already relaunches the server to its max; every relaunch dies again (retry() exceed maximum number of retries).
  • No CUDA coredump is ever produced — consistent with a host-side shared-memory / mmap fault, not a CUDA fault.

Root cause signature

  • Proximate manifestation varies per run (evidence of a shared-memory lifetime bug, not a single deterministic line):
    • Server process exited with code -7 = killed by SIGBUS (signal 7) at launch (probe A).
    • server reaches health 200, benchmark starts (1/200), then server vanishes → ConnectionRefused (probe B).
  • In every case the multiprocessing.resource_tracker reports leaked shared-memory objects, escalating as the server tears down (e.g. 93 → 118).
  • It is on the VLM / multimodal /dev/shm IPC path (CI even runs cleanup_stale_shm at startup).

Auditable evidence (each row = one linked CI run, all FAIL)

# Scope Code under test Result Link
1 This PR (op5), extra-a-test-1-gpu-large (1) attempt 3 op5 branch FAIL — ClientPayloadError, no coredump https://github.com/sgl-project/sglang/actions/runs/28936293209/job/86012773225
2 Isolated single-test probe A upstream/main @ 2b3d9ad375 FAIL — Server process exited with code -7 (SIGBUS), 3 relaunches all died https://github.com/sgl-project/sglang/actions/runs/28997593004
3 Isolated single-test probe B upstream/main @ 1c9eb6bb0b FAIL — server dies mid-benchmark, leaked SHM 93→118 https://github.com/sgl-project/sglang/actions/runs/28998279442

Auditable count: 3 linked runs, 0 pass / 3 fail — of which 2 are on clean main (probes A & B), both FAIL. Probes A/B run only this test on the real runner, so there is no 600s file-timeout and no sibling-test confound.

Non-auditable additional observations (same fingerprint, but I did not retain individual run links): 3 more failing runs on the op5 branch and 1 earlier main probe. I mention these for context only — they are not part of the auditable count above.

Why "retry" is not a fix

The test framework already retries the whole server launch to its maximum, and every relaunch crashes. A CI-level retry would burn more GPU time and still end red. This is a real, deterministic server crash that needs a code fix.

Suspected area (not yet bisected)

SIGBUS on the multimodal shared-memory path. Most suspicious recent main commits touching /dev/shm / SHM helpers:

Can bisect main with the same ~4-minute single-test GPU probes to pin the exact introducing PR on request.


Prior comments in this thread: #29408 (comment) · #29408 (comment)

@fzyzcjy

fzyzcjy commented Jul 9, 2026

Copy link
Copy Markdown
Collaborator Author

cc @yhyang201 - that test is temp disabled

The Qwen2.5-VL server dies with SIGBUS (exit code -7) shortly after startup, deterministically, on plain upstream/main — unrelated to this refactor chain. No CUDA coredump is produced (host-side shared-memory fault on the multimodal /dev/shm path). The harness already retries the server launch to its max and every relaunch crashes, so a retry cannot green it. Skip until the underlying main crash is fixed.
@fzyzcjy

fzyzcjy commented Jul 10, 2026

Copy link
Copy Markdown
Collaborator Author

all tests passed

@fzyzcjy fzyzcjy removed run-ci CI: run the baseline test suite on this PR bypass-fastfail run-ci-extra CI: also run the extra suite (requires run-ci) labels Jul 10, 2026
Base automatically changed from tom/refactor-scheduler-batch-field/op4 to main July 10, 2026 00:55
@fzyzcjy
fzyzcjy merged commit 1e75ba2 into main Jul 10, 2026
31 of 41 checks passed
@fzyzcjy
fzyzcjy deleted the tom/refactor-scheduler-batch-field/op5 branch July 10, 2026 00:55
fzyzcjy added a commit that referenced this pull request Jul 10, 2026
# Conflicts:
#	python/sglang/srt/disaggregation/decode.py
fzyzcjy added a commit that referenced this pull request Jul 10, 2026
# Conflicts:
#	python/sglang/srt/managers/schedule_batch.py
#	python/sglang/srt/managers/scheduler.py
#	test/registered/unit/managers/test_scheduler_pause_generation.py
fzyzcjy added a commit that referenced this pull request Jul 10, 2026
# Conflicts:
#	python/sglang/srt/managers/scheduler.py
#	test/registered/unit/managers/test_scheduler_pause_generation.py
fzyzcjy added a commit that referenced this pull request Jul 10, 2026
# Conflicts:
#	python/sglang/srt/managers/scheduler.py
#	test/registered/unit/managers/test_scheduler_pause_generation.py
Chronostasys pushed a commit to MindLab-Research/sglang that referenced this pull request Aug 24, 2026
efschu pushed a commit to efschu/htsglang that referenced this pull request Aug 29, 2026
…fill has not returned

Three boots of forensics land on one invariant. A request that has never
produced an output token has nothing to decode from, and decoding it anyway is
what has been killing this window's boots on their first short prompt.

The chain, measured end to end: get_next_batch_to_run makes a freshly built
PREFILL batch the running batch in the same breath. Upstream that holds --
without PP the prefill runs in the same round, so output_ids is non-empty by
the time update_running_batch sees it. The seam is stock, every commit
touching it is an upstream PR (sgl-project#29408, sgl-project#22131, sgl-project#20343, sgl-project#14320, sgl-project#17484,
sgl-project#14883), none of ours, so there is nothing to revert. PP=3 widens it: the
result comes back several passes later while membership was granted
immediately, and with one short request and no other traffic the next round
has nothing else to do and decodes it first. prepare_for_decode then leaves
the prefill input_ids in place -- there is no last token to embed -- and the
batch travels on labelled DECODE while carrying extend tokens.

Boot 67 read every link: rid e463acc5, prefix_lens=0 fill_lens=3 out_lens=0,
one ADMIT, no retraction, and no void at all (797_void=0, 798_void=0, so the
void explanation is excluded). It surfaced first as forward_mode=2 with
batch_size=1 and input_ids=3 through the sgl-project#1007 probe, then as
"causal_conv1d_update: conv_state_indices has 1 entr(ies) for a batch of 3".
Every short prompt does this, health checks included; long chunked prompts
under continuous load never reach the state, which is exactly why it stayed
latent behind every other defect this window.

So the hold sits where decode eligibility is decided, not on a consumer. The
requests are neither dropped nor reset: they stay in the running batch and
become eligible the moment their prefill result lands, and filter_batch's
keep_indices keeps the parallel tensors consistent rather than reseating reqs
by hand.

The counter is cumulative on purpose (INDIKATOR-GESETZ): a held_total that
never grows means the class no longer occurs, one that grows without bound
means results are not landing at all. Those are different diagnoses and a
per-call line could not tell them apart.

Evidence: desk, executed. py_compile; the condition sits inside
update_running_batch ahead of prepare_for_decode, and the counter is written
once and read twice. Belegstufe: DESK-BEWIESEN -- BOOT-BEWIESEN only once the
3-token probe returns tokens.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant