A method, system, device, and medium for multidimensional fusion template computation optimization based on tensor processors.

CN122363756APending Publication Date: 2026-07-10NAT UNIV OF DEFENSE TECH
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202610488218.9
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2026-04-14
Publication Date
2026-07-10

AI Technical Summary

Technical Problem

Existing template computation optimization schemes for tensor processors targeting GPU platforms perform poorly on CPU platforms, suffering from high data layout transformation overhead, frequent off-chip access overhead, and low hardware utilization, thus failing to fully realize the hardware potential of CPU tensor processors.

Method used

By constructing a data fusion builder, a matrix chain multiplication operator fusion builder, and an adaptive spatiotemporal fusion builder, we optimize the computation of multidimensional fusion templates, reduce the overhead of intermediate result data conversion, improve the utilization of matrix multiplication computation units, and achieve efficient parallel computation and cache utilization.

Benefits of technology

It significantly improves the computational performance of template computation on the tensor processor platform, with a performance improvement of up to 13.11 times, compared to a maximum improvement of 3.11 times compared to AVX-512 vectorization.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN122363756A_ABST
    Figure CN122363756A_ABST
Patent Text Reader

Abstract

This invention provides a method, system, device, and medium for optimizing multidimensional fusion template computation based on a tensor processor. The method includes constructing a data fusion unit; constructing a matrix chain multiplication operator fusion unit; and constructing an adaptive spatiotemporal fusion unit. Through the synergistic action of the data fusion unit, the matrix chain multiplication operator fusion unit, and the adaptive spatiotemporal fusion unit, multidimensional fusion template computation is optimized. The tensor processor-based optimization method for multidimensional fusion template computation fully leverages the potential of tensor processors in template computation by designing a computational reordering data fusion unit that reduces intermediate result data transformation overhead, a matrix chain multiplication operator fusion unit that reduces memory access, and an adaptive spatiotemporal fusion unit that improves the utilization rate of matrix multiplication computation units. This achieves efficient parallel computation and cache utilization, thereby significantly improving the computational performance of template computation on the tensor processor platform. The system has the same beneficial effects.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the fields of computer architecture and high-performance computing technology, and in particular to a multidimensional fusion template computing optimization method, system, device and medium based on tensor processors. Background Technology

[0002] With the development of CPU architecture, modern processors have integrated dedicated tensor processors (such as Intel AMX) for accelerating intensive matrix operations. However, there is no consensus on template computation optimization for CPU-based tensor processors (Intel AMX). Directly mapping existing template computation optimization schemes for GPU-based tensor processors to CPU-based tensor processors results in poor performance, with the following problems: (1) Data layout conversion overhead is large; (2) Frequent off-screen access overhead; (3) Low hardware utilization.

[0003] Therefore, directly applying existing template computing optimization schemes for GPU-based tensor processors to the CPU tensor processor platform often fails to unleash its hardware potential and may even result in performance inferior to traditional SIMD (such as AVX-512) schemes.

[0004] Therefore, how to solve the problems of excessive data conversion overhead, repeated writing of intermediate results back to memory, and serious underutilization of hardware in template computation on tensor processors are technical problems that urgently need to be solved by those skilled in the art. Summary of the Invention

[0005] To address the aforementioned issues, this invention provides a method, system, device, and medium for optimizing multidimensional fusion template computation based on a tensor processor. By designing a computational reordering data fusion unit that reduces intermediate result data conversion overhead, a matrix chain multiplication operator fusion unit that reduces memory access, and an adaptive spatiotemporal fusion unit that improves the utilization rate of matrix multiplication computation units, the potential of tensor processors in template computation is fully utilized to achieve efficient parallel computation and cache utilization, thereby significantly improving the computational performance of template computation on the tensor processor platform.

[0006] The first objective of this invention is to provide a multidimensional fusion template computation optimization method based on tensor processors; The technical solution provided by this invention is as follows: A multidimensional fusion template computation optimization method based on tensor processors includes the following steps: Build a data fusion engine; Construct a matrix chain multiplication operator fusion unit; Construct an adaptive spatiotemporal fusion engine; The data fusion unit, the matrix chain multiplication operator fusion unit, and the adaptive spatiotemporal fusion unit work together to optimize the computation of multidimensional fusion templates.

[0007] Preferably, the construction of the data fusion device specifically includes: A data fusion engine is built using data reordering, data layout transformation, and precision compression fusion algorithms.

[0008] Preferably, the execution process of the data fusion unit is as follows: The original template computation is reordered to reconstruct the computation flow; The computation flow is fused into a single kernel by vector-level instruction fusion, which integrates layout transformation and precision compression operations.

[0009] Preferably, the construction of the matrix chain multiplication operator fusion device specifically includes: Construct a matrix chain multiplication operator fusion device using matrix chain multiplication.

[0010] Preferably, the execution process of the matrix chain multiplication operator fusion unit specifically includes: For each rank-1 component obtained from the original template kernel decomposition, perform the corresponding matrix chain multiplication operation; The intermediate output results of multiple computation streams are accumulated and fused on-chip to obtain the final computation result.

[0011] Preferably, the construction of the adaptive spatiotemporal fusion device specifically includes: An adaptive spatiotemporal fusion engine is constructed using a weight matrix.

[0012] Preferably, the execution process of the adaptive spatiotemporal fusion machine specifically includes: Continuous a time step, radius of The original template kernels are spatially expanded and merged to construct an equivalent kernel with a radius of [missing information]. The target large template kernel; The target large template kernel is decomposed into the following based on the low-rank decomposition algorithm: One rank-1 matrix component; Based on each of the rank-1 matrix components, The rank-1 matrix components are decomposed into column vectors. and row vector The outer product of the outer product, and the column vector according to the tile register size constraint. and the row vector Repeat at different row and column offset positions to construct the corresponding For the weight matrix.

[0013] The second objective of this invention is to provide a multidimensional fusion template computation optimization system based on a tensor processor; The technical solution provided by this invention is as follows: A multidimensional fusion template computation optimization system based on tensor processors includes: a first building module, a second building module, a third building module, and a synergistic module; The first building module is used to build the data fusion unit; The second building module is used to build a matrix chain multiplication operator fusion unit; The third building module is used to build an adaptive spatiotemporal fusion device; The synergistic module is used to optimize the calculation of multidimensional fusion templates by working together through the data fusion unit, the matrix chain multiplication operator fusion unit, and the adaptive spatiotemporal fusion unit.

[0014] The third objective of this invention is to provide an electronic device; The technical solution provided by this invention is as follows: An electronic device, comprising: At least one processor; and A memory communicatively connected to the at least one processor, the memory storing a computer program executable by the at least one processor, the computer program being executed by the at least one processor to enable the at least one processor to perform any of the method steps of a tensor processor-based multidimensional fusion template computation optimization method.

[0015] A fourth objective of this invention is to provide a computer-readable storage medium; The technical solution provided by this invention is as follows: A computer-readable storage medium for storing a computer program for causing a computer to perform the steps of any one of the methods in a tensor processor-based multidimensional fusion template computation optimization method.

[0016] Compared with existing technologies, the multidimensional fusion template computation optimization method based on tensor processors provided by this invention includes constructing a data fusion unit; constructing a matrix chain multiplication operator fusion unit; and constructing an adaptive spatiotemporal fusion unit. Through the synergistic effect of the data fusion unit, the matrix chain multiplication operator fusion unit, and the adaptive spatiotemporal fusion unit, multidimensional fusion template computation is optimized. This multidimensional fusion template computation optimization method based on tensor processors fully leverages the potential of tensor processors in template computation by designing a computational reordering data fusion unit that reduces intermediate result data transformation overhead, a matrix chain multiplication operator fusion unit that reduces memory access, and an adaptive spatiotemporal fusion unit that improves the utilization rate of matrix multiplication computation units. This achieves efficient parallel computation and cache utilization, thereby significantly improving the computational performance of template computation on the tensor processor platform.

[0017] The present invention also provides a multidimensional fusion template computation optimization system based on tensor processors. Since this system and the multidimensional fusion template computation optimization method based on tensor processors solve the same technical problem and belong to the same technical concept, they should have the same beneficial effects, and will not be described in detail here. Attached Figure Description

[0018] To more clearly illustrate the technical solutions in the embodiments of this application or the prior art, the drawings used in the description of the embodiments or the prior art will be briefly introduced below. Obviously, the drawings described below are only some embodiments of this application. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.

[0019] Figure 1 A flowchart illustrating a multidimensional fusion template computation optimization method based on a tensor processor, as provided in one embodiment; Figure 2 An execution diagram of computation flow reconstruction provided for one embodiment; Figure 3 A schematic diagram illustrating the execution of a data layout transformation and precision compression fusion algorithm provided in one embodiment; Figure 4 A schematic diagram illustrating the memory access mode of the oneDNN operator library provided in one embodiment; Figure 5 A schematic diagram of the memory access mode of a matrix chain multiplication operator fusion unit provided in one embodiment; Figure 6 A schematic diagram of an adaptive spatiotemporal fusion mechanism provided in one embodiment; Figure 7 A structural diagram of a multidimensional fusion template computation optimization system based on a tensor processor provided in one embodiment. Figure 8This is a schematic diagram of the structure of an electronic device provided in one embodiment. Detailed Implementation

[0020] To enable those skilled in the art to better understand the technical solutions in this application, the technical solutions in the embodiments of this application will be clearly and completely described below. Obviously, the described embodiments are only a part of the embodiments of this application, and not all of the embodiments. Based on the embodiments in this application, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of this application.

[0021] like Figure 1 As shown in the figure, an embodiment of the present invention provides a multidimensional fusion template computation optimization method based on a tensor processor, comprising the following steps: S1. Construct a data fusion engine; S2. Construct a matrix chain multiplication operator fusion unit; S3. Construct an adaptive spatiotemporal fusion engine; S4. The multidimensional fusion template calculation is optimized by the coordinated action of the data fusion unit, the matrix chain multiplication operator fusion unit, and the adaptive spatiotemporal fusion unit.

[0022] In practical applications, to address the issues of excessive data conversion overhead, repeated writing of intermediate results back to memory, and severe underutilization of hardware in template computation on tensor processors, and to achieve synergistic optimization of computational density and memory access efficiency in template computation, a data fusion unit, a matrix chain multiplication operator fusion unit, and an adaptive spatiotemporal fusion unit were constructed. Through the synergistic effect of the three components—a computational reordering data fusion unit that reduces intermediate result data conversion overhead, a matrix chain multiplication operator fusion unit that reduces memory access, and an adaptive spatiotemporal fusion unit that improves the utilization of matrix multiplication computation units—spatiotemporal fusion increases computational density, data fusion reduces preprocessing overhead, and operator fusion eliminates off-chip memory access, the computational flow is deeply matched with the hardware architecture. This fully leverages the potential of tensor processors in template computation, achieving efficient parallel computing and cache utilization. The performance improvement of template computation on AMX compared to the basic implementation on AMX reaches up to 13.11 times, and compared to the vectorized implementation of AVX-512, it reaches up to 3.11 times, thus significantly improving the computational performance of template computation on the tensor processor platform.

[0023] In this embodiment, the Tensor Processor (AMX) supports SIMD operations for matrix multiplication of 8-bit integer (INT8) and 16-bit floating-point (BF16) data types. The Tensor Processor (AMX) consists of two parts: (1) a set of two-dimensional registers (tiles) for storing submatrices of larger matrices in memory; and (2) an accelerator called Tile Matrix Multiply (TMUL) which contains instructions for operating on tiles.

[0024] The Intel AMX (Advanced Matrix Extensions) architecture provides eight two-dimensional tile registers for accelerating matrix operations. These registers are named TMM0 through TMM7. Each register is 16 rows by 64 bytes in size. An AMX unit can complete a matrix operation in 16 clock cycles. The calculation.

[0025] Stencil computation: Stencil is a fundamental computational pattern in scientific computing and artificial intelligence, typically performing the same computation process on all points in a regular grid. At each time step, the updated value of each point in the grid is calculated from its own and its neighboring points' old values ​​using a fixed, identical template function.

[0026] Preferably, the construction of the data fusion device specifically includes: A data fusion engine is built using data reordering, data layout transformation, and precision compression fusion algorithms.

[0027] In practical applications, the computation flow is reconstructed by reordering data, reducing the number of independent data layout transformations in a single matrix chain multiplication. Combined with data layout transformation and precision compression fusion algorithms, the overhead of intermediate result transformation is reduced, thus constructing a data fusion device based on computation reordering.

[0028] Preferably, the execution process of the data fusion unit is as follows: A1. Reorder the data from the original template computation to reconstruct the computation flow; A2. Based on the computation flow, layout transformation and precision compression operations are fused into a single kernel through vector-level instruction fusion.

[0029] In step A1, the original template calculation is converted to A shape like The sum of matrix chain multiplications (computational flow). The input matrix is ​​divided into 32×32 blocks, and each block is loaded into one of the two tile registers. and This is the weight matrix obtained by transforming the template kernel, with a size of 16×32.

[0030] like Figure 2 As shown, the tensor processor requires the B matrix to be stored in a special block-interleaved format when performing matrix multiplication. Furthermore, the tensor processor requires input with bf16 precision, but its output is fp32 precision. Therefore, the result of matrix multiplication cannot be directly used as input for the next matrix multiplication; intermediate results from the chained matrix multiplications need to be processed. The computational flow is reconstructed by altering the original computational order. Reconstructed The original 32×32 block The two layout transformations and one precision transformation of the intermediate results are converted into a single layout transformation and precision compression fusion operation of the intermediate results. In this embodiment, the calculation order is adjusted (by changing the calculation order). Change to ),make The output automatically meets the block interleaving layout requirements of the tile register, realizing a data layout conversion and precision compression fusion algorithm based on AVX-512 instructions, reducing preprocessing overhead to less than 40% of the total execution time.

[0031] In step A2, layout transformation and precision compression operations are merged into a single kernel through vector-level instruction fusion, such as... Figure 3 As shown, the interleaving mode conversion of 32 fp32 data points is completed in a single step using the dual-source permutation instruction _mm512_permutex2var_ps, based on a predefined index vector (e.g., ...). Figure 3 As shown in lines 4 and 5 of the diagram. The `_mm512_cvtne2ps_pbh` instruction is used to compress two 512-bit fp32 vectors (a total of 32 fp32 precision floating-point numbers) into a single 512-bit vector containing 32 bf16 values ​​(e.g., ...). Figure 3 As shown in line 6 of section 16), this vector is then loaded into an AMX cell as the data input for matrix B (as shown in line 6 of section 16). Figure 3 (as shown in line 7 of the text).

[0032] Preferably, the construction of the matrix chain multiplication operator fusion device specifically includes: Construct a matrix chain multiplication operator fusion device using matrix chain multiplication.

[0033] In practical applications, multiple matrix chain multiplication operations that were originally executed separately and relied on main memory communication are reconstructed into an on-chip fused execution process that integrates "computation-accumulation" within tile registers. This forms a matrix chain multiplication operator fusion unit based on tile registers, achieving zero write-back of intermediate results and high reuse of input data. In this embodiment, the calculation results of matrix multiplication operations corresponding to multiple rank-1 components reside entirely within the tile registers and are directly accumulated, avoiding writing intermediate results back to main memory and improving data reuse rate.

[0034] Preferably, the execution process of the matrix chain multiplication operator fusion unit specifically includes: B1. Perform the corresponding matrix chain multiplication operation on each rank-1 component obtained from the original template kernel decomposition; B2. On-chip accumulation and fusion of the intermediate output results of multiple computation streams to obtain the final computation result.

[0035] In step B1, the 32×32 block is divided. Loaded into registers and reused in multiple matrix chain multiplications, the original template computation is decomposed into multiple forms such as The accumulated value of matrix chain multiplication; In step B2, after completing the matrix chain multiplication operation corresponding to each rank-1 component, the result is output. Unlike the oneDNN operator library, which writes back to main memory, this method directly stores the result in the tile register and performs an immediate reduction with the preceding result. The final update result for this block is then written back to main memory.

[0036] The API provided by oneDNN is main memory-to-main memory, and its memory access mode is as follows: Figure 4 As shown, when using oneDNN for memory access in matrix chain multiplication, the input is a 32×32 block. It requires repeated loading, and the result of each matrix chain multiplication operation... The data must first be written back to main memory and then reloaded for the next matrix chain multiplication calculation. After the matrix multiplication operators are fused, the memory access pattern in this step is as follows: Figure 5 As shown, in the AMXStencil matrix chain multiplication operator fusion mechanism, the input is divided into 32×32 blocks. It only needs to be loaded once, and the calculation results of the matrix chain multiplication corresponding to each rank-1 component are directly accumulated in the register in real time, without the need to write intermediate results back to main memory.

[0037] Preferably, the construction of the adaptive spatiotemporal fusion device specifically includes: An adaptive spatiotemporal fusion engine is constructed using a weight matrix.

[0038] In practical applications, the adaptive spatiotemporal fusion unit dynamically expands the time dimension of template calculation (fusion of continuous time steps) to reconstruct a small-sized weight matrix into a large matrix that matches the capacity of the AMX tile register, thereby improving hardware utilization. In this embodiment, by dynamically calculating the fusion factor, the weight matrices of multiple consecutive time steps are expanded and merged into a large matrix according to the spatial dimension (e.g., a 7×7 template is fused into a 13×13), so that the weight matrix size more fully fills the capacity of the matching tile register, and the hardware utilization rate is increased from 21.8% to 40.6%.

[0039] Preferably, the execution process of the adaptive spatiotemporal fusion machine specifically includes: C1. Continuous The time step has a radius of The original template kernels are spatially expanded and merged to construct an equivalent kernel with a radius of... The target large template kernel; C2. Decompose the target large template kernel into its components according to the low-rank decomposition algorithm. One rank-1 matrix component; C3, based on each of the rank-1 matrix components, The rank-1 matrix components are decomposed into column vectors. and row vector The outer product of the outer product, and the column vector according to the tile register size constraint. and the row vector Repeat at different row and column offset positions to construct the corresponding For the weight matrix.

[0040] In step C1, the continuous The template kernels at each time step are spatially expanded and merged into a single kernel of size [size missing]. The corresponding large template kernel.

