用自然语言分析缓存命中率问题,自动找出原因并给出优化建议。
CacheMind: From Miss Rates to Why -- Natural-Language, Trace-Grounded Reasoning for Cache Replacement
- 基于大模型和检索增强生成,实现对缓存追踪数据的语义理解与问答。
- 在未见问题上达到89.33%准确率,6类任务中4类达100%准确。
- 适合架构师快速诊断性能瓶颈,尤其擅长处理复杂、非结构化查询。
缓存替换仍是CPU微架构中的难题,传统依赖手工规则,限制性能提升。缓存数据分析需手动处理数百万条追踪记录,过程耗时且无法交互。为此,我们提出CacheMind,一个基于检索增强生成(RAG)与大语言模型(LLM)的对话式工具,支持对缓存追踪进行语义推理。架构师可自然语言提问,如“为何程序计数器X的内存访问导致更多淘汰?”并获得与程序语义关联的可读答案。我们构建了首个验证过的基准套件CacheMindBench,用于评估基于LLM的缓存替换推理。使用SIEVE检索器,CacheMind在75个未见追踪问题上达66.67%,25个策略特定任务上达84.80%;使用RANGER则分别达89.33%和64.80%。此外,RANGER在追踪级6类任务中有4类实现100%准确。相较LlamaIndex仅10%召回率,SIEVE达60%,RANGER达90%,表明现有RAG方法难以满足精确的微架构推理需求。通过CacheMind得出四项可操作洞察:绕过场景提升命中率7.66%、加速2.04%,软件修复提升76%,Mockingjay替换策略提升0.7%,验证其对复杂查询的有效性。
原文摘要 · Abstract (English)
Cache replacement remains a challenging problem in CPU microarchitecture, often addressed using hand-crafted heuristics, limiting cache performance. Cache data analysis requires parsing millions of trace entries with manual filtering, making the process slow and non-interactive. To address this, we introduce CacheMind, a conversational tool that uses Retrieval-Augmented Generation (RAG) and Large Language Models (LLMs) to enable semantic reasoning over cache traces. Architects can now ask natural language questions like, "Why is the memory access associated with PC X causing more evictions?", and receive trace-grounded, human-readable answers linked to program semantics for the first time. To evaluate CacheMind, we present CacheMindBench, the first verified benchmark suite for LLM-based reasoning for the cache replacement problem. Using the SIEVE retriever, CacheMind achieves 66.67% on 75 unseen trace-grounded questions and 84.80% on 25 unseen policy-specific reasoning tasks; with RANGER, it achieves 89.33% and 64.80% on the same evaluations. Additionally, with RANGER, CacheMind achieves 100% accuracy on 4 out of 6 categories in the trace-grounded tier of CacheMindBench. Compared to LlamaIndex (10% retrieval success), SIEVE achieves 60% and RANGER achieves 90%, demonstrating that existing Retrieval-Augmented Generation (RAGs) are insufficient for precise, trace-grounded microarchitectural reasoning. We provided four concrete actionable insights derived using CacheMind, wherein bypassing use case improved cache hit rate by 7.66% and speedup by 2.04%, software fix use case gives speedup of 76%, and Mockingjay replacement policy use case gives speedup of 0.7%; showing the utility of CacheMind on non-trivial queries that require a natural-language interface.
Thank you to arXiv for use of its open access interoperability. PaperDance 不是 arXiv 官方产品;中文卡片由大模型生成,请以原文为准。