Explore scratchpad · NVIDIA/hyperflare-inference #634

Raw Markdown for agents: https://autobot.eidonix.com/p/b0979b57-edb9-4e8f-b5fb-0b1842c447a2.md

#1 [high] Change: PR #634 adds opt-in idle-burst mode to benchmark_scheduler.py (+21/−4, 1 file)

PR #634 "Measure streaming latency after scheduler idle periods", author salignatmoandal (CONTRIBUTOR), branch bench/scheduler-idle-resume into main, head a0467e2 (a0467e298a4e7f38622dbc6ec37ecae1cdd340d1), opened 2026-11-30 09:52, +21/−4, 1 file (scripts/benchmark_scheduler.py). No comments, no reviews, no labels, no CI checks. State: open, "ready for review".

Diff (scripts/benchmark_scheduler.py):

  1. trial(url, bodies, duration, *, requests_per_lane=None) (line 140): worker loop condition becomes while (len(results) < requests_per_lane if requests_per_lane is not None else time.perf_counter() < deadline[0]) (lines 147-148). So burst mode counts completed requests per lane instead of running until a deadline.
  2. deadline[0] = start + (duration or 0) (line 156) — with duration=None the deadline is start, which is irrelevant because the count branch is used. duration or 0 also silently maps an explicit --seconds 0 to 0.
  3. New CLI args (lines 187-190): --idle-seconds (float, help "Pause before each measured burst after all previous streams finish."), --requests-per-lane (int, "default: 1").
  4. Validation (lines 198-201): --idle-seconds must be finite and > 0 (uses math.isfinite; math was already imported at line 11 for percentile, so no new import); --requests-per-lane requires --idle-seconds and must be >= 1.
  5. Main loop (lines 220-228): when --idle-seconds is set, each trial does pause_started = time.perf_counter(), time.sleep(args.idle_seconds), then trial(..., None, requests_per_lane=args.requests_per_lane or 1), then records result['idle_seconds_before_burst'] = min(row['started'] for row in result['rows']) - pause_started.
    • row['started'] is the client-side time.perf_counter() taken in request() after client = connection(url) and before the POST (line 27), i.e. connection setup time is excluded from the measured interval: the recorded interval is "pause start -> first request's send time", not "pause start -> first response byte" and not "drain -> issue".
    • The pause begins immediately after the previous trial returns, i.e. after the previous trial's job.result() joins AND its metrics_after GET plus the whole trial() return path. Warmup trials (lines 217-218) also precede the first measured burst but are not paused before.
    • The recorded value is measured per trial inside the same JSONL row, but the trial result dict also keeps issue_duration_seconds: None (line 164 stores duration unchanged), so idle-mode rows have "issue_duration_seconds": null.

Defaults/back-compat: default path is unchanged (--idle-seconds unset -> trial(..., args.seconds) as before); trial()'s new parameter is keyword-only with a default, and the function has no other in-repo callers (grep benchmark_scheduler finds no other file referencing the script — only the script itself; search_code "benchmark_scheduler" = no matches outside, i.e. no docs, no CI workflow, no test imports it).

Undeclared in the description: (a) idle_seconds_before_burst is measured to the first request send, not to first token — the description says "the observed interval from the start of the pause to the first request", which matches (a) exactly, so this is consistent, not undeclared; (b) rows in idle mode get issue_duration_seconds: null and tokens_per_second still divides by elapsed_seconds (which in burst mode is just the burst duration, so it is "burst throughput", not the deadline-mode sustained rate) — the description does not say the throughput field changes meaning; (c) warmup still uses --warmup-seconds deadline mode even in idle mode, and there is no pause before warmup. Not done by the change but implied by "Benefit": no aggregation across trials, no comparison/report tooling, no --pair-index/--variant wiring (those flags exist at lines 192-194 but are unused by the script itself), no test added, no docs updated.

#2 [high] Why: PR #634 is framed as qualification for #540's retained post-idle timing credit

PR #634's "Why" (description): "The scheduler benchmark continuously issues requests during each trial. It cannot isolate streaming behavior when traffic returns after an idle period, a qualification case for the timing credit retained by #540."

#540 "Retain bounded timing-refresh and acceptance credit across idle" by FujitsuPolycom, merged 2026-11-29 22:12 (11 files, +434/−153; labels area:scheduling, bug, performance, triage:review). It removed RefreshState::idle (helios/src/scheduler/refresh.rs) and renamed RequestScheduler::idle to assert_idle, so positive timing-refresh and acceptance credit (each capped at 5 ms) survives idle instead of being zeroed. Same-day merge, one day before #634 was opened — #634 depends on #540 having landed. #540's own "Limitations and unrun checks" say live GPU/HTTP serving qualification was NOT run and "remains tracked in docs/TODO.txt". Its simulator scope limit: "the 5 idle-* scenarios run single 64- or 8192-token prompts well below 2,495 ms, so they do not reach 5 ms credit and do not exercise the fully-charged post-idle wakeup probe case." So the post-idle wakeup case that #634 would measure is exactly the one #540 says its simulator cannot reach — this is the gap #634 addresses. Simulator idle scenarios live in scripts/scheduling_sim/learning_scenarios.py:88-92 (idle-{seconds}s, idle-short-burst) and learning_run.py:243-244 (idle_gaps_ms applied between arrivals); the simulator models idle as an arrival gap between requests inside one run, not as a driver-level pause as #634 does. #634's "Benefit": "Operators can replay the same request bodies and request counts across builds, and compare first-token latency and SSE delivery gaps after a pause." No issue in the repo asks for this; #634 links only to #540. No roadmap item (charter roadmap lists in-process Rust SDK #6, Engram #267, FlashInfer #215 — none about benchmarking idle latency).

#3 [high] Related work: #540 is the only linked item; benchmark-file ownership is historically Luke Alonso's

Overlap / competition for #634:

#7 [high] Project fit: charter evidence rule, "no magic switches", and the documented backlog item it serves

Charter (read_charter, "Bring real evidence" bullet): "Performance PRs need benchmarks showing an actual speedup over main on a served workload (#210). Bug fixes need to address the root cause... 'An agent suggested it,' linter warnings, or hypothetical users aren't enough to justify a change."

#8 [high] Claims and evidence: control flow verified; the measured interval is to request send, not to first token

Claims made by #634 and what actually backs each:

  1. "With --idle-seconds, the driver waits after previous streams drain, then issues a fixed number of requests per concurrency lane." — TRUE, verified in code: line 224 time.sleep(args.idle_seconds) runs after the previous trial() (which joins all worker futures, line 158) and after its metrics_after scrape (line 174), then trial(..., None, requests_per_lane=...) bounds each lane by completed count (lines 145-151). Caveat: "after previous streams drain" includes the metrics scrape and Python overhead of the prior trial, so the effective server-idle window is longer than --idle-seconds.
  2. "Each JSONL trial records the observed interval from the start of the pause to the first request, alongside the existing streaming metrics." — TRUE but narrower than it sounds: idle_seconds_before_burst = min(row['started']) - pause_started (lines 227-228), and row['started'] is a client timestamp taken before the POST is sent (line 27), so the number measures "sleep + client scheduling + socket connect", not server response. For a local server connect is ~0, so it will read ≈ --idle-seconds and is mostly a self-check that the sleep happened — it cannot detect that the server processed the pause. The realistic measured server-visible quantity is the existing ttft_median_seconds (line 169), which the description does not call out as the idle-latency number.
  3. "The continuous mode remains the default." — TRUE (line 220 branch; args default None).
  4. "Operators can replay the same request bodies and request counts across builds" — PARTLY supported: --reuse-requests (line 196) and the JSONL's first line storing requests (line 214) existed before this PR; the new part is a fixed per-lane count, which makes a run's request count deterministic and therefore comparable. No tooling is added to diff two JSONL files.
  5. Evidence, as stated: "Ran both CLI modes against a local HTTP server emitting complete SSE streams. Two lanes with one request per lane yielded two completed requests per burst. The second burst began at least 100 ms after the preceding streams drained. The continuous control retained its deadline-based output. Python compilation and git diff --check passed. Native GPU serving, scheduler idle transitions, and latency gains were not measured." — This is a stub-server smoke test, not a Flare run. It verifies the control flow (count-bounded bursts, one pause per trial) but nothing about the server behavior the PR exists to observe. Notably it does not report the value of idle_seconds_before_burst versus the requested --idle-seconds, so the new field's accuracy is unverified even in the stub run. No test file was added, no CI check exists, and nothing in tests/ imports the script (so python-cpu.yml's pytest tests/ never touches it). Unverifiable/absent: no benchmark numbers, no JSONL sample, no comparison of the two modes' fields, no statement of what happens with --trials 0, --warmup-seconds 0, or very small --requests-per-lane + --concurrency combos. Verifiable risk not mentioned anywhere: in idle mode trial() still returns tokens_per_second = tokens / elapsed (line 165) but elapsed is now the burst duration, and issue_duration_seconds is None (line 164). Any downstream consumer that reads issue_duration_seconds to distinguish modes, or compares tokens_per_second across modes, would be comparing two different quantities with the same key names. No consumer exists in-repo today (grep finds none), so this is a latent schema inconsistency in the JSONL rather than a break.

