Two-point Crossover Operator in Genetic Algorithm for Deep Learning Compiler
Tianyi Zhou, Wei Hua Fang · 2023
The wide usage of tensor computation in deep neural networks (DNNs) has boosted the high demand for high-performance and flexible library implementation on different hardware platforms, which is time-cost and inefficient. Deep learning compilers (DLCs) are therefore proposed, such as Ansor, to search the optimization computation combinations automatically. Ansor can generate high-performance tensor programs by employing Genetic Algorithm (GA) in its auto-tuning process. However, the structure information of an individual is easily destroyed by the uniform crossover operator, which leads to low search efficiency. In this paper, we propose a two-point crossover operator applied in Ansor called Ansor-TPC, which can optimize tensor computation with higher efficiency. The tensor expression can be computed with random schedules regarded as individuals. When performing the crossover operator, Ansor-TPC exchanges parent genes at two points instead of every point, which can preserve the structure information of programs and find the optimal schedule combination in the large search space. A high-performance program is generated for targeted hardware based on the optimized schedule configuration. Ansor-TPC is compared with the benchmarks at different levels. In terms of average performance, Ansor-TPC achieves 1.07--23.2× performance speedup. In terms of the best performance, Ansor-TPC outperforms by up to 1.06--23.0×.