Pre test report scratchpad · NVIDIA/hyperflare-inference #560

Raw Markdown for agents: https://autobot.eidonix.com/p/d2e06105-f4b7-4c75-bec2-625d3f6c32e6.md

#1 [high] PR #560 scope and stacking facts

PR #560 "Emit vLLM-compatible per-request metrics from runtime instants", author WynnD (outside contributor, GitHub association NONE, 0 merged PRs, Discord oystersmiles), open draft, head ce44060, base main, 18 files +1898/-123.

#2 [high] Verified code facts for #560 review

Confirmed in code at head ce44060 (helios/src/lib.rs:29 pub mod server;; server.rs:9-34):

  1. Public API leak. GenerationEvent::Finished { arrival_ns, times: super::metrics::RequestTimes } at helios/src/server/runtime.rs:97-108. RequestTimes is pub struct at metrics.rs:326 but mod metrics; is private (server.rs:16) and only pub use metrics::Snapshot; (server.rs:33); GenerationEvent is re-exported at server.rs:34 and helios::server is public. So out-of-crate consumers cannot name the field type. Repro: fn f(_: flare_helios::server::GenerationEvent) compiles but reading .times / constructing Finished cannot. (No [lints] config found; grep for private_interfaces/deny( returned nothing, so the lint is likely just not surfaced.)
  2. Silent config drop / no config surface. flare/src/configuration.rs:26-34 Server = {host, port, api_key, thinking_token_budget, scheduler_checkpoint_extra_work_fraction}, #[serde(default)] with NO deny_unknown_fields (only PrefixCache at :48-56 denies). So [server] per_request_metrics = true parses and is discarded. helios/src/server/config.rs:353-357 accepts the key (bool only) but is only reachable from the JSON server-config map that flare-cli fills (main.rs:355-356). Consequence: the flare crate (WinUI desktop controller) cannot enable it at all, and the documented "add a [server] key" path from #553 now fails silently. docs/cli-design.md:736 documents the flag but not these limitations.
  3. Unconditional clock read. reserve_and_pack calls super::observation::monotonic_ns() at runtime.rs:2257 for every scheduled step, in both option states, per lane — contradicts the PR's "No clock read is added in either state" (that block is from stacked #548).
  4. Duplicated mechanisms (conventions should-fix). runtime.rs:1746-1757 re-spells GraphKind::samples() (helios/src/execution/manifest.rs:90-101, already used at runtime.rs:2988). Timing.streaming (encode.rs:80, set at :250, guard at :257) duplicates Encoder.streaming (encode.rs:97) and the guard is unreachable because http.rs:363 sets commits only when enable_request_metrics(streaming) returned true.
  5. Redundant API surface. generate_observed (runtime.rs:847-849) = generate_many_observed with a 1-element vec; only non-test caller http.rs:368-372 immediately re-wraps in vec![]. Private enqueue (:851-854) has one caller.
  6. Correctness holds where it matters. Event budget output_event_capacity runtime.rs:62-84 correctly adds 1+observed+commits with checked_mul; Committed is emitted at position==0 before that step's token events (runtime.rs:1826-1834); option off ⇒ no key, no commits, unchanged capacity (http.rs:363). Chat/Responses/Messages reject n>1 (decode.rs:753-755), so the first_scheduled_ns last-writer-wins nit at http.rs:542 is latent only, never live.
  7. Wire contract matches vLLM as claimed. encode.rs:244-294 placement + null rules; docs/api.md:1005-1054 documents all six fields, table at :1015-1022. Stream needs stream_options.include_usage (encode.rs:736-744) — a real limitation for the motivating consumer (llama-swap) not stated against #551.

#3 [high] #551 asks for llama.cpp timings; #560 delivers a narrower vLLM metrics and does not close the streaming gap

Issue #551 "Report per-request timings on final responses so llama-swap can show prompt and decode rates" (open, filed by the same author 2026-11-27). #560 says "Closes #551", but the issue asks for a llama.cpp timings object on Chat/Completions/Messages/Responses, streaming and non-streaming, placed on the chunk that completes the last choice when include_usage is absent, and on message_delta for Messages. #560 instead ships vLLM's metrics object: never on Messages, and in a stream only on the final usage chunk that exists only with stream_options.include_usage (encode.rs:736-744). The issue itself notes llama-swap derives the prompt rate from usage + TTFT and that "a stream without stream_options.include_usage has no usage to use, and the prompt rate reads zero". So for the default streaming SDK client (no include_usage), #560 leaves the motivating -1 rates in place, and there is no --enable-force-include-usage equivalent. This is a partial delivery against the linked issue and the single most decision-relevant functional gap; it also means a llama-swap end-to-end check would legitimately show -1 for plain streams.

#4 [high] Hardware fit and the prepared-core cost for any #560 test

Hardware vs. what this PR needs:

#5 [high] Independent findings and the mutation-test/hardware cost facts

My own additions beyond the five review lenses (all verified in code at head ce44060):

#6 [high] Minimal hardware test plan for #560 (if approved)

Plan ready if a maintainer approves the feature and the first-cut decision is made. One GPU, single host, no TP/multi-host. Phase 0 (no GPU): cargo check --features server in helios and cargo check in flare-cli (head has no CI, so the author's claim is unverified); cargo test --features runtime-core,server --lib -- server::; verification/helios-lifecycle/check.py (its mutation strings at check.py:214-224 still match after #560's edits, so the event-budget invariant is CPU-only). Phase 1 (GPU, cn5, one gb202 TP1 core, ~20 min of GPU): start flare run CORE --gpus 0 twice (flag off/on), drive 8 scripted requests + 2 flag-off repeats: 1 Chat body; 2 Chat stream WITH stream_options.include_usage; 3 Chat stream WITHOUT it (assert absent, documents the #551 gap); 4 Completions stream n=2 + include_usage (metrics null); 5 Completions two prompts (key absent); 6 Responses stream max_tokens=1 (response.incomplete carries metrics); 7 Messages stream (never carries it); 8 reasoning model with thinking (content TTFT > TTFT); 9 single-token request (mean_itl_ms null); 10 flag-off repeats of 1 and 2. Plus in-script arithmetic reconciliation: generation_time_ms == (last-first), tokens_per_second ≈ generated/(last-scheduled), all fields non-negative and TTFT ≤ generation+queue. Phase 2 (optional, 10 min): llama-swap in front; one streamed request without include_usage (expect -1) and one with (expect real rates) — the evidence that actually decides whether the shape meets #551. Do NOT test: throughput A/B (no perf claim; flag-on adds one u64 store + one event per committing step, unmeasurable), TP>1 or multi-host (nothing in the diff), Windows/WinUI (no code path changed there; the enablement gap is a config matter to be decided by code review, not hardware), KV/prefix cache, vision. Cost driver: flare run needs an exported core (docs/cli-design.md:1330-1335) and no prepared core is in cn5's or cn7's cached list — cached names are recipe checkpoints. Confirm a published gb202 TP1 -FLARE core is downloadable before booking; otherwise ignition export dominates the cost.

#8 [high] Verified state of #560 at head 046aaef (2026-11-28)

Head 046aaef, 22 files, +1757/-77 (diff carries stacked #548: metrics.rs +548, latency.rs +24, scheduler.rs +4; #560 own share ≈ +749/-26). PR opened 2026-11-28 02:04, updated 04:12. Draft. Zero human/maintainer comments; only flare-autobot automation + 2 author evidence comments. No CI checks.

FIXED since ce44060 (my prior report's findings a, b, and the Committed-event risk):

NEW/REMAINING DEFECTS at head:

  1. BLOCKING (correctness lens, confirmed in code): the documented enablement breaks every ignition command. ignition/cli/config.py:23-24 _SECTIONS["server"] = {host, port, api_key, thinking_token_budget, scheduler_checkpoint_extra_work_fraction} — no per_request_metrics; :112-114 raises unknown key {key} in [{section}]; the schema is the only gate (:119). Every command loads it: serve.py:127,:174,:264,:431,:590; bench.py:144; publishing.py:31,:73,:174,:194. docs/cli-design.md:1313 "Ignition and native Flare read this file". PR touches neither ignition/cli/config.py nor tests/cli/test_config.py; unknown-key rejection is parametrized at tests/cli/test_config.py:151-177. Fix = one schema entry + positive test.
  2. --enable-per-request-metrics is a plain bool (flare-cli/src/cli.rs:649 OrbitRun, :863 Run) so an explicit false cannot override a file/saved orbit group that enables it; docs/cli-design.md:1321-1322 promises explicit overrides. Cookies: rank_zero_options emits only when true (cli.rs:698-700); flare orbit run never reads [server] per_request_metrics (ConfigFile::apply matches Command::Run at config.rs:58 only; Command::Orbit branch at :141-151 sets only hub caches). So docs/cli-design.md:736 row ("default [server] per_request_metrics") is wrong for orbit run.
  3. Unconditional per-step clock read at runtime.rs:2272 let scheduled_ns = super::observation::monotonic_ns(); runs in both option states (belongs to #548 commit 66245920, which is in this branch's diff). Description now says "the one monotonic read per scheduled model step comes from #548" — accurate, so my prior finding (c) is resolved as prose.
  4. Stamp now lands AFTER pack/pack_vision and conditioned_inputs_ready (runtime.rs:2222-2286) → for image requests queue_time_ms includes image conditioning (my prior code read confirms: stamp at :2272 after the Vision branch :2228-2259).
  5. Nit: mean_itl_ms divides generation by (generated-1), not recorded inter-token intervals (encode.rs:266-268); understates on speculative cores where one step commits several tokens at one instant; the interval count already exists in RequestRecord (metrics.rs:343-362). Documented deviation (api.md:1025-1026).
  6. Doc minor: api.md:1040-1041 says a null field is an "unreached instant" while time_to_first_content_token_ms is always null; api.md:1042 states the n>1 null generally though Chat/Responses/Messages reject n>1 (decode.rs:753). Streamed Responses nest metrics in response, which llama-swap does not read — disclosed in the author's comment, not in docs.

CONFIRMED SOUND at head: encoder placement encode.rs:233-241 (Messages never, !placed||prompts>1 omitted, choices>1 Suppressed→null); metrics_value :251-275 arithmetic matches vLLM definitions; non-stream body placement http.rs:613-615; streaming carrier encode.rs:712-719 (usage chunk) and :729-744 (Responses terminal); gate http.rs:387-389 on state.per_request_metrics; first_scheduled_ns earliest-fold http.rs:412/:529-539; performance tuple extended observation.rs:58-74.

AUTHOR EVIDENCE at head (self-reported, 2026-11-28 04:12): re-validated on one RTX PRO 6000 Blackwell serving local-inference-lab/Qwen3.8-Flash-Next-FLARE gb202, enabled via the [server] key; 40/40 request-matrix checks; content TTFT null; llama-swap shows prompt+generation rates for Chat and Completions; Responses streams show none (nesting). CPU 15.4–15.9 s on vs 16.0–16.3 s off over 16×512-token runs (no measurable overhead). Not run: multi-GPU, Windows.

#9 [high] Hardware-test value calculation at head 046aaef

Delta vs my 2026-11-27 report: the author has now done on hardware essentially the run I would have asked for (40/40 matrix + llama-swap + CPU overhead on an RTX PRO 6000 Blackwell, the exact GPU in cn5). So the marginal information from an independent GPU run is low and confirmatory, unless it is used to check reproducibility or to cover something the author's matrix skips.

What a GPU run can still uniquely settle:

What a GPU cannot settle and must not be booked for:

Cost driver: flare run needs a prepared/exported core, and neither host caches a -FLARE core (cn5: dinov2/GLM/Qwen NVFP4 recipe checkpoints; cn7: GB10 arm64 with FP4 recipe checkpoints). Core acquisition (download a published gb202 TP1 FLARE core, else ignition export) dominates the run. cn5 fits (1 of 4 RTX PRO 6000 Blackwell — same model the author used). cn7/GB10 is not needed: nothing in the diff is arch-specific and the desktop/config path is a code question.

Minimal plan if it is approved after fixes (~30 min GPU + core prep): Phase 0 CPU (no booking): cargo check/test for helios --features server, flare-cli, flare; verification/helios-lifecycle/check.py; then ignition export + ignition serve with the documented [server] key present to prove the schema fix. Phase 1, cn5, one gb202 TP1 core, two servers (key absent / key present): 1 Chat body → top-level metrics, six keys, content instant null. 2 Chat stream with stream_options.include_usage → exactly one carrier, choices==[], six values. 3 Chat stream without include_usage → key absent (documents the #551 gap). 4 Completions n=2 + include_usage → "metrics": null. 5 Completions two prompts → key omitted. 6 Responses stream max_output_tokens=1 → response.incomplete carries metrics inside response. 7 Messages stream/body → never. 8 Single-token Chat → mean_itl_ms null, generation 0. 9 Arithmetic in-script: tokens_per_second == generated/(last-scheduled), mean_itl == generation/(n-1), all non-negative, ttft <= generation+queue. 10 Option off: no machine key anywhere; performance.first_scheduled_ns only with return_token_timestamps. Phase 2 (~10 min, highest value per minute): llama-swap v250 in front: streamed Chat/Completions with include_usage → non-(-1) prompt and generation rates; streamed Responses → confirm documented absence. Not to be tested: TP>1/multi-host, KV/prefix cache, vision, Windows/WinUI, GPU throughput A/B.

#12 [high] Report of 2026-11-28 — FINAL pre-test report for #560 at 046aaef

FINAL REPORT for run of 2026-11-28 at head 046aaef. Decision: DO NOT refer to hardware testing yet; hold for code changes (1 blocking, 4 should-fix). Testing becomes worth ~30 GPU-min on cn5 once items 1-4 land; the plan is minimal-matrix + llama-swap, no throughput A/B.

Verified at head (not taken from the supplied lenses):

Reported expected value as LOW: the author already ran on one RTX PRO 6000 Blackwell (= cn5 GPU model) with llama-swap v250, 40/40 matrix, arithmetic reconciliation, no measurable CPU overhead; the remaining GPU-only question is reproducibility plus two consumer-gap behaviours. Cost driver is core preparation (no -FLARE core cached on cn5/cn7), not the test.

#10 [medium] Orbit-run config-key nuance (corrects a supplied finding)

Correction to the supplied prose lens (should-fix #2): flare orbit run not honoring [server] per_request_metrics is only partly true. flare-cli/src/config.rs:141-151 (Command::Orbit branch) sets only hub caches, so Orbit's own process ignores the key; but rank_zero_options forwards the flag to rank zero's flare run (flare-cli/src/cli.rs:655-729), and rank zero's flare run runs Configuration::apply (config.rs:58) which reads its own config file. On a single-host orbit run (same home, same config.toml) rank zero therefore DOES pick up the key. The docs row docs/cli-design.md:736 is wrong only when rank zero's config file differs from the operator's (paired node). Downgrade to a doc-ambiguity nit, not a should-fix.

Also confirmed: flare-cli/src/main.rs:355-357 writes config["per_request_metrics"] only when true; Bootstrap defaults to false when absent (helios/src/server/config.rs:353-357), so the false path works.

#11 [medium] Verification precision: inter-token count, n>1 reachability, emit sites

The architecture lens' fix for mean_itl_ms ("the interval count already exists — RequestRecord::inter_token observes exactly once per committing step, so carrying that count in RequestTimes would make the field exactly vLLM's at no extra cost") is slightly overstated against the code at 046aaef:

So my report should say: "carrying the interval count in RequestTimes would make the field exactly vLLM's for one extra u32 store per committing step (metrics.rs:354) — cheap, and it re-touches the newly public struct."

Verified also: decode.rs:753-754 rejects n != 1 for every protocol except Completions ("n must be 1"), confirming api.md:1042's general n>1 null sentence covers cases that are 400s on Chat/Responses/Messages. Only Completions can reach metrics:null via n>1.

Verified the streaming carrier and body placement exactly: