• 中国计算机学会会刊
  • 中国科技核心期刊
  • 中文核心期刊

计算机工程与科学

• 高性能计算 • 上一篇    下一篇

一种基于遗传算法的BLAS库优化方法

孙成国1,兰静2,姜浩1   

  1. (1.国防科技大学计算机学院,湖南 长沙 410073;2.重庆工商大学融智学院,重庆 404100)
  • 收稿日期:2017-11-23 修回日期:2018-02-23 出版日期:2018-05-25 发布日期:2018-05-25
  • 基金资助:

    国家863项目(2012AA01A301);国家自然科学基金(61402495,61303189,61602166,61170049,61402496);重庆市教育科学规划课题重点项目(2015-GX-036)

A BLAS library optimization method
based on genetic algorithm

SUN Cheng-guo1,LAN Jing2,JIANG Hao1   

  1. (1.College of Computer,National University of Defense Technology,Changsha 410073;
    2.Rongzhi College,Chongqing Technology and Business University,Chongqing 404100,China)
  • Received:2017-11-23 Revised:2018-02-23 Online:2018-05-25 Published:2018-05-25

摘要:

基于OpenBLAS和BLIS开源线性代数基础算法库,对稠密矩阵乘法GEMM运算的性能优化展开研究。针对如何选取稠密矩阵分块并行算法的关键分块参数这一问题,建立性能优化模型。采用改进的遗传算法求解上述优化模型,将某一分块参数组合(种群个体)所对应的稠密矩阵乘法的性能值作为该个体的适应度,通过不断迭代地进行选择、交叉、变异操作,找到最优的分块参数组合,使得稠密矩阵运算的性能值最优。数值实验表明,基于遗传算法求解得出最优分块参数下的GEMM性能值优于默认分块参数下的性能值,达到了优化的目的。
 

关键词: BLAS, GEMM, 遗传算法, 自动调优

Abstract:

Based on OpenBLAS and BLIS,  the two open source linear algebra libraries, the performance optimization of dense matrix multiplication (GEMM) operation is studied. Aiming at how to select the key block parameters of GEMM, a performance optimization model is established. An improved genetic algorithm is used to solve the above performance optimization model. The performance value of the GEMM corresponding to a certain parameter combination (individual) is taken as the fitness of the individual. The optimal combination of block parameters is found through continuous iterative selection, crossover and mutation operations in order to make the performance of GEMM optimal. Numerical experiments show that the performance of GEMM based on genetic algorithm is better than the performance under the initial block parameters, and hence the optimization is achieved.
 

Key words: BLAS, GEMM, genetic algorithm, autotuning