Skip to content

Measure streaming latency after scheduler idle periods - #634

Open
salignatmoandal wants to merge 1 commit into
NVIDIA:mainfrom
salignatmoandal:bench/scheduler-idle-resume
Open

salignatmoandal wants to merge 1 commit into
NVIDIA:mainfrom
salignatmoandal:bench/scheduler-idle-resume

Conversation

@salignatmoandal

@salignatmoandal salignatmoandal commented Nov 30, 2026 •

Copy link
Copy Markdown
Contributor

Why

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.

What changed

Add an opt-in burst mode to scripts/benchmark_scheduler.py. With --idle-seconds, the driver waits after previous streams drain, then issues a fixed number of requests per concurrency lane. Each JSONL trial records the observed interval from the start of the pause to the first request, alongside the existing streaming metrics. The continuous mode remains the default.

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.

Evidence

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.

The scheduler benchmark keeps issuing requests during each trial.
Interactive traffic can pause between bursts, so a continuous trial
cannot isolate the first responses after a pause.

Add an opt-in pause before each measured burst and issue a fixed
number of requests per lane. Begin each pause after preceding streams
have drained and record the time to the next burst in the JSONL result.

The mode provides repeatable request counts for comparisons after
idle periods and preserves the existing continuous trial defaults.

Exercised both CLI modes against a local SSE fixture. Checked the
request counts, the gap after stream drain, and the continuous-mode
output. No native GPU serving benchmark was run.

Design-Signed-Off-By: Codex (GPT-6); design-review=2e5b
Signed-off-by: Mawen Salignat-Moandal <mwnslgt@gmail.com>
@flare-autobot

Copy link
Copy Markdown
Collaborator

A case file has been opened for 634.
Case File Intake Report

Future reviews will auto-run 90 minutes after code updates are pushed.

  • Re-review sooner: Call @flare-autobot after push.
  • Opt-out: Include #autobot:ignore in the PR or any comment.

@flare-autobot flare-autobot added enhancement New feature or request triage:review Proposed change needs code review; this does not imply merge readiness. labels Nov 30, 2026
@flare-autobot

Copy link
Copy Markdown
Collaborator

Autobot Review

Full Review · Value Proposition · Case File

Recommendation: Changes Requested

Well-scoped, low-risk benchmark-script change that leaves default continuous mode behavior-identical, but two small fixes are needed: the implicit or defaults / --requests-per-lane provenance mismatch and the lack of automated test coverage for the new flags and burst path.

  • Blockers: 0 · Should fix: 2 · Subtract/Simplify: 1 · Nits: 2
Walkthrough
  • scripts/benchmark_scheduler.py:140-158: Adds keyword-only requests_per_lane=None to trial(); switches worker loop termination from deadline-bounded (time.perf_counter() < deadline[0]) to request-count-bounded (len(results) < requests_per_lane) when set, and guards deadline[0] = start + (duration or 0).
  • scripts/benchmark_scheduler.py:187-190, 198-201: Adds opt-in --idle-seconds and --requests-per-lane CLI flags with parser.error(...) validation requiring finite positive --idle-seconds and requiring --requests-per-lane >= 1 only when --idle-seconds is set.
  • scripts/benchmark_scheduler.py:220-228: Keeps the existing continuous trial(..., args.seconds) path as the default; when --idle-seconds is set, sleeps args.idle_seconds before each measured burst, calls trial(..., None, requests_per_lane=args.requests_per_lane or 1), and records idle_seconds_before_burst (min(row['started']) - pause_started) on the trial row.
Merge Risk: Low · up to a0467e2
  • Client-side benchmark script only (scripts/benchmark_scheduler.py, +21/−4); zero changes to Helios Rust runtime, scheduler, caches, CUDA graphs, wire formats, or dependencies (math was already imported at :11).
  • Default continuous mode (--idle-seconds omitted) is unchanged (scripts/benchmark_scheduler.py:220-221), and nothing in tests/, docs/, or .github/workflows/ imports or invokes this script.
  • Failure blast radius is confined to manual operator runs of scripts/benchmark_scheduler.py with --idle-seconds; invalid CLI values fail loudly via parser.error(...) (:198-201).
Pre-merge checks: ✅ 3 passed · ⚠️ 1 warnings
  • ✅ Security / malicious screen: Pure stdlib Python CLI change in scripts/benchmark_scheduler.py; no new dependencies, network targets, shell execution, or untrusted input sinks.
  • ✅ Charter & value fit: Small opt-in instrumentation tool aligned with the open live-Helios idle/resume qualification item in docs/TODO.txt:110-114 (following Retain bounded timing-refresh and acceptance credit across idle #540), though removing the unexercised --requests-per-lane switch and implicit or defaults improves compliance with the charter's "Be explicit / No magic defaults" and AGENTS.md:188-193.
  • ✅ Related / duplicate / conflict check: No other open or recent PR touches scripts/benchmark_scheduler.py; complements Retain bounded timing-refresh and acceptance credit across idle #540's simulator scenarios without duplication or conflict.
  • ⚠️ Tests & verification evidence: No automated test covers the new flags/burst mode under .github/workflows/python-cpu.yml (not opened) (pytest tests/ -q), the local SSE stub run in Evidence is unattached, live flare run serving was not run (honestly disclosed), and commit a0467e2 DCO Signed-off-by (CONTRIBUTING.md:9-20) could not be inspected from review metadata—verify before merge.

Have your agent review the Full Review for complete verified findings, file:line citations, and suggested changes.

To opt out, include #autobot:ignore in your post or comment.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request triage:review Proposed change needs code review; this does not imply merge readiness.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants