The invention discloses an error-controllable
hybrid precision operator automatic optimization method, which comprises the following steps of: first optimization: under given input, optimizing a
general matrix multiplication function through an ID (Identity)
conversion method, and recording an operation sequence and a corresponding dimension of the
general matrix multiplication function; second optimization: according to an optimized
general matrix multiplication GEMM function ID
list and a general
matrix multiplication function sequence
list, transmitting the input of each non-optimized general
matrix multiplication calling function to a preset fast
matrix multiplication function of different parameter combinations, and carrying out performance timing and error calculation; and third optimization: analyzing the obtained data, converting a single-precision matrix multiplication
algorithm into a mixed-precision matrix
multiplication operator, and outputting an optimized code. By using the method, the
hybrid precision GEMM operator can help to improve the performance in a more complex and wider high-
performance computing program. The method can be widely applied to the field of compilers.