面向内存向量近似最近邻搜索的CCD级别和负载感知线程协调
CCD-Level and Load-Aware Thread Orchestration for In-Memory Vector ANNS on Multi-Core CPUs
AI总结:
本文提出一种基于CCD架构的线程协调框架,通过优化任务调度和负载平衡,提升多核CPU在内存向量搜索中的吞吐量和响应速度。
摘要:
向量近似最近邻搜索(ANNS)是搜索引擎、推荐系统和广告服务的基础。最近的ANNS索引进展使CPU成为处理百万级内存向量搜索的经济选择,但每个核心的吞吐量仍受限于向量读取的内存访问延迟和生产部署中距离评估的计算强度。随着业务规模的增长和硬件的进步,现代基于CCD的多核CPU已被广泛用于我们的服务中。然而,我们发现单纯增加核心数量并不能获得最佳性能扩展。为提高基于CCD架构的更多核心效率,我们分析了生产环境中真实请求的分布。我们发现在线服务中向量搜索具有高访问局部性,但缓存利用率低,这是由于忽视了基于CCD的CPU的多芯片片性质。因此,我们提出了一种工作负载和硬件感知的线程协调框架,该框架(i)为跨查询并行HNSW搜索和内查询并行IVF搜索提供统一接口;(ii)实现缓存友好的任务调度映射;(iii)采用CCD感知的任务偷取来解决负载不平衡问题。应用于来自小红书(RedNote)搜索、推荐和广告服务的真实生产负载,我们的方法在吞吐量上达到最高3.7倍,P50和P999延迟减少30-90%。具体而言,与原始框架相比,缓存缺失率降低6-30%,总CPU停顿时间减少20-80%。
英文摘要:
Vector approximate nearest neighbor search (ANNS) underpins search engines, recommendation systems, and advertising services. Recent advances in ANNS indexes make CPU a cost-effective choice for serving million-scale, in-memory vector search, yet per-core throughput remains constrained by memory access latency of vector reading and the compute intensity of distance evaluations in production deployments. With the growing scale of the business and advances in hardware, modern CCD-based multi-core CPUs have been widely deployed for high throughput in our services. However, we find that simply increasing core counts does not yield optimal performance scaling. To improve the efficiency of more cores from the CCD-based architecture, we analyze the distributions of real-world requests in our production environments. We observe high access locality in vector search in our online services and low cache utilization, resulting from overlooking the multi-chiplet nature of CCD based CPUs. Hence, we propose a workload- and hardware-aware thread orchestration framework at CCD-level that (i) provides a uniform interface for both inter-query parallel HNSW search and intra-query parallel IVF search, (ii) achieves cache-friendly and workload-adaptive mapping of task dispatching, and (iii) employs CCD-aware task stealing to address load imbalance. Applied to real production workloads from search, recommendation, and advertising services of Xiaohongshu (RedNote), our approach delivers up to 3.7x higher throughput and 30-90% reductions in P50 and P999 latency. In detail, compared with the original framework, the cache-miss ratio decreases by 6-30%, and the total CPU stall is reduced by 20-80%.
机构、总结、中文摘要均由AI分析而来,可能存在错误,请以论文正文为准。