#11 [high] Connection: #540 → docs/TODO.txt:110-114 (idle/resume qualification) → #634 is the chain a reviewer should follow

The chain that matters most for a reviewer deciding on #634: #540 (FujitsuPolycom/PCCessna, merged 2026-11-29 22:12, commit 59adc480) changed Helios so post-idle timing credit survives → its spec is docs/scheduling-runtime-design.md:433-466 ("When full credit carries across an idle gap longer than the freshness lifetime, the first waking request can execute one refresh episode before negative debt suppresses further probes") → #540 added a Rust regression test for it, helios/src/scheduler/policy_tests.rs:6253 idle_separated_short_requests_accumulate_refresh_credit_and_recover_stale_shape (serves five sequential 64,000-token prompts separated by idle gaps and asserts a refresh episode fires with P <= 0.002/0.998 * O + D) → but #540 shipped with live GPU/HTTP qualification unrun and explicitly deferred it to docs/TODO.txt:110-114 ("Qualify retained graph costs and funded remeasurement in live Helios: idle/resume, concurrent decode latency, cost-change recovery, and queued generation transitions ... See scheduling-runtime-design.md#funded-timing-refresh") → #634 is a client-side tool aimed at that measurement. Consequences of that chain: (a) #634 inherits a maintainer-side ask (the TODO entry), which is the strongest charter fit it has, but it does NOT close that TODO: #634 produces no measurement, so docs/TODO.txt:110-114 stays open and #634's description should not be read as satisfying it. (b) #540's own text says its simulator cannot reach the fully-charged post-idle wakeup case (5 idle-* scenarios are all below the 2,495 ms funding threshold), so a live tool is the only route — this is the real justification for #634 and it comes from the linked PR, not from #634's own description. (c) #540 changed scripts/scheduling_sim (learning.py:440 --retain-idle-credit, learning_policy.py) — the same scripts/ area #634 touches, by a different author, one day earlier. A reviewer should read #634 as continuing #540's scripts/ work, not as touching Luke Alonso's long-stable benchmark file in isolation. (d) The one thing missing from the chain: nothing in #634 references #540's own new flags/test or the TODO entry by name, so a future reader of the TODO list will not find this tool. Related "how long wanted" evidence: docs/TODO.txt:110-114 has existed since at least #540's merge (it is the entry #540 cited); #540's limitations section: "Live GPU and HTTP serving qualification (tests/server/test_scheduler.py and live power-cap cost-refresh recovery) was not run on GPU hardware and remains tracked in docs/TODO.txt."

#12 [high] Research summary

Case file for PR #634 is complete; all eleven angles are in the scratchpad (entries 1–11), each with file:line or PR/issue citations.

The change is small and verified: an opt-in burst mode in scripts/benchmark_scheduler.py (+21/−4, one file, one commit a0467e2). --idle-seconds makes each trial sleep after the previous trial drains, then run a fixed count per lane (--requests-per-lane, default 1) instead of a deadline; each row gains idle_seconds_before_burst. Continuous mode is untouched and still the default. Undeclared details worth a reader's attention: the recorded idle interval runs to the first request send (client-side, pre-POST), not to first token; idle rows keep issue_duration_seconds: null while tokens_per_second silently changes meaning to burst throughput; warmup still runs deadline-mode.

Why: it is framed as qualification for #540 (merged 2026-11-29), which let timing-refresh/acceptance credit survive idle and shipped its live GPU/HTTP qualification unrun, deferring it to docs/TODO.txt:110-114 — the entry #634 is really aimed at, though it never cites it and closes nothing. #540's own simulator cannot reach the fully-charged post-idle wakeup case (docs/scheduling-runtime-design.md:460-466), which is the strongest justification for a live tool and comes from #540's text, not #634's.

Evidence is a stub-SSE-server smoke test only: no Flare run, no measurement, no test file, no CI check, no sample JSONL, and the accuracy of the new field is not reported even in that run. Reach is a hand-run operator tool: nothing in CI, docs, tests or packaging references it. No overlapping or competing PR touches the file; the nearest precedents are ad-hoc idle probes in #280 and #353.

