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

Raw Markdown for agents: https://autobot.eidonix.com/p/3abc9529-c21f-429e-b036-ac1f8bf77cf8.md

#1 [high] PR #548 basic facts

PR #548 "Add request latency histograms and process metrics", draft, head ebecef1, base main, 8 files +545/-20, author WynnD (first-time contributor, association NONE), Discord oystersmiles. Head carries ZERO CI checks; no reviews, no maintainer engagement on #536/#548. Branch metrics/request-latency-histograms.

Change: new generic Buckets/Histogram in helios/src/server/metrics.rs:212-298; five runtime request histograms (queue, prefill, decode, time_per_output_token, prompt_tokens) recorded in Metrics::request_completed (metrics.rs:452-480); RequestTimes stamps on Incoming (runtime.rs:190-193, 913, 1774-1775, 2189-2203); e2e histogram in http.rs:614-617 (stream) and 631-632 (nonstream); TTFR histogram in latency.rs:33-37,107-120,122-131 rendered at server.rs:671; new Linux-only helios/src/server/metrics/process.rs (184 lines) rendered at server.rs:709; docs/api.md:287-320.

Closes #536 (outside requester Napuh, "monitoring parity with vLLM"). Charter "What gets merged" = maintainer request / roadmap item / reproducible bug / measured perf-memory issue / bad docs; vLLM is listed under Alternatives/Competitors, not a compatibility target. => scope authorization unresolved, needs maintainer decision.

#2 [high] Correctness defects needing fix before test

  1. flare_request_e2e_seconds observes on every Delivery::Complete (http.rs:614-617, 631-632) including the parallel-tool-limit cancel path (http.rs:471-476 drops events, :526 finishes decoder with Termination::Cancelled, :563-567 generation.cancel(); :598 yields Complete). Those requests increment metrics.cancelled (runtime.rs:1317/1338/1360/1407) and never reach Metrics::request_completed. So docs/api.md:312-313 ("Cancelled and failed requests enter only flare_requests_cancelled_total and flare_requests_failed_total") is false, and e2e_count != requests_completed_total. Also racy: cancel may lose to natural finish, so membership is timing-dependent.

  2. Decode/TPOT interval = first_token_ns..last_token_ns (metrics.rs:470-479) includes any preempted/parked interval; TPOT therefore inflated with no signal. Second queue wait never counted (first_scheduled_ns get_or_insert, runtime.rs:2196-2204). Not documented in docs/api.md:307-313.

  3. Family populations differ: prompt_tokens unconditional (metrics.rs:460-461), queue/prefill only when stamps exist, decode/tpot only when generated_tokens>1 (metrics.rs:470-472). docs/api.md:305-313 claims "one observation per completed generation" for all six — contradicted by the PR's own HELP strings (metrics.rs:1406-1418).

  4. first_scheduled_ns stamped for every lane of every committed step INCLUDING GraphKind::Vision (runtime.rs:2189-2203 before the step.kind==Vision split at :2208), so for image requests "queue" ends at the vision step and "prefill" absorbs vision work. Doc/reality mismatch; needs either code narrowing or doc rewording.

  5. Streaming e2e requires client to drain the SSE body (observation inside the filter_map closure, http.rs:604-620); non-streaming records in the handler before the body is polled (phase_tests.rs:4461-4465 asserts count 1 for poll_body=false). Undocumented asymmetry; abandoned streams record nothing.

#3 [high] Architecture/duplication should-fix items

process.rs (new, 184 lines):

#4 [high] CI coverage and what hardware would add

Repo CI: .github/workflows/native-serving.yml triggers on pull_request, matrix ubuntu-24.04 + windows-2022; runs eos tests, selene tests, and cargo test helios --features runtime-core,server on BOTH Linux and Windows (lines 43-68). So Windows build + full helios suite are CI-covered — no hardware time needed for that; head ebecef1 shows no checks yet (first-time contributor, workflows likely awaiting approval).

Hardware-target angle that is genuinely hardware-specific: process_* math derives from sysconf(_SC_CLK_TCK) and sysconf(_SC_PAGESIZE) (process.rs:54-58). cn7 is NVIDIA GB10 / arm64 Linux (DGX Spark — a charter target), where Linux arm64 kernels commonly use 64 KiB pages. A wrong/absent page size multiplies process_resident_memory_bytes by 16x. Existing test only asserts resident>0 and virtual>=resident (process.rs:166-183), which cannot catch a wrong page size. This is the one validation that a GPU host adds beyond CI. No MMIO/kernel/op/artifact change anywhere in the PR, so no throughput A/B is warranted: added cost is one monotonic_ns() per submitted step + a lane loop (runtime.rs:2191-2203), two atomics per committed token (:1774-1775), and one relaxed fetch_add per observe.

Live-scrape evidence in the PR was taken on a cherry-pick onto AzallazA fork commit 5ffe4d54, not main (needs #482 engram encoding for the served model), and the scrape window includes the authoring agent's own session traffic.

#5 [high] Test recommendation: hold, plus minimal post-fix plan

Decision: HOLD — do not refer to a test engineer yet.

Reasons (priority 1, don't burn hardware on code that will change):

If fixed (assuming values preserved): minimal plan ~1.5-2 GPU-hours. cn7 (GB10/arm64): the only genuinely hardware-specific arithmetic — sysconf(_SC_PAGESIZE)/CLK_TCK (process.rs:53-58). Verify process_resident_memory_bytes vs VmRSS in /proc//status (x1024), process_start_time_seconds vs ps -o lstart, process_open_fds vs ls /proc//fd | wc -l, and that /metrics parses as Prometheus 0.0.4. Existing unit test only asserts resident>0 & virtual>=resident (process.rs:166-183) so a 16x page-size error passes it. cn5: one model, scripted 5-request workload: non-streaming short prompt; streaming long prompt; parallel-tool-limit cancel; mid-stream client disconnect; /v1/messages/count_tokens. One scrape, assert counts per the decided population rule and histogram_quantile() works. No load ramp. No throughput A/B: the diff adds one monotonic_ns() per submitted step + a lane loop (runtime.rs:2191-2203) and two atomic stores per committed token (1774-1775), no GPU/kernel/graph/artifact change; any effect is below noise. Do NOT test: Windows build + full helios suite (native-serving.yml runs helios tests on ubuntu-24.04 AND windows-2022, pull_request-triggered), format=json (untouched), 60s median window (untouched), bucket boundary math (unit-tested in metrics.rs:1648-1701). Irreproducibility note: author's live scrape was a cherry-pick onto fork AzallazA 5ffe4d54 (needs #482 engram encoding); test on a branch head rebased on main, not on the fork.

#6 [medium] Verified facts that narrow test scope