Learned indexes use machine learning models to learn the mappings between keys and their corresponding positions in key-value indexes. These indexes use the mapping information as training data. Learned indexes require frequent retrainings of their models to incorporate the changes introduced by update queries. To efficiently retrain the models, existing learned index systems often harness a linear algebraic QR factorization technique that performs matrix decomposition. This factorization approach processes all key-position pairs during each retraining, resulting in compute operations that grow linearly with the total number of keys and their lengths. Consequently, the retrainings create a severe performance bottleneck, especially for variable-length string keys, while the retrainings are crucial for maintaining high prediction accuracy and in turn, ensuring low query service latency. To address this performance problem, we develop an algorithm-hardware co-designed string-key learned index system, dubbed SIA. In designing SIA, we leverage a unique algorithmic property of the matrix decomposition-based training method. Exploiting the property, we develop a memoization-based incremental training scheme, which only requires computation over updated keys, while decomposition results of non-updated keys from previous computations can be reused. We further enhance SIA to offload a portion of this training process to an FPGA accelerator to not only relieve CPU resources for serving index queries (i.e., inference), but also accelerate the training itself. Our evaluation shows that compared to ALEX, LIPP, and SIndex, a state-of-the-art learned index systems, SIA-accelerated learned indexes offer 2.6x and 3.4x higher throughput on the two real-world benchmark suites, YCSB and Twitter cache trace, respectively.
翻译:学习型索引利用机器学习模型学习键与键值索引中对应位置之间的映射关系,并将这些映射信息作为训练数据。为适应更新查询带来的变化,学习型索引需要频繁对其模型进行重新训练。为高效完成模型重训练,现有学习型索引系统常采用线性代数QR分解技术进行矩阵分解。该分解方法在每次重训练时需处理所有键-位置对,导致计算操作随键总数及其长度线性增长。因此,重训练过程成为严重性能瓶颈——尤其对于变长字符串键而言,而重训练对维持高预测精度并进而保证低查询服务延迟至关重要。为解决该性能问题,我们提出算法-硬件协同设计的字符串键学习型索引系统SIA。在设计SIA时,我们利用基于矩阵分解训练方法的独特算法特性,开发了基于记忆化的增量训练方案:该方案仅需对更新键进行计算,同时可复用先前计算中未更新键的分解结果。我们进一步优化SIA,将部分训练过程卸载至FPGA加速器,不仅释放CPU资源用于服务索引查询(即推理),还加速了训练本身。评估表明,与当前最先进的学习型索引系统ALEX、LIPP和SIndex相比,采用SIA加速的学习型索引在YCSB和Twitter缓存轨迹两套真实基准测试套件上,吞吐量分别提升2.6倍和3.4倍。