deepseek_v4: emit dashboard telemetry (HWINFO/TIERS/EMAP/PROF/HITS) in serve mode - #882
deepseek_v4: emit dashboard telemetry (HWINFO/TIERS/EMAP/PROF/HITS) in serve mode#882PwrBank wants to merge 3 commits into
Conversation
Adds the serve-protocol HWINFO / TIERS / EMAP / PROF lines the gateway (openai_server.py) parses for the web dashboard. The V4 target engine previously never emitted them, so the Brain/Profiling tabs and the hardware/tier panels stayed on 'waiting for engine'. - expert_store.h: new ColiStoreTelemetry struct + optional emap op on ColiExpertStoreOps (per-expert tier/heat hex map). - deepseek_v4.c: store_emap() implemented inside the expert-store unit (reads the live slot cache + usage under the store mutex); serve loop calls ops->emap/ops->stats and emits TIERS/EMAP, per-turn PROF, and HWINFO (cpuinfo/meminfo) after READY+STAT and after each turn. - Phase timings are not split out by the V4 engine yet: PROF phase fields are 0 and the wall time lands in the UI's 'other' bucket (honest).
The Brain cortex flash effect needs HITS lines (1 bit per expert, per token). The V4 engine tracked nothing, so the cortex stayed dark during decode. - V4ExpertStoreState: routed-expert bitmap (rows*cols bits), allocated in the store open path, freed in destroy/fail. - lookup() and lookup_hot() (both success paths) mark the bit for the routed (layer, expert) under the store mutex. - New ColiExpertStoreOps.hits op: drains + clears the bitmap as hex. - Serve loop: v4_serve_token drains and emits HITS after every token, so the gateway's hits_seq advances during decode and the Brain tab flashes each token's experts live.
…y scale The cortex grid was previously just the 1px inter-cell gap, which aliases away when the canvas bitmap is CSS-scaled to the wrapper (non-integer scale factors drop some column/row lines). Draw a 1px black stroke at every cell boundary so the grid is complete at any display size, and present even when cell < 4 (gap == 0).
|
I tested this with the web command but it does not seem to show HW info and profiling. |
|
The problem is real and your verification of it is the right shape — Three CI checks are failing, so I cannot take it yet. Would you look at those first? I have not dug in, because the fix is yours and guessing at it from here would waste your time as much as mine. Two review notes for when you push again, neither blocking:
One thing I want to flag because it is genuinely in your favour: this touches |
Problem
The DeepSeek V4 target engine (
deepseek_v4) never emits the serve-protocol telemetry lines thatopenai_server.pyparses for the web dashboard. The Brain and Profiling tabs, the hardware panel, and the tier bar all stayed on "waiting for engine" — the UI was ready, the server was ready, but the engine never spoke:HWINFO/TIERS/EMAP(hardware panel, tier bar, expert cortex) — absentPROF(per-turn phase timings for the Profiling page) — absentHITS(live cortex flash of routed experts during decode) — absentVerified against the v1.5.0 binary:
strings deepseek_v4 | grep -c "EMAP"→ 0;/expertsreturned{"rows":0,"cols":0,"map":"","hits":"","seq":0}and/profilereturned{"seq":0,"turns":[]}after real turns.What this adds
c/expert_store.h:ColiStoreTelemetrystruct plus two optional ops onColiExpertStoreOps:emap— per-expert tier/heat hex map (2 chars per expert:(tier << 6) | heat, tier 0=disk 1=RAM, heat = log2(usage) capped at 63)hits— drain+clear a routed-expert bitmap (1 bit per expert, bytei>>3, biti&7)c/deepseek_v4.c:store_emap()/store_hits()implemented inside the expert-store unit, next to the slot cache they read, under the store mutexlookup()and bothlookup_hot()success pathsHWINFO(cpuinfo/meminfo),TIERS+EMAP, and per-turnPROFafter the READY handshake and after each turn (mirrorscolibri.c'smux_doneordering)v4_serve_tokendrains and emitsHITSafter every token, so the Brain cortex flashes routed experts live during decodeVerification (real 284B checkpoint, serve mode)
/healthnow carrieshwinfo(AMD EPYC 7662, 64 cores, RAM totals) andtiers(e.g.ram: 2108, disk: 8900, ram_gb: 28.18after one turn)/experts→rows: 43, cols: 256, 22,016-char map with resident tier + heat bytes set/profile→ real per-turn records (wall_s, token counts, forwards)hits_seqadvanced to exactly 40 (oneHITSemission per token), bitmap populatedKnown limitation (deliberately honest)
The V4 engine has no per-phase timers yet (unlike the GLM engine's
t_ewait/t_emm/t_attnaccumulators), soPROFphase fields are emitted as 0 and the whole wall time lands in the UI's "other" bucket. The per-turn wall/token columns render correctly; the phase breakdown needs engine-side instrumentation, which is a separate change.Base
Based on
main(v1.5.0,8f512fc). Happy to rebase ontodevif you'd rather have it there with the other V4 work.