| 本文已被:浏览 1708次 下载 4172次 |
 码上扫一扫! |
|
|
| 面向Stencil计算的自动混合精度优化 |
|
宋广辉1,2, 郭绍忠1,2, 赵捷1,2, 陶小涵1,2, 李飞1,2, 许瑾晨1,2
|
|
1.信息工程大学, 河南 郑州 450001;2.数学工程与先进计算国家重点实验室(信息工程大学), 河南 郑州 450001
|
|
| 摘要: |
| 混合精度在深度学习和精度调整与优化方面取得了许多进展, 广泛研究表明, 面向Stencil计算的混合精度优化也是一个很有挑战性的方向. 同时, 多面体模型在自动并行化领域取得的一系列研究成果表明, 该模型为循环嵌套提供很好的数学抽象, 可以在其基础上进行一系列的循环变换. 基于多面体编译技术设计并实现了一个面向Stencil计算的自动混合精度优化器, 通过在中间表示层进行迭代空间划分、数据流分析和调度树转换, 首次实现了源到源的面向Stencil计算的混合精度优化代码自动生成. 实验表明, 经过自动混合精度优化之后的代码, 在减少精度冗余的基础上能够充分发挥其并行潜力, 提升程序性能. 以高精度计算为基准, 在x86平台上最大加速比是1.76, 几何平均加速比是1.15; 在新一代国产申威平台上最大加速比是1.64, 几何平均加速比是1.20. |
| 关键词: 自动混合精度 Stencil计算 多面体模型 循环嵌套 调度树 |
| DOI:10.13328/j.cnki.jos.006757 |
| 分类号:TP18 |
| 基金项目:国家自然科学基金(U20A20226) |
|
| Automatic Mixed Precision Optimization for Stencil Computation |
|
SONG Guang-Hui1,2, GUO Shao-Zhong1,2, ZHAO Jie1,2, TAO Xiao-Han1,2, LI Fei1,2, XU Jin-Chen1,2
|
|
1.Information Engineering University, Zhengzhou 450001, China;2.State Key Laboratory of Mathematical Engineering and Advanced Computing (Information Engineering University), Zhengzhou 450001, China
|
| Abstract: |
| Mixed precision has made many advances in deep learning and precision tuning and optimization. Extensive research shows that mixed precision optimization for stencil computation is challenging. Moreover, the research achievements secured by the polyhedral model in the field of automatic parallelization indicate that the model provides a good mathematical abstraction for loop nesting, on the basis of which loop transformations can be performed. This study designs and implements an automatic mixed precision optimizer for Stencil computation on the basis of polyhedral compilation technology. By performing iterative domain partitioning, data flow analysis, and scheduling tree transformation on the intermediate representation layers, this study implements the source-to-source automatic generation of mixed precision codes for Stencil computation for the first time. The experiments demonstrate that the code after automatic mixed precision optimization can give full play to its parallelism potential and improve the performance of the program by reducing precision redundancy. With high-precision computing as the benchmark, the maximum speedup is 1.76, and the geometric average speedup is 1.15 on the x86 architecture; on the new-generation Sunway architecture, the maximum speedup is 1.64, and the geometric average speedup is 1.20. |
| Key words: automatic mixed precision Stencil computation polyhedral model loop nesting scheduling tree |