使用进化算法为数组寻找缓存友好的广义 Morton 布局
Using Evolutionary Algorithms to Find Cache-Friendly Generalized Morton Layouts for Arrays
AI总结:
本文提出用遗传算法探索广义Morton数组布局的进化方法,通过缓存模拟评估适应度,在真实硬件上实现最高十倍的性能提升。
摘要:
多维数据的布局对硬件缓存的效能有着显著影响,进而影响应用程序的性能。常见的多维布局包括规范的行主序和列主序布局,以及 Morton 曲线布局。本文描述了如何将 Morton 布局推广到一个非常庞大的多维数据布局家族,这些布局具有广泛不同的性能特征。我们假设,基于遗传算法的组合进化方法可以高效地探索这一设计空间。为此,我们提出了此类布局的染色体表示,以及使用缓存模拟来估计数组布局适应度的方法。我们证明了我们的适应度函数与真实硬件上的内核运行时间相关,并且我们的进化策略能够在所考虑的八个真实世界应用程序中的四个中,在少数几代内找到具有良好模拟缓存属性的候选布局。最后,我们证明了使用我们的进化方法找到的数组布局不仅在模拟环境中表现良好,而且在真实硬件上能够带来显著的性能提升——在极端情况下可达十倍。
英文摘要:
The layout of multi-dimensional data can have a significant impact on the efficacy of hardware caches and, by extension, the performance of applications. Common multi-dimensional layouts include the canonical row-major and column-major layouts as well as the Morton curve layout. In this paper, we describe how the Morton layout can be generalized to a very large family of multi-dimensional data layouts with widely varying performance characteristics. We posit that this design space can be efficiently explored using a combinatorial evolutionary methodology based on genetic algorithms. To this end, we propose a chromosomal representation for such layouts as well as a methodology for estimating the fitness of array layouts using cache simulation. We show that our fitness function correlates to kernel running time in real hardware, and that our evolutionary strategy allows us to find candidates with favorable simulated cache properties in four out of the eight real-world applications under consideration in a small number of generations. Finally, we demonstrate that the array layouts found using our evolutionary method perform well not only in simulated environments but that they can effect significant performance gains -- up to a factor ten in extreme cases -- in real hardware.
机构、总结、中文摘要均由AI分析而来,可能存在错误,请以论文正文为准。