Add CachePilot KVCache benchmark and evaluation suite#2844
Conversation
Non-invasive evaluation suite under benchmarks/cachepilot wrapping official store_kv_bench.py with prefix reuse and retrieval scheduler evaluation, plus Streamlit dashboard. Co-authored-by: Cursor <cursoragent@cursor.com>
There was a problem hiding this comment.
Code Review
This pull request introduces CachePilot, a non-invasive evaluation suite for Mooncake's KVCache. It includes wrappers for running official store benchmarks, prefix cache reuse simulations, retrieval scheduler simulations, and a Streamlit dashboard for visualization. The feedback highlights a hardcoded Python path in the Windows batch script that hinders portability, as well as logic bugs and redundant code in the store runner script regarding the default object count handling for the write verification scenario.
Important
The consumer version of Gemini Code Assist on GitHub is being sunset. Starting June 18, 2026, new organization installations will be blocked, and all code review activity will officially cease on July 17, 2026.
For more details on the timeline and next steps, please review the Help Documentation.
| echo [.venv not found] Creating with D:\python.exe ... | ||
| D:\python.exe -m venv .venv |
There was a problem hiding this comment.
The script contains a hardcoded absolute path to D:\\python.exe when creating the virtual environment. This is highly specific to a single local machine and will fail on almost all other Windows environments. It is recommended to use the standard python command instead.
echo [.venv not found] Creating with python ...\n python -m venv .venv
| nr_objects = args.nr_objects | ||
| if args.scenario == "verify_write" and args.nr_objects == 64: | ||
| # Keep user override if they set --nr-objects; default path uses 16 in scripts | ||
| pass |
There was a problem hiding this comment.
There is a logic bug in how nr_objects is handled for the verify_write scenario. The code uses pass when args.nr_objects == 64, which does nothing and leaves nr_objects as 64. Combined with the unconditional overwrite on lines 387-390, the intended default of 16 is never applied when running the script directly without explicitly passing --nr-objects. Setting nr_objects = 16 here fixes this issue.
nr_objects = args.nr_objects\n if args.scenario == \"verify_write\" and args.nr_objects == 64:\n # Default to 16 for verify_write if not explicitly overridden\n nr_objects = 16| effective_nr = 16 if args.scenario == "verify_write" else nr_objects | ||
| # Allow explicit --nr-objects to win when user set it in verify script | ||
| if args.scenario == "verify_write": | ||
| effective_nr = args.nr_objects |
There was a problem hiding this comment.
With the fix applied to lines 361-364 to correctly set nr_objects = 16 as the default for verify_write, this block can be simplified to directly assign effective_nr = nr_objects, removing the redundant and buggy conditional overwrite.
| effective_nr = 16 if args.scenario == "verify_write" else nr_objects | |
| # Allow explicit --nr-objects to win when user set it in verify script | |
| if args.scenario == "verify_write": | |
| effective_nr = args.nr_objects | |
| effective_nr = nr_objects |
Use PATH python for venv creation and apply a clear default of 16 objects for verify_write when --nr-objects is left at the global default. Co-authored-by: Cursor <cursoragent@cursor.com>
This PR adds CachePilot, a non-invasive KVCache benchmark and evaluation suite for Mooncake.
CachePilot provides:
store_kv_bench.py;verify_writeandread_perfbenchmark support;The benchmark does not modify Mooncake core components and is placed under
benchmarks/cachepilot.Basic usage