[PR #581] [CLOSED] serve: the Monitor's per-GPU cards, each card's free VRAM, and the vi… #2705

Closed
opened 2026-11-04 02:02:30 +07:00 by bsakaguchi · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/Niko1221/Strata/pull/581
Author: @gopinath87607
Created: 10/3/2026
Status: ❌ Closed

Base: main ← Head: monitor-gpu-cards


📝 Commits (10+)

  • fa16567 setup: an earlier config that does not parse is skipped, not a crash; configs are written atomically (#459)
  • 749d957 setup (--backend hip): a system ROCm without the HIP development files falls back to the wheels (#446)
  • 5a30024 calibrate: the engine's arguments come from the server's engine_args; a failed tuning says why (#447)
  • 9f60d13 serve, setup: name the small split card that caps the prompt chunk; setup recommends the big card alone (#448)
  • eb8da1d /metrics: each request's speculative draft counts, and their sums in the totals (#457)
  • 6a09387 setup (--gguf-dir): GGUFs Strata cannot run are named as such, with the --family/--model to use (#444)
  • d6a91e2 docs: the Coder is weaker outside code, Chinese/CJK text included; the unpruned sizes for that (#438)
  • d8d4ad3 Merge branch 'f-135-eng' into rel-0.1.35
  • 7b600d5 Merge branch 'f-135-small' into rel-0.1.35
  • d9ab843 Engine 0.1.35: Windows AMD uses its bundled HIP runtime (#468 #461), the low-RAM resident mode on Windows 32 GB PCs (#467), fixes #460 #459 #446 #447 #457 #448 #444; setup requires it

📊 Changes

7 files changed (+377 additions, -28 deletions)

View changed files

📝 serve/server.py (+63 -17)
📝 serve/telemetry.py (+10 -3)
📝 serve/test_server.py (+138 -2)
📝 serve/web/app.css (+9 -0)
📝 serve/web/app.js (+88 -5)
📝 serve/web/index.html (+4 -0)
📝 src/program/generate.cpp (+65 -1)

📄 Description

What this is

The split is invisible in the UI: the metric cards show pooled totals, so a four-GPU run reads the
same as one card holding 27 GiB. Each GPU now gets its own card, built from what the engine alone
knows — its layer range, its KV and prompt buffers, its expert cache — paired with that card's VRAM
from NVML.

The engine side

The engine reports its own allocation as seven parallel CSV fields on the INFO line:

gpu_dev, gpu_layers, gpu_kv_mib, gpu_buf_mib, gpu_experts, gpu_expert_mib, gpu_draft_mib

They are single comma-separated tokens because the server's INFO parser splits on whitespace. A
remote-expert GPU runs no stage, so its layer span is -; the MTP head is reported on the one card
engine: it knows only its own allocations, and NVML already reports used/free/total.

Every device the engine uses gets exactly one card, and the cards' expert counts and bytes sum to the
expert_slots / expert_cache_mib totals above them — they are built from the same accessors. A
helper device is never also a stage device: remote_dev skips the split's own cards and device 0.

The server side

NVML's mem_free was being read and thrown away, so telemetry now keeps it, and each card's name is
asked for once rather than once a second.

The vision footprint

The image encoder is a separate process that reports no memory of its own — not to stdout, not to
the log — so its footprint is measured as what that card's free VRAM lost while it started.
strata-vision runs a 2048px warm-up before printing READY, so every buffer it will ever need is
allocated by the time the reading is taken; a delta outside 64–8192 MiB is noise rather than this
process and is discarded, keeping the last good number.

The encoder is also pinned to the card the config names (vision.cuda_device, else the engine's
first), which is the card the Monitor has to show it on.

Folded in: two fixes found on the way

  • free_vram_mib is one helper taking an index rather than two copies of the same NVML call.
  • The vision encoder is pinned as described above.

A third fix that rode in the same commit on the old branch — an image source that 404s, refuses the
connection or names an unknown host answering with no reply at all instead of a 400 — is not here:
that is an image-API change, not a Monitor one, so it lives on serve-tool-result-images.

Testing

serve's 127 tests pass on v0.1.38 (python3 -m unittest serve.test_server). The new ones are the
server half: the seven CSV fields surviving the INFO parser as single tokens, a "-,835,-,-" draft
list staying strings, the vision block on /metrics, and the vision footprint's noise rejection (an
implausible delta, a bad restart, no encoder, a stopped encoder). The card rendering is app.js,
which this repo does not test.

🤖 Generated with Claude Code


🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/Niko1221/Strata/pull/581 **Author:** [@gopinath87607](https://github.com/gopinath87607) **Created:** 10/3/2026 **Status:** ❌ Closed **Base:** `main` ← **Head:** `monitor-gpu-cards` --- ### 📝 Commits (10+) - [`fa16567`](https://github.com/Niko1221/Strata/commit/fa165679f9860552ac97ebd07118bb8db286be4a) setup: an earlier config that does not parse is skipped, not a crash; configs are written atomically (#459) - [`749d957`](https://github.com/Niko1221/Strata/commit/749d957a1790b1a171dd4a01ab3e31b3882c9892) setup (--backend hip): a system ROCm without the HIP development files falls back to the wheels (#446) - [`5a30024`](https://github.com/Niko1221/Strata/commit/5a3002446dbb9dfcabb7d0bd9f113da90cc2f3c0) calibrate: the engine's arguments come from the server's engine_args; a failed tuning says why (#447) - [`9f60d13`](https://github.com/Niko1221/Strata/commit/9f60d13246e46b02b1dd0841980b4d18b0faaea7) serve, setup: name the small split card that caps the prompt chunk; setup recommends the big card alone (#448) - [`eb8da1d`](https://github.com/Niko1221/Strata/commit/eb8da1d8c26ec41e6ffb084fdf579dba7cad10bd) /metrics: each request's speculative draft counts, and their sums in the totals (#457) - [`6a09387`](https://github.com/Niko1221/Strata/commit/6a093874fe037020f49bd5cf053879ff6a133c21) setup (--gguf-dir): GGUFs Strata cannot run are named as such, with the --family/--model to use (#444) - [`d6a91e2`](https://github.com/Niko1221/Strata/commit/d6a91e2d1770d0f469d6ec15890acc7ee93e764c) docs: the Coder is weaker outside code, Chinese/CJK text included; the unpruned sizes for that (#438) - [`d8d4ad3`](https://github.com/Niko1221/Strata/commit/d8d4ad337d3c98ba21d3bd0af1a16e9177e112b6) Merge branch 'f-135-eng' into rel-0.1.35 - [`7b600d5`](https://github.com/Niko1221/Strata/commit/7b600d55ff801caaaa11542af1523050992e049b) Merge branch 'f-135-small' into rel-0.1.35 - [`d9ab843`](https://github.com/Niko1221/Strata/commit/d9ab8435f654c368c586340d490915f6addf56a3) Engine 0.1.35: Windows AMD uses its bundled HIP runtime (#468 #461), the low-RAM resident mode on Windows 32 GB PCs (#467), fixes #460 #459 #446 #447 #457 #448 #444; setup requires it ### 📊 Changes **7 files changed** (+377 additions, -28 deletions) <details> <summary>View changed files</summary> 📝 `serve/server.py` (+63 -17) 📝 `serve/telemetry.py` (+10 -3) 📝 `serve/test_server.py` (+138 -2) 📝 `serve/web/app.css` (+9 -0) 📝 `serve/web/app.js` (+88 -5) 📝 `serve/web/index.html` (+4 -0) 📝 `src/program/generate.cpp` (+65 -1) </details> ### 📄 Description ## What this is The split is invisible in the UI: the metric cards show pooled totals, so a four-GPU run reads the same as one card holding 27 GiB. Each GPU now gets its own card, built from what the engine alone knows — its layer range, its KV and prompt buffers, its expert cache — paired with that card's VRAM from NVML. ## The engine side The engine reports its own allocation as seven parallel CSV fields on the `INFO` line: gpu_dev, gpu_layers, gpu_kv_mib, gpu_buf_mib, gpu_experts, gpu_expert_mib, gpu_draft_mib They are single comma-separated tokens because the server's `INFO` parser splits on whitespace. A remote-expert GPU runs no stage, so its layer span is `-`; the MTP head is reported on the one card engine: it knows only its own allocations, and NVML already reports used/free/total. Every device the engine uses gets exactly one card, and the cards' expert counts and bytes sum to the `expert_slots` / `expert_cache_mib` totals above them — they are built from the same accessors. A helper device is never also a stage device: `remote_dev` skips the split's own cards and device 0. ## The server side NVML's `mem_free` was being read and thrown away, so telemetry now keeps it, and each card's name is asked for once rather than once a second. ## The vision footprint The image encoder is a separate process that reports no memory of its own — not to stdout, not to the log — so its footprint is measured as what that card's free VRAM lost while it started. `strata-vision` runs a 2048px warm-up before printing `READY`, so every buffer it will ever need is allocated by the time the reading is taken; a delta outside 64–8192 MiB is noise rather than this process and is discarded, keeping the last good number. The encoder is also pinned to the card the config names (`vision.cuda_device`, else the engine's first), which is the card the Monitor has to show it on. ## Folded in: two fixes found on the way * `free_vram_mib` is one helper taking an index rather than two copies of the same NVML call. * The vision encoder is pinned as described above. A third fix that rode in the same commit on the old branch — an image source that 404s, refuses the connection or names an unknown host answering with no reply at all instead of a 400 — is **not** here: that is an image-API change, not a Monitor one, so it lives on `serve-tool-result-images`. ## Testing `serve`'s 127 tests pass on `v0.1.38` (`python3 -m unittest serve.test_server`). The new ones are the server half: the seven CSV fields surviving the `INFO` parser as single tokens, a `"-,835,-,-"` draft list staying strings, the `vision` block on `/metrics`, and the vision footprint's noise rejection (an implausible delta, a bad restart, no encoder, a stopped encoder). The card rendering is `app.js`, which this repo does not test. 🤖 Generated with [Claude Code](https://claude.com/claude-code) --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
bsakaguchi 2026-11-04 02:02:30 +07:00
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
Niko1221/Strata#2705
No description provided.