mirror of
https://github.com/kvcache-ai/kvcache-blog.git
synced 2026-11-05 01:07:35 +00:00
[PR #49] [MERGED] KV Cache Calculator: recurrent state precision for every linear-attention model #49
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#49
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/49
Author: @Venkat2811
Created: 9/25/2026
Status: ✅ Merged
Merged: 10/20/2026
Merged by: @ykwd
Base:
main← Head:feat/recurrent-state-precision-all-linear📝 Commits (2)
bd146dcKV Cache Calculator: recurrent state precision for every linear-attention modelca33c9fKV Cache Calculator: recurrent-state tooltip only on its ? button📊 Changes
5 files changed (+161 additions, -24 deletions)
View changed files
📝
assets/js/kv-cache-calculator.js(+58 -18)📝
layouts/shortcodes/kv-cache-calculator.html(+3 -3)📝
packages/kvcache-simulator/src/kvcache_sim/calculator.py(+51 -3)📝
packages/kvcache-simulator/tests/test_kvcache_sim.py(+25 -0)📝
tests/kv-cache-calculator.test.mjs(+24 -0)📄 Description
Summary
The recurrent-state precision selector applies to the Qwen formula only; the two Kimi KDA formulas fix the recurrent state at 4 bytes per element. Engines make this a choice: SGLang
--mamba-ssm-dtype(bf16 is required for FlashInfer GDN decode on SM100+), vLLM--mamba-ssm-cache-dtype.Changes
kda_recurrent_state_bytes_per_elementsays 2calculate_cache_size(recurrent_state_precision=...)with the same defaults and labels; its Qwen convolution term now counts kernel - 1 past inputs, as the web calculator does (it counted the full kernel)Validation
node --test tests/*.test.mjs: 156 of 157, the failing catalog test predates this change; new tests: Kimi K3 checkpoint 449,372,160 B at fp32 and 232,316,928 B at bf16, GLM-5.3-Flash follows the selectorpytest packages/kvcache-simulator: 26 passed, including Qwen3.8 state bytes equal to the web values (74.8125 MiB bf16, 146.8125 MiB fp32)🤖 Generated with Claude Code
🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.