mirror of
https://github.com/kvcache-ai/kvcache-blog.git
synced 2026-11-05 01:07:35 +00:00
[PR #14] [MERGED] Add KV Cache Workload Analyzer #15
Labels
No labels
pull-request
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
kvcache-ai/kvcache-blog#15
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
📋 Pull Request Information
Original PR: https://github.com/kvcache-ai/kvcache-blog/pull/14
Author: @yokinoshitayoki
Created: 6/10/2026
Status: ✅ Merged
Merged: 6/12/2026
Merged by: @ykwd
Base:
main← Head:main📝 Commits (10+)
dd641ecAdd KV Cache Lab tool7c8a176Enhance KV Cache Lab trace simulation5801a08Address KV Cache Lab review feedback43cdc4bCompress KV Cache Lab precomputed data34b0273Validate uploaded traces before simulationb5d5f86Rename KV cache workload toolaa5d746Validate uploaded trace schema and JS hash idsa762eeeMerge branch 'main' of github.com:yokinoshitayoki/kvcache-blog6068096Fix upload calculation max event constantd04381bClarify upload progress phases📊 Changes
36 files changed (+226909 additions, -6 deletions)
View changed files
➕
.gitattributes(+2 -0)📝
.gitignore(+8 -0)📝
README.md(+1 -1)➕
assets/js/kv-cache-lab-worker.js(+443 -0)➕
assets/js/kv-cache-lab.js(+4329 -0)➕
assets/wasm/kvcache-sim.wasm(+0 -0)📝
config/_default/hugo.yaml(+1 -1)📝
config/_default/params.yaml(+1 -1)📝
content/_index.md(+1 -1)➕
content/tools/kv-cache-analyzer/index.md(+13 -0)📝
content/tools/kv-cache-size-calculator/index.md(+0 -0)➕
data/kv_cache_lab/precomputed.json(+214630 -0)➕
data/kv_cache_lab/presets.yaml(+92 -0)📝
layouts/partials/blox/hero.html(+2 -2)➕
layouts/shortcodes/kv-cache-lab.html(+766 -0)➕
scripts/build-wasm.sh(+17 -0)➕
scripts/kv-cache-lab-extend-precomputed.mjs(+114 -0)➕
scripts/kv-cache-lab-fetch-traces.mjs(+6 -0)➕
scripts/kv-cache-lab-full-precompute.mjs(+1458 -0)➕
scripts/kv-cache-lab-merge-precomputed.mjs(+78 -0)...and 16 more files
📄 Description
Summary
This PR adds KV Cache Workload Analyzer, a new interactive tool for estimating KV cache behavior across models, traces, memory budgets, and eviction policies.
KV Cache Lab helps users answer: given a model, a request trace, and a KV cache memory budget, what steady-state prefill token hit rate can be expected under FIFO, LRU, and theoretical Optimal eviction?
What Changed
/tools/kv-cache-lab/.Customize Trace
This PR also adds Customize trace support, proposed by fatSheep (@00fish0).
Users can upload their own
.jsonlor.jsonl.gztrace files directly in the browser. Files are processed locally and are not uploaded to any server. Uploaded traces are simulated with the same FIFO/LRU/Optimal policies and shown in the same charts as public traces.Each JSONL record declares block identity through
hash_ids, input token length throughinput_length, and native trace granularity throughblock_size.Notes
KV Cache Lab is a theoretical simulator. It models block-level cache admission/eviction and token-weighted prefill hit rate, but it does not model all production system effects such as batching, scheduling, network transfer, KV lookup overhead, memory bandwidth, high-watermark batch eviction, or engine-specific implementation details.
Validation
node --test tests/kv-cache-calculator.test.mjs tests/kv-cache-lab.test.mjs tests/kv-cache-lab-pool.test.mjs tests/kv-cache-lab-wasm.test.mjs tests/kv-cache-lab-traces.test.mjs/private/tmp/hugo-0.126.3/hugo --minify/tools/kv-cache-lab/🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.