Process: ready-for-review but untriaged (no labels where comparable PRs carry area:/triage:), zero comments and reviews, no flare-autobot intake, <1 day old, and no commits on main since its base. The author (salignatmoandal) has three freshly merged ops/docs PRs (#601–#603) and no prior work in scripts/, Python benchmarks or scheduling; the file and area belong to Luke Alonso, and the linked #540's subsystem to FujitsuPolycom. Charter fit is mixed: the evidence and four-section-description rules are met, the "no magic defaults" rule argues against requests_per_lane or 1 / duration or 0, and AGENTS.md places qualification drivers in hyperflare-recipes even though the TODO entry it serves is core Flare's.

#13 [high] Citations to quote verbatim: docs/TODO.txt:110-114, design spec :453-466, runtime.rs:1244-1275, #540 deferral

Exact wording of the two load-bearing citations, so the report can quote without re-reading:

docs/TODO.txt:110-114 (unchecked [ ]): "[ ] Qualify retained graph costs and funded remeasurement in live Helios: idle/resume, concurrent decode latency, cost-change recovery, and queued generation transitions. Use per-fence scheduler traces and request latency measurements; measure GPU replay, queueing, and host planning separately. See scheduling-runtime-design.md#funded-timing-refresh." → This is the backlog item #634 is aimed at. #634 neither edits nor references it, and does not close it (no measurement produced).

docs/scheduling-runtime-design.md:460-466 (the specification #634 would let someone qualify): "The allowance bounds aggregate expense with one nonpreemptible episode overrun; does not cap individual decode stalls. Funding the first refresh requires 2,495 ms of cumulative credited ordinary execution, accumulated across idle-separated requests because idle intervals add neither credit nor ordinary duration. When full credit carries across an idle gap longer than the freshness lifetime, the first waking request can execute one refresh episode before negative debt suppresses further probes." (Paragraph starts at :453 with P <= 0.002 / 0.998 * O + D.)

Server-side counterpart that makes a client pause meaningful: helios/src/server/runtime.rs:1244-1250 calls self.scheduler.assert_idle()? then self.idle_wait() (50 µs with inbound restore pending, 2 ms otherwise, per :1257-1275) and blocks in self.receiver.recv_timeout(wait) — i.e. a paused client leaves the worker genuinely parked, which is the state #540 changed.

#540's own deferral sentence (from its "Limitations and unrun checks"): "Live GPU and HTTP serving qualification (tests/server/test_scheduler.py and live power-cap cost-refresh recovery) was not run on GPU hardware and remains tracked in docs/TODO.txt." And its simulator scope limit: "the 5 idle-* scenarios run single 64- or 8192-token prompts well below 2,495 ms, so they do not reach 5 ms credit and do not exercise the fully-charged post-idle wakeup probe case."

#4 [medium] Recent activity: the file is Luke Alonso's; #540 landed the day before and is what #634 qualifies

History of scripts/benchmark_scheduler.py (only 3 commits ever, per search_history on the path):

#5 [medium] People: author is a new CONTRIBUTOR with 3 merged ops/docs PRs, none in scripts

Author: salignatmoandal ("where's Mawen?" / Mawen Salignat-Moandal), GitHub association CONTRIBUTOR. In the last 180 days: 3 merged PRs, 0 closed, 0 open besides this one — all opened and merged on 2026-11-29, all small operator-facing fixes:

#6 [medium] Community: no engagement at all on #634; contrast with the author's other PRs

scripts/benchmark_scheduler.py: pr_comments on #634 returns "No comments." No reviews, no reactions, no labels, no CI checks on head a0467e2 ("CI on the head commit: no checks"). No flare-autobot intake/case-file comment, unlike #601, #602, #603 which each received one within a few minutes of opening (see those items' discussions). The PR is <1 day old at the time of this case file (opened 2026-11-30 09:52), so low engagement is expected rather than meaningful. Interest it would draw if it lands: the #540 follow-up crowd (FujitsuPolycom, Luke Alonso) because #634 offers the live measurement docs/TODO.txt:110-114 asks for; and operators, per the PR's own "Benefit". Broader demand signal (indirect): maintainers and contributors keep hand-rolling idle resume probes without a tool — #280 ("these runs do not establish the latency of the first request after an idle stretch"), #353 ("time to first token after 150 s of idle"). No issue in the repo requests a burst/idle mode for this script (search_items for benchmark_scheduler.py, burst mode, idle first-token latency returns only #634 itself).

#9 [medium] Reach: local operator tool only; no CI, docs, tests, packaging or runtime impact

Who/what is affected:

#10 [medium] Process: ready for review but untriaged, no CI, no autobot, no labels, no reviews

State of #634 as a process matter:

#14 [medium] Coverage ledger: angle → entry numbers, and the few items that could not be verified

Coverage ledger so the report writer knows every angle is done and nothing was silently skipped.

Angles → scratchpad entries:

Verified vs claimed is kept apart in 8 and 10. Could not verify (tooling limits, state as such in the report): the commit body / Signed-off-by trailer of a0467e2, and whether any GitHub check attempted to run; the author's stub server and JSONL sample (not attached anywhere visible). Note: #634 is absent from the local copy of PRs/issues ("not in the local copy" per the packet), so related_items/items_touching results reflect the local mirror; read_item(634) did resolve it.