Skip to content

Pico: fleet decode and token totals from the engine front end's request log - #399

Open
ygbr wants to merge 1 commit into
MiaAI-Lab:mainfrom
ygbr:feat/pico-engine-log-decode
Open

ygbr wants to merge 1 commit into
MiaAI-Lab:mainfrom
ygbr:feat/pico-engine-log-decode

Conversation

@ygbr

@ygbr ygbr commented Nov 12, 2026

Copy link
Copy Markdown

Problem

With the pico-dgx-ds4 recipe serving real clients, the LLM panel and the Fleet decode KPI stay at 0.0 tok/s. Pico publishes no counters, so the only figures sparkDash had were its own benchmark/Showcase streams (dashboard-stream) or the opt-in synthetic sample, which is single-stream speed rather than the clients' traffic. The README says as much today.

What this does

dsfront writes one line per finished request to stderr, and the recipe's service.sh redirects that to a file:

req 630 session 1881682407850016: prompt 55675 (cached 0), completion 1421, tool_calls; ttft 5.692 s, 128.8 tok/s

On Linux units the Pico branch of LlmProbe now follows that log, read-only:

  • Finding it: the dsfront serve process that listens on the probed port, then /proc/<pid>/fd/2. No path is configured and nothing is assumed about the install directory. Local units read through the mounted host /proc (or /proc on bare metal); remote units run one small read-only shell program over the existing SSH transport.
  • Reading it: following starts at the end of the file, so history is never read; each read takes only the appended bytes (capped at 256 KiB, at most every 4 s). In-place truncation (the recipe's live rotation) and an engine restart are handled.
  • Decode rate: each finished request is placed in time from the engine's own figures (completion / tok_s seconds of decode ending when the line was seen); generationTps is the tokens produced inside the trailing minute. Source engine-log, labelled Engine log in the panel (en + zh-CN) with a tooltip saying it trails live traffic.
  • Token totals: totalOutputTokens, totalPromptTokens and totalCachedTokens are counted from the appended lines, so the token ledger and the health evaluator's progress counters work for Pico. They count from when the dashboard began following, and are reset together with the probe's detection state so the ledger never sees a counter fall to zero and jump back.
  • Order of sources: dashboard live stream, then engine log, then the opt-in sample. When the log shows real decode, no synthetic completion is sent on top of it.

What it does not change

  • Other engines: the follower is only polled when the backend is pico.
  • Pico without a readable log (stderr not a regular file, no permission, llmHost set, Mac or Windows units): the follower yields nothing and the probe behaves exactly as before, including the stream-sample setting.
  • A probe constructed without the picoLog option (every existing test) is untouched.
  • The engine is still asked for nothing but /v1/models.

Limitation

A request appears in the log when it ends, so the figure trails live traffic by up to one request, and a single very long request shows nothing until it finishes. That is why the window is a minute and not a few seconds: with a short window the figure sat at zero while requests ran and flashed when they ended. Picom-code/pico-dgx-ds4#12 proposes a real /metrics endpoint; if that lands it is the better live source and this stays useful for installs without it.

Testing

  • npm run typecheck and npm run build pass.
  • npm test: frontend 172 files / 1292 tests pass. Server: 2152 tests, 2127 pass, 23 skipped, 2 fail. The same two fail for me on an untouched main (host-side timeout kills a stuck journal command and its children, without renameat2, mv -n --no-copy -T is used after its self-test), so they look specific to my machine.
  • New: server/collectors/__tests__/picoFrontLog.test.js (13 tests, including the remote shell program run against a stand-in process on Linux) and 4 tests in LlmProbe.pico.test.js, plus one panel test.
  • Running on a 4x DGX Spark cluster (pico-dgx-ds4 over a switch, sparkDash v2.90.0 in the stock compose container on the head, workers over SSH): with coding sessions going through the engine, Fleet decode now follows the traffic and the token tiles count; idle reads 0.0 with the Engine log label.

🤖 Generated with Claude Code

https://claude.ai/code/session_01MFTpsYwigfq8w5F6AnvVAc

…t log

Pico (pico-dgx-ds4) publishes no counters, so the LLM panel and the fleet
decode KPI stay at 0 tok/s while other clients are being served: the only
figures available were the dashboard's own benchmark streams or the opt-in
synthetic sample.

dsfront does log one line per finished request (prompt, cached and
completion tokens, TTFT, decode tok/s). On Linux units the probe now follows
that log read-only: it finds the `dsfront serve` process listening on the
probed port and reads its stderr through /proc/<pid>/fd/2, locally or over
the unit's existing SSH transport. Following starts at the end of the file;
history is never read.

- generationTps: tokens that finished requests produced in the last minute,
  each request spread over its own decode time; source "engine-log",
  labelled "Engine log" in the panel (en, zh-CN)
- totalOutputTokens / totalPromptTokens / totalCachedTokens: counted from the
  appended lines, reset with the probe's detection state
- order: dashboard live stream, then engine log, then the opt-in sample

Nothing changes when the log cannot be followed, for any other engine, or
for a probe built without the follower.

Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01MFTpsYwigfq8w5F6AnvVAc
@MiaAI-Lab

Copy link
Copy Markdown
Owner

Thanks for the work on the request-log follower. It applies cleanly, but it overlaps #411, which is now on main and reads the engine's /metrics counters through the same Pico branch of LlmProbe.js (~L1355). Two problems when both are active: the unconditional if (logged) { this.totalOutputTokens = logged... } after the engine-log branch would overwrite the counter totals with totals counted only since the follower started, and the README still says Pico publishes no counters. Could you rebase on main and run the log follower only when /metrics yields no counters (older dsfront builds), keeping dashboard-stream precedence? Also consider trimming the very long README bullet. Leaving this open for you.

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants