The embodiment of the invention provides a
tensor instruction optimization method,
tensor instruction optimization equipment and a storage medium, and relates to the technical field of
artificial intelligence chips, the method comprises the following steps: sequentially traversing N
tensor instructions in a target
basic block, and if a target instruction on which the current traversed tensor instruction depends exists and L intermediate instructions exist between the tensor instruction and the target instruction, determining that the tensor instruction depends on the target instruction; if yes, obtaining the total extra
time based on the respective extra
execution time of the L intermediate instructions; if the total out-of-total time is greater than the unit
execution time of the currently traversed tensor instruction, it is indicated that when the
assembly line executes the currently traversed tensor instruction, a target instruction on which the currently traversed tensor instruction depends is inevitably executed, so that a dependency descriptor of the currently traversed tensor instruction is set as a first descriptor to represent a dependency-free relationship; therefore, the
assembly line can directly execute the tensor instruction without waiting, so that the probability that the
assembly line is blocked is reduced, idle running of hardware resources in the
assembly line is reduced, and the
utilization rate of the hardware resources is improved.