The invention discloses a
data layout adaptive adjustment method of an
inference model and a related device, and belongs to the technical field of
power equipment operation and maintenance and
edge computing. According to the method, fusible attributes of all operators are obtained from a TVM framework, an original model calculation graph is traversed in a post-order traversal mode, all node operators are recursively processed from output nodes, and an initial default input
data layout is an original
layout DL0. In the traversing process, according to the
data layout of the new input parameters, the operator fusible attribute and the operation type, the continuous
layout is dynamically decided or converted into the target
layout through transposition and deformation operation, and a corresponding node operator is newly established. After traversal is finished, a new model calculation graph is constructed, and if the output node layout is DL1, the output node layout is converted into DL0. According to the method, the automatic adjustment of the data layout is realized, the adaptive program can be reused, the automatic deployment after online updating of the model is supported, the
processing efficiency of the reasoning accelerator is improved, and the problems of complexity and poor
reusability of traditional manual adjustment are solved.