[PR #793] [CLOSED] Pipelined windows over the active slots (+ slot allocator), /metrics for Prometheus (vLLM names) + monitoring kit #2832

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

📋 Pull Request Information

Original PR: https://github.com/Niko1221/Strata/pull/793
Author: @blange48
Created: 10/4/2026
Status: ❌ Closed

Base: main ← Head: upstream-metrics-autoconfig


📝 Commits (10+)

  • 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
  • 57bd713 sycl: pipeline the expert cache's profile fill (model load 3-4x faster)
  • e3bdd74 A prompt cancelled mid-read is logged and recorded with the tokens it read (#471)
  • f2aaba1 "The draft head does not fit" says what to change (#474)
  • 64987c8 UPDATE.bat / update.sh: update Strata without starting the model (#475)
  • 6d0e648 Opt-in: keep what the expert cache learned across restarts (--expert-profile-save, #477)

📊 Changes

3 files changed (+100 additions, -1 deletions)

View changed files

📝 serve/server.py (+15 -0)
➕ serve/test_slot_alloc.py (+83 -0)
📝 src/program/generate.cpp (+2 -1)

📄 Description

Pipelined windows over the active slots (+ slot allocator), /metrics for Prometheus

These are the parts of #559 that didn't go into 0.1.39, rebased on main (6f32ec0) and adapted to "parallel" and its one status per request. Each commit stands on its own.

1. Pipelined group windows over the active slots (src/program/generate.cpp, 8 lines)

0.1.39 runs the one-GPU batch windows over the active slots. With --batch-groups, a group's window still holds every slot of the group, and the idle ones run pad rows through every layer. The server spreads requests over the groups first, so on a 4-group split two requests sit in two windows that are mostly pad rows. Now a group's window holds its slots up to its last active one. This is crazyaimachine's 8119a7f from #559, without the MTP-draft parts.

4 x RTX 5080 (PCIe Gen3), IQ3_S, 262K context, "parallel": 8, --batch-groups 4 --trim-stage-weights, through the HTTP server, T=0.7, 300 tokens per answer:

Concurrent 0.1.39 with this
1 122 117-122 (unchanged path)
2 99 149
4 199 222
8 366 371

Exactness (--pcie-frac 0 --adapt-every 1000000, STRATA_IQ_MT_MIN=1):

  • tools/batch_test.py: identical to solo with 8 slots and with 3 (groups partly filled);
  • tools/parking_test.py: identical, with 141 MB of K/V reused on the second park.

2. GET /metrics for Prometheus, with vLLM's metric names (serve/prometheus.py, three commits)

  • Format. A Prometheus scrape (Accept: text/plain or openmetrics, or ?format=prometheus) gets the text format. Anything else, the Monitor tab included, keeps the JSON.
  • vLLM names. Dashboards and alerts written for a vLLM server read Strata unchanged. These are the names current vLLM exports:
    • vllm:num_requests_running / _waiting and vllm:kv_cache_usage_perc;
    • the token and request counters;
    • vllm:prefix_cache_queries_total / _hits_total (prompt tokens read / reused);
    • vllm:spec_decode_num_draft_tokens_total / _accepted_tokens_total (the MTP drafts);
    • the histograms vllm:time_to_first_token_seconds, vllm:inter_token_latency_seconds and vllm:e2e_request_latency_seconds.
  • Strata's own facts. What vLLM has no name for comes under strata:, named after its JSON key: strata:live_state, strata:live_slots, strata:live_tok_s, strata:last_hit_rate, strata:gpu_util per card, and so on. The Monitor tab and a Grafana panel read the same value.
  • Source. Everything comes from Service.metrics() plus three latency histograms observed when a request finishes. With "parallel", the histograms read each request's own status, and running / waiting come from live.running / live.waiting.
  • Tests. serve/test_prometheus.py (6 tests): the text format (one # TYPE per family), the histograms, the names against the JSON, and three requests at once against a batch engine double. Documented in docs/DETAILS.md.

We run it in production behind a Prometheus that also scrapes vLLM servers. The same Grafana panels show both.

3. A monitoring kit (docs/monitoring/)

  • prometheus.yml and servicemonitor.yaml scrape /metrics, with the API key sent as a bearer token.
  • grafana-strata.json is a dashboard to import (it asks for the Prometheus data source):
    • its first row uses only vLLM's names, so it reads a vLLM server too;
    • its second row shows the engine's strata: series.
  • Every query was checked against a Prometheus scraping the 4-GPU server above.

Not in this PR any more: the configuration tools. tools/autoconfig.py and tools/tune.py duplicated what setup.py and tools/calibrate.py already do. The useful part, measuring the batch settings with every slot busy, is now a patch to calibrate.py, posted on #907, which changes the same function.

🤖 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/793 **Author:** [@blange48](https://github.com/blange48) **Created:** 10/4/2026 **Status:** ❌ Closed **Base:** `main` ← **Head:** `upstream-metrics-autoconfig` --- ### 📝 Commits (10+) - [`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 - [`57bd713`](https://github.com/Niko1221/Strata/commit/57bd713454ddb4b965f994e95d95cacd68c93fb1) sycl: pipeline the expert cache's profile fill (model load 3-4x faster) - [`e3bdd74`](https://github.com/Niko1221/Strata/commit/e3bdd7449223c4305ef53e331538346765855a2c) A prompt cancelled mid-read is logged and recorded with the tokens it read (#471) - [`f2aaba1`](https://github.com/Niko1221/Strata/commit/f2aaba1e3d219a6ff165fca367d92b6a1dad7080) "The draft head does not fit" says what to change (#474) - [`64987c8`](https://github.com/Niko1221/Strata/commit/64987c891dc7cf3edb954f5b5f6b8cde233594db) UPDATE.bat / update.sh: update Strata without starting the model (#475) - [`6d0e648`](https://github.com/Niko1221/Strata/commit/6d0e648f65795a510d41be9ecbaaf24f54854001) Opt-in: keep what the expert cache learned across restarts (--expert-profile-save, #477) ### 📊 Changes **3 files changed** (+100 additions, -1 deletions) <details> <summary>View changed files</summary> 📝 `serve/server.py` (+15 -0) ➕ `serve/test_slot_alloc.py` (+83 -0) 📝 `src/program/generate.cpp` (+2 -1) </details> ### 📄 Description ## Pipelined windows over the active slots (+ slot allocator), `/metrics` for Prometheus These are the parts of #559 that didn't go into 0.1.39, rebased on main (6f32ec0) and adapted to `"parallel"` and its one status per request. Each commit stands on its own. ### 1. Pipelined group windows over the active slots (`src/program/generate.cpp`, 8 lines) 0.1.39 runs the one-GPU batch windows over the active slots. With `--batch-groups`, a group's window still holds every slot of the group, and the idle ones run pad rows through every layer. The server spreads requests over the groups first, so on a 4-group split two requests sit in two windows that are mostly pad rows. Now a group's window holds its slots up to its last active one. This is crazyaimachine's 8119a7f from #559, without the MTP-draft parts. 4 x RTX 5080 (PCIe Gen3), IQ3_S, 262K context, `"parallel": 8`, `--batch-groups 4 --trim-stage-weights`, through the HTTP server, T=0.7, 300 tokens per answer: | Concurrent | 0.1.39 | with this | | ---: | ---: | ---: | | 1 | 122 | 117-122 (unchanged path) | | 2 | 99 | **149** | | 4 | 199 | **222** | | 8 | 366 | 371 | Exactness (`--pcie-frac 0 --adapt-every 1000000`, `STRATA_IQ_MT_MIN=1`): - `tools/batch_test.py`: identical to solo with 8 slots and with 3 (groups partly filled); - `tools/parking_test.py`: identical, with 141 MB of K/V reused on the second park. ### 2. `GET /metrics` for Prometheus, with vLLM's metric names (`serve/prometheus.py`, three commits) - **Format.** A Prometheus scrape (`Accept: text/plain` or openmetrics, or `?format=prometheus`) gets the text format. Anything else, the Monitor tab included, keeps the JSON. - **vLLM names.** Dashboards and alerts written for a vLLM server read Strata unchanged. These are the names current vLLM exports: - `vllm:num_requests_running` / `_waiting` and `vllm:kv_cache_usage_perc`; - the token and request counters; - `vllm:prefix_cache_queries_total` / `_hits_total` (prompt tokens read / reused); - `vllm:spec_decode_num_draft_tokens_total` / `_accepted_tokens_total` (the MTP drafts); - the histograms `vllm:time_to_first_token_seconds`, `vllm:inter_token_latency_seconds` and `vllm:e2e_request_latency_seconds`. - **Strata's own facts.** What vLLM has no name for comes under `strata:`, named after its JSON key: `strata:live_state`, `strata:live_slots`, `strata:live_tok_s`, `strata:last_hit_rate`, `strata:gpu_util` per card, and so on. The Monitor tab and a Grafana panel read the same value. - **Source.** Everything comes from `Service.metrics()` plus three latency histograms observed when a request finishes. With `"parallel"`, the histograms read each request's own status, and running / waiting come from `live.running` / `live.waiting`. - **Tests.** `serve/test_prometheus.py` (6 tests): the text format (one `# TYPE` per family), the histograms, the names against the JSON, and three requests at once against a batch engine double. Documented in `docs/DETAILS.md`. We run it in production behind a Prometheus that also scrapes vLLM servers. The same Grafana panels show both. ### 3. A monitoring kit (`docs/monitoring/`) - `prometheus.yml` and `servicemonitor.yaml` scrape `/metrics`, with the API key sent as a bearer token. - `grafana-strata.json` is a dashboard to import (it asks for the Prometheus data source): - its first row uses only vLLM's names, so it reads a vLLM server too; - its second row shows the engine's `strata:` series. - Every query was checked against a Prometheus scraping the 4-GPU server above. **Not in this PR any more:** the configuration tools. `tools/autoconfig.py` and `tools/tune.py` duplicated what `setup.py` and `tools/calibrate.py` already do. The useful part, measuring the batch settings with every slot busy, is now a patch to `calibrate.py`, posted on #907, which changes the same function. 🤖 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:03:26 +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#2832
No description provided.