[0041] In steps C2 to C3, firstly, the low-rank decomposition technique is used to decompose the element with size... The large template kernel is decomposed into ( Each rank-1 matrix has 100 rank-1 components. Each rank-1 matrix is ​​then decomposed into the outer product of column and row vectors. Based on the size of the tile register, the column and row vectors are repeated at different row and column offsets, mapping the vectors to the corresponding positions in the weight matrix to construct... For the weight matrix. Combined with... Figure 6 As shown, this invention illustrates an adaptive spatiotemporal fusion mechanism. Figure 6 The 7×7 matrix at the top left represents the original template weight kernel of the Box-2D49P operator; after performing two-time-step spatiotemporal fusion, the original weight kernel is equivalently expanded into a fusion template weight kernel of size 13×13. Figure 6The right side further illustrates the morphological transformation of the template weights into the weight matrix required by the tensor processor before and after spatiotemporal fusion. This transformation comparison shows that, compared to sparse mapping at a single time step, the weight matrix constructed using this 13×13 fusion template kernel has a higher data density, effectively reducing the proportion of invalid padding within the weight matrix. This feature allows the transformed weight matrix to be mapped more compactly into the matrix multiplication and addition units of the underlying hardware, thereby significantly improving the hardware utilization efficiency and computational throughput of the core computing unit.

[0042] like Figure 7 As shown in the figure, an embodiment of the present invention provides a multidimensional fusion template computation optimization system based on a tensor processor, comprising: a first construction module, a second construction module, a third construction module, and a synergistic module; The first building module is used to build the data fusion unit; The second building module is used to build a matrix chain multiplication operator fusion unit; The third building module is used to build an adaptive spatiotemporal fusion device; The synergistic module is used to optimize the calculation of multidimensional fusion templates by working together through the data fusion unit, the matrix chain multiplication operator fusion unit, and the adaptive spatiotemporal fusion unit.

[0043] In practical applications, the multidimensional fusion template computation optimization system based on tensor processors is configured with a first building module, a second building module, a third building module, and a collaborative module. The first, second, and third building modules are connected to the collaborative module. The first building module constructs a data fusion unit and then transmits it to the collaborative module. The second building module constructs a matrix chain multiplication operator fusion unit and then transmits it to the collaborative module. The third building module constructs an adaptive spatiotemporal fusion unit and then transmits it to the collaborative module. The collaborative module then optimizes multidimensional fusion template computation through the collaborative action of the data fusion unit, the matrix chain multiplication operator fusion unit, and the adaptive spatiotemporal fusion unit. This system fully leverages the potential of tensor processors in template computation by designing a computational reordering data fusion unit that reduces intermediate result data conversion overhead, a matrix chain multiplication operator fusion unit that reduces memory access, and an adaptive spatiotemporal fusion unit that improves the utilization rate of matrix multiplication computation units. This achieves efficient parallel computation and cache utilization, thereby significantly improving the computational performance of template computation on the tensor processor platform.

[0044] Furthermore, embodiments of this application also disclose an electronic device, Figure 8 This is a structural diagram of an electronic device according to an exemplary embodiment. The content of the diagram should not be construed as limiting the scope of this application.

[0045] Figure 8 This is a schematic diagram of an electronic device provided in an embodiment of this application. The electronic device 20 may specifically include: at least one processor 21, at least one memory 22, a power supply 23, a communication interface 24, an input / output interface 25, and a communication bus 26. The memory 22 stores a computer program, which is loaded and executed by the processor 21 to implement the relevant steps in the tensor processor-based multidimensional fusion template computation optimization method disclosed in any of the foregoing embodiments. Alternatively, the electronic device 20 in this embodiment may specifically be an electronic computer.

[0046] In this embodiment, the power supply 23 is used to provide operating voltage for each hardware device on the electronic device 20; the communication interface 24 can create a multi-dimensional fusion template calculation optimization channel based on tensor processor between the electronic device 20 and external devices, and the communication protocol it follows can be any communication protocol applicable to the technical solution of this application, and is not specifically limited here; the input / output interface 25 is used to acquire external input data or output data to the outside world, and its specific interface type can be selected according to specific application needs, and is not specifically limited here.

[0047] In addition, the memory 22, as a carrier for resource storage, can be a read-only memory, random access memory, disk or optical disk, etc. The resources stored thereon can include operating system 221, computer program 222 and data 223, etc., and the storage method can be temporary storage or permanent storage.

[0048] The operating system 221 manages and controls the various hardware devices on the electronic device 20 and the computer program 222 to enable the processor 21 to perform calculations and processing on the data 223 in the memory 22. It can be Windows Server, Netware, Unix, Linux, etc. The computer program 222, in addition to including a computer program capable of performing the tensor processor-based multidimensional fusion template computation optimization method executed by the electronic device 20 as disclosed in any of the foregoing embodiments, may further include computer programs capable of performing other specific tasks. The data 223 may include data received by the tensor processor-based multidimensional fusion template computation optimization device from external devices, as well as data collected by its own input / output interface 25.

[0049] The steps of the methods or algorithms described in conjunction with the embodiments disclosed herein can be implemented directly by hardware, a software module executed by a processor, or a combination of both. The software module can be located in random access memory (RAM), main memory, read-only memory (ROM), electrically programmable ROM, electrically erasable programmable ROM, registers, hard disk, removable disk, CD-ROM, or any other form of storage medium known in the art.

[0050] Furthermore, this application also discloses a computer-readable storage medium for storing a computer program; wherein, when the computer program is executed by a processor, it implements the aforementioned disclosed multidimensional fusion template computation optimization method based on a tensor processor. Specific steps of this method can be found in the corresponding content disclosed in the foregoing embodiments, and will not be repeated here.

[0051] It should be understood that the use of terms such as "method," "apparatus," "unit," and / or "module" in this application is merely to distinguish one method of different components, elements, parts, sections, or assemblies at different levels. However, if other terms can achieve the same purpose, they may be replaced by other expressions.

[0052] As indicated in this application and claims, unless the context clearly indicates otherwise, the words "a," "an," "a," and / or "the" are not specifically singular and may include the plural. Generally, the terms "comprising" and "including" only indicate the inclusion of expressly identified steps and elements, which do not constitute an exclusive list, and the method or apparatus may also include other steps or elements. An element defined by the phrase "comprising an..." does not exclude the presence of other identical elements in the process, method, product, or apparatus that includes the element.

[0053] Hereinafter, the terms "first" and "second" are used for descriptive purposes only and should not be construed as indicating or implying relative importance or implicitly specifying the number of technical features indicated. Thus, a feature defined as "first" or "second" may explicitly or implicitly include one or more of that feature.

[0054] If a flowchart is used in this application, it is used to illustrate the operations performed by the system according to embodiments of this application. It should be understood that the preceding or following operations are not necessarily performed precisely in sequence. Instead, the steps can be processed in reverse order or simultaneously. Furthermore, other operations can be added to these processes, or one or more steps can be removed from them.

[0055] The above description of the disclosed embodiments enables those skilled in the art to make or use this application. Various modifications to these embodiments will be readily apparent to those skilled in the art, and the general principles defined herein may be implemented in other embodiments without departing from the spirit or scope of this application. Therefore, this application is not to be limited to the embodiments shown herein, but is to be accorded the widest scope consistent with the principles and novel features disclosed herein.

Claims

1. A multidimensional fusion template computation optimization method based on tensor processors, characterized in that, Includes the following steps: Build a data fusion engine; Construct a matrix chain multiplication operator fusion unit; Construct an adaptive spatiotemporal fusion engine; The data fusion unit, the matrix chain multiplication operator fusion unit, and the adaptive spatiotemporal fusion unit work together to optimize the computation of multidimensional fusion templates.

2. The multidimensional fusion template computation optimization method based on tensor processor according to claim 1, characterized in that, The construction of the data fusion device specifically includes: A data fusion engine is built using data reordering, data layout transformation, and precision compression fusion algorithms.

3. The multidimensional fusion template computation optimization method based on tensor processor according to claim 2, characterized in that, The execution process of the data fusion unit is as follows: The original template computation is reordered to reconstruct the computation flow; The computation flow is fused into a single kernel by vector-level instruction fusion, which integrates layout transformation and precision compression operations.

4. The multidimensional fusion template computation optimization method based on tensor processor according to claim 1, characterized in that, The construction of the matrix chain multiplication operator fusion device specifically includes: Construct a matrix chain multiplication operator fusion device using matrix chain multiplication.

5. The multidimensional fusion template computation optimization method based on tensor processor according to claim 3, characterized in that, The execution process of the matrix chain multiplication operator fusion unit specifically includes: For each rank-1 component obtained from the original template kernel decomposition, perform the corresponding matrix chain multiplication operation; The intermediate output results of multiple computation streams are accumulated and fused on-chip to obtain the final computation result.

6. The multidimensional fusion template computation optimization method based on tensor processor according to claim 1, characterized in that, The construction of the adaptive spatiotemporal fusion device specifically includes: An adaptive spatiotemporal fusion engine is constructed using a weight matrix.

7. The multidimensional fusion template computation optimization method based on tensor processor according to claim 6, characterized in that, The execution process of the adaptive spatiotemporal fusion machine specifically includes: Continuous The time step has a radius of The original template kernels are spatially expanded and merged to construct an equivalent kernel with a radius of... The target large template kernel; The target large template kernel is decomposed into the following based on the low-rank decomposition algorithm: One rank-1 matrix component; Based on each of the rank-1 matrix components, The rank-1 matrix components are decomposed into column vectors. and row vector The outer product of the outer product, and the column vector according to the tile register size constraint. and the row vector Repeat at different row and column offset positions to construct the corresponding For the weight matrix.

8. A multidimensional fusion template computation optimization system based on tensor processors, characterized in that, include: First building block, second building block, third building block, and synergistic module; The first building module is used to build the data fusion unit; The second building module is used to build a matrix chain multiplication operator fusion unit; The third building module is used to build an adaptive spatiotemporal fusion device; The synergistic module is used to optimize the calculation of multidimensional fusion templates by working together through the data fusion unit, the matrix chain multiplication operator fusion unit, and the adaptive spatiotemporal fusion unit.

9. An electronic device, characterized in that, include: At least one processor; as well as A memory communicatively connected to the at least one processor, the memory storing a computer program executable by the at least one processor, the computer program being executed by the at least one processor to enable the at least one processor to perform the method according to any one of claims 1-7.

10. A computer-readable storage medium, characterized in that, The storage medium is used to store a computer program that causes a computer to perform the method described in any one of claims 1-7.