Skip to content

docs: add a figure of compute saving against cache size - #2

Merged
1a1a11a merged 3 commits into
mainfrom
jason/blissful-hamilton-bjbil4
Nov 6, 2026
Merged

1a1a11a merged 3 commits into
mainfrom
jason/blissful-hamilton-bjbil4

Conversation

@1a1a11a

@1a1a11a 1a1a11a commented Nov 6, 2026 •

Copy link
Copy Markdown
Member

Adds the results figure to the README. It was meant to be part of #1, but that PR merged with the logo only, before the figure was pushed.

Figure

The figure plots compute saving ratio against cache size, below the README's policy table. It covers 16k to 256k blocks (24 to 384 GiB) on both production traces, for LRU, S3-FIFO, RandomCompute and the BeladyCompute oracle, with the qwen3coder30b_blksz_16 cost model. GitHub's dark theme gets its own version through a <picture> element.

A short paragraph under the figure states what it shows:

  • On freeinference, RandomCompute's lead over LRU shrinks from 10 points at 16k blocks to under 1 point from 64k blocks on, where every policy saves over 91% of prefill compute.
  • On chutes, which has 3.5 times as many distinct blocks, RandomCompute matches LRU from 32k blocks on, and S3-FIFO trails both.
  • On chutes, the oracle stays ahead of LRU by 9 points at 16k blocks and 2 points at 256k.

Files

doc/figures/ contains:

  • compute_saving.svg and compute_saving-dark.svg: the figure, in a version for each GitHub theme.
  • compute_saving.txt: the prefixsim RESULT lines of all 40 runs, which the figure is plotted from.
  • plot_compute_saving.py: the plotting script. It needs matplotlib, and its docstring has the loop that reruns all 40 simulations.

How the data was checked

  • Every point is a real prefixsim run on the Hugging Face traces.
  • All 40 runs report n_unexpected_eviction=0 and n_req_skipped=0.
  • The 16k freeinference results reproduce the README's table exactly, for all four policies.
  • The script writes the same bytes on every run, so regenerating the figure gives a clean diff.

🤖 Generated with Claude Code

https://claude.ai/code/session_015VD7L7yjfBMktJRmHXQGHD

The README's table gives one cache size. The figure gives five, from 16k
to 256k blocks (24 to 384 GiB), for the same four policies and cost model
on both production traces: compute-aware eviction gains most when the
cache is tight, and on freeinference every policy converges by 64k
blocks.

doc/figures/ holds the figure, in a light and a dark variant, the
prefixsim RESULT lines it is plotted from, and the script that plots
them, which also says how to rerun the 40 simulations. The 16k
freeinference results match the README's table. The chutes 256k
RandomCompute run is still going; its point follows.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_015VD7L7yjfBMktJRmHXQGHD
#1 merged with the logo only; the figure commit was
pushed after the merge. Bring the branch up to main so the figure can go
in on its own.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_015VD7L7yjfBMktJRmHXQGHD
The chutes 256k RandomCompute run finished: compute saving 0.7148, against
LRU's 0.7150 and S3-FIFO's 0.7093, so the README's reading of chutes holds
at every cache size. All 40 runs report no unexpected evictions and no
skipped requests.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_015VD7L7yjfBMktJRmHXQGHD
@1a1a11a
1a1a11a requested a review from LauYeeYu November 6, 2026 04:31
@1a1a11a
1a1a11a merged commit bd5b355 into main Nov 6, 2026
4 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants