An Experience-Guided Acceleration Strategy for Floating-Point Optimization
XIAO An-Xiang,ZHANG Shuo-Xiao,TANG En-Yi,CHEN Xin,WANG Lin-Zhang
DOI: https://doi.org/10.11897/SP.J.1016.2022.02014
2022-01-01
Chinese Journal of Computers
Abstract:To ensure the correctness and efficiency of floating-point programs, automatic optimizing techniques for floating-point programs have been attached attention from academia in recent years. The core idea is to summarize transformation rules from classical numerical analysis theory and rewrite floating-point programs automatically with more stable algorithms, which produces more stable, efficient and maintainable programs. However, efficiency becomes the bottleneck of these techniques. As more and more transformation rules are discovered and summarized, the rule base used by the optimizing framework becomes larger and larger. It is more difficult to scan the whole rule base as usual. In this paper, we propose an experience-guided acceleration strategy for floatingpoint optimization. Based on the principle of similar causes of floating-point errors, the strategy extracts the corresponding symbolic and structural features of successfully optimized floating-point programs, and saves the rule sequences involved in the optimization of the programs into a hash-based optimization experience database. When optimizing a floating-point program, the optimizer first calculates the similarity between symbolic and structural features of the program and that of records in the experience base. Rule sequences associated with records having higher similarity are preferred to be used in rewriting and optimizing the program. With more and more programs to be optimized, the experience base increases gradually and a hashed-partition design ensures the efficiency of record-searching. The above approach has been evaluated on the FPBench benchmark and the open source engine OpenRelativity. The results show that compared to the traditional optimizing approach, it can achieve a 6.04x speedup in average. In addition, it improves accuracy for floating-point programs effectively as well as the traditional optimizing approach does. Therefore, our approach improves the usability of automatic optimizing techniques significantly.