The invention discloses a GPU (
Graphics Processing Unit) kernel
execution time prediction method, which comprises the following steps of: 1, performing a round of quick
simulation on a GPU kernel, counting the execution frequency of each
basic block, and establishing a global
state vector G; 2, performing periodic accurate
simulation on the GPU kernel, and constructing a local
state vector L; step 3, if the similarity of L and G in a plurality of consecutive rounds of sampling exceeds a set threshold value, determining that the
program behavior of the GPU kernel tends to be stable; 4, training a lightweight
machine learning model, learning a
distribution rule of
basic block execution time along with global state change, and constructing a
dynamic prediction model; and step 5, predicting the
execution time by using the trained model, and accumulating the execution time of all the basic blocks to obtain the total execution time of the GPU kernel. The lightweight
machine learning model is introduced, the method can dynamically adapt to stage change and non-stationary features of
basic block execution time, prediction errors are effectively reduced, and
simulation precision is improved.