[PR #39] [CLOSED] telemetry: decode-only cache hit rate, prompt checkpoint retention, and dashboard #2425

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

📋 Pull Request Information

Original PR: https://github.com/Niko1221/Strata/pull/39
Author: @code-martin
Created: 9/28/2026
Status: ❌ Closed

Base: main ← Head: feature/decode-hit-rate-telemetry


📝 Commits (3)

  • 5b51359 core: implement elastic expert cache via CUDA VMM and on-demand GPU vision
  • 2b4cf19 moe: continuous adaptive expert cache eviction with exponential decay
  • 1d40c82 telemetry: decode-only expert cache hit rate and web dashboard monitor

📊 Changes

8 files changed (+833 additions, -92 deletions)

View changed files

📝 CMakeLists.txt (+2 -2)
📝 include/strata/core/expert_cache.hpp (+67 -0)
📝 serve/server.py (+227 -28)
📝 serve/web/app.js (+25 -3)
📝 serve/web/index.html (+4 -2)
📝 src/core/expert_cache.cpp (+338 -36)
📝 src/program/generate.cpp (+124 -21)
➕ tools/test_vision_client.py (+46 -0)

📄 Description

Summary

Refines MoE cache telemetry to accurately report token generation hit rate (excluding prompt prefill skew), adds multi-turn prefix/system prompt KV cache retention, and provides real-time cache metrics in the web UI.

Key Changes

  • Decode-Only Hit Rate Baseline:
    • Captures baseline cache lookups and hits at the exact boundary where prompt processing ends and autoregressive decode begins.
    • Excludes static prompt evaluation from token generation hit rate statistics, reflecting true decode performance.
  • Prefix & System Prompt Checkpoint Retention:
    • Creates prompt checkpoints at every turn boundary (<|im_start|>) rather than solely at the very last one.
    • Preserves the root checkpoint (checks[0], holding system prompt and initial instructions) during FIFO cache eviction, allowing branching conversations and parallel subagents to immediately reuse the shared prefix.
  • Engine Protocol Enhancements:
    • Extends the DONE line to output
      eq_hits,
      eq_look, otal_swaps, and drift.
    • Adds the STATS command for queryable cumulative telemetry.
  • Web UI & REST API:
    • Exposes
      ecent_hit_pct,
      ecent_hits,
      ecent_lookups, and cumulative counters in /metrics and /api/stats.
    • Adds an Expert Cache Hit Rate progress bar and swap counter to the Monitor tab.
    • Adds a dedicated Hit rate column to the Recent requests table in the web dashboard.

Testing

  • Verified live on web dashboard: displays accurate per-request decode hit rates (e.g. 51.2%, 45.6%) and aggregate moving window percentages.
  • Verified prompt cache hit behavior with multi-turn chat: turn prefixes and system prompt are retained and reused across turns.

🔄 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/39 **Author:** [@code-martin](https://github.com/code-martin) **Created:** 9/28/2026 **Status:** ❌ Closed **Base:** `main` ← **Head:** `feature/decode-hit-rate-telemetry` --- ### 📝 Commits (3) - [`5b51359`](https://github.com/Niko1221/Strata/commit/5b513598747f7fcc129f67b6bc7e2d7e09596c04) core: implement elastic expert cache via CUDA VMM and on-demand GPU vision - [`2b4cf19`](https://github.com/Niko1221/Strata/commit/2b4cf1994f273e0343e15ed37ae701d163766957) moe: continuous adaptive expert cache eviction with exponential decay - [`1d40c82`](https://github.com/Niko1221/Strata/commit/1d40c82f2ed864d16e31878000ff71bbf704c979) telemetry: decode-only expert cache hit rate and web dashboard monitor ### 📊 Changes **8 files changed** (+833 additions, -92 deletions) <details> <summary>View changed files</summary> 📝 `CMakeLists.txt` (+2 -2) 📝 `include/strata/core/expert_cache.hpp` (+67 -0) 📝 `serve/server.py` (+227 -28) 📝 `serve/web/app.js` (+25 -3) 📝 `serve/web/index.html` (+4 -2) 📝 `src/core/expert_cache.cpp` (+338 -36) 📝 `src/program/generate.cpp` (+124 -21) ➕ `tools/test_vision_client.py` (+46 -0) </details> ### 📄 Description ### Summary Refines MoE cache telemetry to accurately report token generation hit rate (excluding prompt prefill skew), adds multi-turn prefix/system prompt KV cache retention, and provides real-time cache metrics in the web UI. ### Key Changes - **Decode-Only Hit Rate Baseline**: - Captures baseline cache lookups and hits at the exact boundary where prompt processing ends and autoregressive decode begins. - Excludes static prompt evaluation from token generation hit rate statistics, reflecting true decode performance. - **Prefix & System Prompt Checkpoint Retention**: - Creates prompt checkpoints at every turn boundary (<|im_start|>) rather than solely at the very last one. - Preserves the root checkpoint (checks[0], holding system prompt and initial instructions) during FIFO cache eviction, allowing branching conversations and parallel subagents to immediately reuse the shared prefix. - **Engine Protocol Enhancements**: - Extends the DONE line to output eq_hits, eq_look, otal_swaps, and drift. - Adds the STATS command for queryable cumulative telemetry. - **Web UI & REST API**: - Exposes ecent_hit_pct, ecent_hits, ecent_lookups, and cumulative counters in /metrics and /api/stats. - Adds an **Expert Cache Hit Rate** progress bar and swap counter to the Monitor tab. - Adds a dedicated **Hit rate** column to the Recent requests table in the web dashboard. ### Testing - Verified live on web dashboard: displays accurate per-request decode hit rates (e.g. 51.2%, 45.6%) and aggregate moving window percentages. - Verified prompt cache hit behavior with multi-turn chat: turn prefixes and system prompt are retained and reused across turns. --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
bsakaguchi 2026-11-04 02:00:01 +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#2425
No description provided.