Parallel computing method based on tensor Tucker decomposition result and related equipment

By adopting a parallel computing method based on the results of tensor Tucker decomposition in an edge computing environment, the dimensional disaster problem of Tucker decomposition in a environment with limited computing resources and the problem of excessive time-consuming traditional serial computing is solved, and efficient tensor operations and fast response are achieved.

CN119598084AActive Publication Date: 2025-03-11HAINAN UNIV
View PDF 4 Cites 0 Cited by

Patent Information

Application Number
CN202411612043.5
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-11-12
Publication Date
2025-03-11
Estimated Expiration
2044-11-12

AI Technical Summary

Technical Problem

In an environment with limited computing resources, especially in edge computing scenarios, Tucker decomposition faces dimensional disaster problems. At the same time, the amount of data in the big data era is huge, and traditional serial computing methods take too long to meet the time response needs.

Method used

A parallel calculation method based on the tensor Tucker decomposition results is proposed. By performing tensor Tucker decomposition on the built target tensor data, the core tensor and factor matrix are obtained, and the parallel calculation mode is determined according to the operation rules. The parallel calculation mode between kernels and parallel calculation mode within kernels is used for calculation, which greatly improves the calculation efficiency.

Benefits of technology

This method can directly perform tensor operations on the Tucker decomposition results, keep the calculation results in the Tucker decomposition form, avoid the need to reconstruct the original tensor, significantly improve the calculation efficiency of the Tucker decomposition results, and meet the needs of big data analysis in time response.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119598084A_ABST
    Figure CN119598084A_ABST
Patent Text Reader

Abstract

According to the tensor Tucker decomposition result-based parallel computing method and related equipment provided by the embodiment of the invention, the Tucker decomposition result does not need to be reconstructed into an original tensor and then operation is carried out, and meanwhile, a parallel computing mode is adopted during operation, so that the computing efficiency of the Tucker decomposition result is greatly improved. The method comprises the following steps: performing tensor Tucker decomposition on constructed target tensor data to obtain a core tensor and a factor matrix corresponding to the target tensor data; determining an operation rule corresponding to the target tensor data; determining a parallel computing mode of the target tensor data according to the operation rule, wherein the parallel computing mode comprises an inter-kernel parallel computing mode and an intra-kernel parallel computing mode; and performing parallel calculation on the core tensor and the factor matrix based on the parallel calculation mode and the operation rule to obtain a calculation result.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the field of data processing, and in particular to a parallel computing method based on tensor Tucker decomposition results and related equipment. Background Art

[0002] With the rapid development of technologies such as the Internet, the Internet of Things, and cloud computing in recent years, human society has gradually entered the era of big data from the information society. In the era of big data, data presents the characteristics of massive, multi-dimensional, and heterogeneous. In particular, the typical characteristics of big data are becoming increasingly prominent, such as large data scale (Volume), multiple types (Variety), fast generation speed (Velocity), incomplete data (Veracity), and low value density (Value). Existing data processing methods often organize multidimensional data into vectors for analysis in the data preprocessing stage, which not only destroys the original structure of the data and makes it difficult to fuse different features, but also suffers from the dimensionality disaster problem of data vectorization representation. Representing high-dimensional data using tensor theory can not only maintain the inherent structure of complex data types but also effectively extract core data. However, when performing big data analysis and calculation on the original tensor, with the rapid accumulation of feature data, it often brings about the dimensionality disaster problem.

[0003] Tucker decomposition, as a tensor decomposition method, has been widely used in image processing, data mining, social network analysis and other fields due to its strong data interpretability, flexibility and high scalability. However, in an environment with limited computing resources, especially in scenarios with limited device performance such as edge computing, Tucker decomposition still faces the challenge of the curse of dimensionality. In addition, the amount of data in the big data era is very huge, and traditional serial computing methods are extremely time-consuming and difficult to meet the actual time response requirements. Summary of the invention

[0004] The present invention provides a parallel computing method and device based on the Tucker decomposition results of tensors, which can directly perform tensor operations based on the Tucker decomposition results and keep the calculation results in the form of Tucker decomposition, thereby eliminating the need to reconstruct the original tensor from the Tucker decomposition results and then perform calculations. At the same time, the parallel computing method used in the calculations greatly improves the calculation efficiency of the Tucker decomposition results.

[0005] A first aspect of the present invention provides a parallel computing method based on a tensor Tucker decomposition result, the method comprising:

[0006] Performing tensor Tucker decomposition on the constructed target tensor data to obtain the core tensor and factor matrix corresponding to the target tensor data;

[0007] Determining an operation rule corresponding to the target tensor data;

[0008] Determine a parallel computing mode of the target tensor data according to the operation rule, wherein the parallel computing mode includes an inter-core parallel computing mode and an intra-core parallel computing mode;

[0009] The core tensor and the factor matrix are calculated in parallel based on the parallel computing mode and the operation rule to obtain a calculation result.

[0010] A second aspect of the present invention provides a parallel computing device based on tensor Tucker decomposition results, the method comprising:

[0011] A decomposition module, used to perform tensor Tucker decomposition on the constructed target tensor data to obtain a core tensor and a factor matrix corresponding to the target tensor data;

[0012] A first determination module, used to determine the operation rule corresponding to the target tensor data;

[0013] A second determination module is used to determine a parallel computing mode of the target tensor data according to the operation rule, wherein the parallel computing mode includes an inter-core parallel computing mode and an intra-core parallel computing mode;

[0014] A computing module is used to perform parallel computing on the core tensor and the factor matrix based on the parallel computing mode and the operation rule to obtain a computing result.

[0015] In a possible design, when the parallel computing mode is an intra-core parallel computing mode, the computing module is specifically used to:

[0016] Determine the vector corresponding to the target tensor data;

[0017] Dividing the core tensor into blocks to obtain a core tensor block set corresponding to the core tensor;

[0018] Dividing the vector into blocks to obtain a vector segment set corresponding to the vector, wherein the core tensor block set is associated with the vector segment set;

[0019] Segmenting the factor matrix to obtain a set of matrix segments, wherein the set of core tensor blocks is associated with the set of matrix segments;

[0020] Based on the operation rule, performing in-core parallel calculation on the core tensor block set and the vector segment set to obtain a first calculation result;

[0021] Based on the operation rule, performing in-core parallel calculation on the core tensor block set and the matrix segment set to obtain a second calculation result;

[0022] Based on the operation rule, perform intra-core parallel calculation on each core tensor block in the core tensor block set to obtain a third calculation result;

[0023] Among them, the first calculation result, the second calculation result and the third calculation result are all the calculation results.

[0024] In a possible design, the computing module is further specifically used for:

[0025] Determine a vector segment corresponding to each core tensor block in the core tensor block set in the vector segment set;

[0026] Based on the operation rule, each core tensor block in the core tensor block set is contracted and merged with the corresponding vector segment to obtain the first calculation result.

[0027] In a possible design, the computing module is further specifically used for:

[0028] Determine the identifier corresponding to the first core tensor block The first core tensor block is any core tensor block in the core tensor block set, s1, s2, ...s N is the segment number of each order in the target vector, N is the order of the core tensor, 1≤s N ≤B core , B core The number of segments per order of the first core tensor block;

[0029] Determine the identifier corresponding to the target vector segment The target vector segment is any vector segment in the vector segment set, n is the order of contraction of the target vector segment and the target core tensor, and m is the number of segments of the target vector segment in the target vector;

[0030] According to the identification and the identification Determine a vector segment corresponding to each core tensor block in the first core tensor block set in the vector segment set.

[0031] In a possible design, the computing module is further specifically used for:

[0032] Determine a matrix segment corresponding to each core tensor block in the core tensor block set in the matrix segment set;

[0033] Based on the operation rule, each core tensor block in the core tensor block set is contracted and merged with the corresponding matrix segment to obtain the second calculation result.

[0034] In a possible design, the computing module is further specifically used for:

[0035] Determine the identifier corresponding to the second core tensor block and The second core tensor block is any core tensor block in the core tensor block set;

[0036] According to the operation rules and Perform calculation to obtain a sub-calculation result corresponding to the second core tensor block;

[0037] Get the overall shape of the final result tensor;

[0038] Dividing the overall shape according to a preset rule to obtain a plurality of sub-areas;

[0039] Determine, according to the sub-calculation result, a target sub-region among the multiple regions corresponding to the second core tensor;

[0040] A value is assigned to the target sub-region to obtain the third calculation result.

[0041] In a possible design, the computing module is further specifically used for:

[0042] The sub-calculation result corresponding to the second core tensor block is determined by the following formula:

[0043]

[0044] in, It is the sub-computation result corresponding to the second core tensor block.

[0045] A third aspect of an embodiment of the present invention provides an electronic device, including a memory and a processor, wherein the processor is used to implement the steps of the parallel computing method based on tensor Tucker decomposition results as described in the first aspect above when executing a computer management program stored in the memory.

[0046] A fourth aspect of an embodiment of the present invention provides a computer-readable storage medium on which a computer management program is stored. When the computer management program is executed by a processor, the steps of the parallel computing method based on the tensor Tucker decomposition result as described in the first aspect above are implemented.

[0047] In summary, it can be seen that in the embodiment provided by the present invention, the core tensor and factor matrix corresponding to the target tensor data are obtained by performing tensor Tucker decomposition on the constructed target tensor data; the operation rules corresponding to the target tensor data are determined; the parallel computing mode of the target tensor data is determined according to the operation rules, and the parallel computing mode includes an inter-core parallel computing mode and an intra-core parallel computing mode; finally, the core tensor and factor matrix are parallelly calculated based on the parallel computing mode and the operation rules to obtain the calculation result. Thus, tensor operations can be directly performed on the basis of the Tucker decomposition results, and the calculation results are kept in the form of Tucker decomposition, so that there is no need to reconstruct the original tensor of the Tucker decomposition results and then perform operations. At the same time, the parallel computing method adopted when performing operations greatly improves the calculation efficiency of the Tucker decomposition results. BRIEF DESCRIPTION OF THE DRAWINGS

[0048] Figure 1 A schematic diagram of a parallel computing method based on tensor Tucker decomposition results provided by an embodiment of the present invention;

[0049] Figure 2 A schematic diagram of a tensor chain parallel computing architecture provided in an embodiment of the present invention;

[0050] Figure 3 A schematic diagram of a block method for core tensors and vectors provided in an embodiment of the present invention;

[0051] Figure 4 A schematic diagram of the block calculation division of the third-order core tensor and factor matrix provided in an embodiment of the present invention;

[0052] Figure 5 A schematic diagram of a block partitioning method between different core tensors provided in an embodiment of the present invention;

[0053] Figure 6 A schematic diagram of a calculation rule for performing Kronecker products between core tensors provided in an embodiment of the present invention;

[0054] Figure 7 A schematic diagram of a virtual structure of a parallel computing device based on tensor Tucker decomposition results provided by an embodiment of the present invention;

[0055] Figure 8 A schematic diagram of the hardware structure of a parallel computing device based on tensor Tucker decomposition results provided by an embodiment of the present invention;

[0056] Fig. 9 A schematic diagram of an embodiment of an electronic device provided by an embodiment of the present invention;

[0057] Fig.10A schematic diagram of an embodiment of a computer-readable storage medium provided in an embodiment of the present invention. DETAILED DESCRIPTION

[0058] The following will be combined with the drawings in the embodiments of the present invention to clearly and completely describe the technical solutions in the embodiments of the present invention. Obviously, the described embodiments are only part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by those skilled in the art without creative work are within the scope of protection of the present invention.

[0059] In the following description, specific embodiments of the present invention will be described with reference to steps and symbols performed by one or more computers, unless otherwise stated. Therefore, these steps and operations will be mentioned several times as being performed by a computer, and computer execution referred to herein includes operations by a computer processing unit of electronic signals representing data in a structured form. This operation converts the data or maintains it at a location in the computer's memory system, which can be reconfigured or otherwise change the operation of the computer in a manner familiar to testers in the field. The data structure maintained by the data is a physical location in the memory, which has specific characteristics defined by the data format. However, the principles of the present invention are described in the above text, which does not represent a limitation, and testers in the field will understand that the various steps and operations described below can also be implemented in hardware.

[0060] The principles of the present invention operate with many other general or special purpose computing, communication environments or configurations. Examples of well-known computing systems, environments and configurations suitable for use with the present invention may include, but are not limited to, handheld phones, personal computers, servers, multiprocessor systems, microcomputer-based systems, mainframe computers, and distributed computing environments, including any of the above systems or devices.

[0061] The terms "first", "second", and "third" in the present invention are used to distinguish different objects rather than to describe a specific order. In addition, the terms "include", "have", and any variations thereof are intended to cover non-exclusive inclusions.

[0062] Combine the following Figure 1 The parallel computing method based on the tensor Tucker decomposition result is described from the perspective of a parallel computing device based on the tensor Tucker decomposition result. The parallel computing device based on the tensor Tucker decomposition result can be a master node. Figure 1 , Figure 1 A flow chart of a parallel computing method based on tensor Tucker decomposition results provided in an embodiment of the present invention includes:

[0063] 101. Perform tensor Tucker decomposition on the constructed target tensor data to obtain the core tensor and factor matrix corresponding to the target tensor data.

[0064] In this embodiment, the parallel computing device based on the tensor Tucker decomposition result can perform tensor Tucker decomposition on the constructed target tensor data to obtain the core tensor and factor matrix corresponding to the target tensor data.

[0065] It should be noted that the target tensor data includes tensor X and tensors Y , for the tensor X and tensors Y The decomposition result obtained after tensor Tucker decomposition can be expressed by the following formula: The core tensor is G (X) , the factor matrix is The core tensor is G (Y) , is a factor matrix.

[0066] 102. Determine the calculation corresponding to the target tensor data.

[0067] In this embodiment, a parallel computing device based on the tensor Tucker decomposition result can perform tensor operations directly on the basis of the Tucker decomposition result, and keep the calculation result in the form of Tucker decomposition, so there is no need to reconstruct the original tensor from the Tucker decomposition result and then perform the operation. According to the characteristics of tensor operations, tensor operations are divided into three types: the first is basic tensor operations, which involve extracting a certain value or sub-tensor in the tensor. The second is tensor mathematical operations, which mainly operate on the numerical values ​​in the tensor. The third is contraction operations, which involve changes in the order between different tensors. When it is necessary to perform a certain operation on the target tensor data (select the operation rules according to actual needs), the corresponding operation rules can be determined. All the operation rules are shown in Table 1. Please refer to Table 1. Table 1 is a table of tensor operation rules based on Tucker decomposition results provided in an embodiment of the present invention:

[0068] Table 1

[0069]

[0070]

[0071]

[0072] It should be noted that the core tensor and factor matrix can be determined through step 101, and the operation rules can be determined through step 102. However, there is no restriction on the order of execution between these two steps. Step 101 can be executed first, or step 102 can be executed first, or they can be executed at the same time. There is no specific limitation.

[0073] 103. Determine the parallel computing mode of the target tensor data according to the operation rules.

[0074] In this embodiment, the parallel computing device based on the tensor Tucker decomposition result can determine the parallel computing mode of the target tensor data according to the operation rules. The parallel computing mode includes the intra-core parallel computing mode and the inter-core parallel computing mode. Specifically, the parallel computing device based on the tensor Tucker decomposition result can determine whether there is a direct calculation between the core tensor and the factor matrix involved in the calculation in the operation rules; if so, the parallel computing mode of the target tensor data is determined to be the inter-core parallel computing mode; if not, the parallel computing mode of the target tensor data is determined to be the intra-core parallel computing mode. Figure 2 For detailed instructions, see Figure 2 , Figure 2 A schematic diagram of a tensor chain parallel computing architecture provided for an embodiment of the present invention:

[0075] The parallel computing device based on the tensor Tucker decomposition result can perform tensor Tucker decomposition on the constructed tensor, and use distributed storage for the decomposed tensor core and factor matrix. In inter-core parallelism, the core tensors and factor matrices are calculated in pairs. This parallel mode is suitable for most binary operations; intra-core parallelism is designed to solve the parallel computing bottleneck problem caused by the large amount of data of core tensors or factor matrices. The parallel units are core tensor blocks, factor matrices and vector blocks.

[0076] 104. Based on the parallel computing mode and operation rules, the core tensor and the factor matrix are calculated in parallel to obtain the calculation results.

[0077] In this embodiment, according to the parallel mode determined in step 103, combined with the operation rules determined in step 102, specific parallel computing is implemented, which is described below respectively:

[0078] When there is no direct calculation between the core tensors and factor matrices involved in the calculation rule, inter-core parallel calculation (that is, inter-core parallel calculation mode) is applicable. Specifically, each pair of core tensors and factor matrices is regarded as a basic unit of parallelism and is assigned to different computing nodes for calculation.

[0079] When the parallel computing mode is the inter-core parallel computing mode, the parallel computing device based on the tensor Tucker decomposition result can first determine the vector corresponding to the target tensor data; and block the core tensor to obtain a core tensor block set corresponding to the core tensor; block the vector to obtain a vector segment set corresponding to the vector, and there is an association between the core tensor block set and the vector segment set; segment the factor matrix to obtain a matrix segment set, and there is an association between the core tensor block set and the matrix segment set; based on the operation rules, perform intra-core parallel calculation on the core tensor block set and the vector segment set to obtain a first calculation result; based on the operation rules, perform intra-core parallel calculation on the core tensor block set and the matrix segment set to obtain a second calculation result; based on the operation rules, perform intra-core parallel calculation between each core tensor block in the core tensor block set to obtain a third calculation result; wherein, the first calculation result, the second calculation result and the third calculation result are all calculation results.

[0080] It should be noted that the intra-core parallelism is more complicated. When performing intra-core parallelism, the core tensors, vectors, and factor matrices must first be segmented or divided into blocks. The ways of performing intra-core parallelism between core tensors and vectors, core tensors and factor matrices, and between core tensors are different. The following describes the three situations separately:

[0081] 1. Perform in-core parallel computation on core tensors and vectors;

[0082] The parallel computing device based on the tensor Tucker decomposition result performs in-core parallel computing on the core tensor block set and the vector segment set based on the operation rule, and obtains the first computing result including:

[0083] Determine a vector segment corresponding to each core tensor block in the core tensor block set in the vector segment set;

[0084] Based on the operation rule, each core tensor block in the core tensor block set is contracted and merged with the corresponding vector segment to obtain a first calculation result.

[0085] In this embodiment, the calculation of core tensors and vectors involves multiple operations, such as multiplication of multilinear vectors, partial calculation of inner products, and solution of Frobenius norm. Therefore, a parallel computing device based on the tensor Tucker decomposition result designs a core tensor and vector block partitioning scheme to achieve intra-core parallelism, and takes multilinear vector multiplication as an example to illustrate this parallel computing method. Under the intra-core parallel strategy, the entire core tensor needs to be divided into blocks so that the computing tasks of multiple sub-blocks can be processed in parallel. Correspondingly, the vectors involved in the calculation also need to be segmented accordingly according to the division of the core tensor. Finally, each block of the core tensor is contracted and merged with the corresponding vector segment to achieve the goal of parallel computing. Please refer to Figure 3 , Figure 3 A schematic diagram of the core tensor and vector block division method provided in an embodiment of the present invention, each set of core tensor blocks and vector segments is regarded as a basic unit for parallel execution, thereby realizing the parallelization of such tensor operations and improving execution efficiency. The following describes how to determine the vector segment corresponding to each core tensor block in the core tensor block set in the vector segment set:

[0086] The parallel computing device based on the tensor Tucker decomposition result can first determine the identifier corresponding to the first core tensor block The first core tensor block is any core tensor block in the core tensor block set, s1, s2, ...s N is the segment number of each order in the target vector, N is the order of the core tensor, 1≤s N ≤B core , B core The number of segments per order for the first core tensor block;

[0087] Determine the identifier corresponding to the target vector segment Wherein, the target vector segment is any vector segment in the vector segment set, n is the order of contraction of the target vector segment and the target core tensor, and m is the number of segments of the target vector segment in the target vector;

[0088] According to the logo and logo Determine a vector segment in the vector segment set corresponding to each core tensor block in the first core tensor block set.

[0089] That is, for an N-order core tensor, after block division, each core tensor block needs to be determined by N subscripts, expressed as s1,s2,…s N is the segment number of each order of the block. For the convenience of analysis, assume that each order of the tensor is divided into B core segment, then s n The value range is 1≤s n ≤B core . The vector segment can be expressed as Where n represents the order of the vector to be contracted, and m represents the order of the segment in the entire vector. According to the above numbering rules, the subscripts s1, s2, ...s of the core tensor block are N You can determine which vector segments are corresponding to the shrinkage and traverse s1, s2, ...s N For each subscript of , we can get the number of segments of the vectors to be condensed at each order, for example, s n The corresponding vector segment is After obtaining the corresponding calculation relationship between different blocks through this block division method, the master node in the parallel system will classify the blocks with corresponding calculation relationships into different groups and assign them to different slave nodes. The slave nodes only need to receive the blocks assigned by the master node for calculation and return the results to the master node. Finally, the master node summarizes the results returned by each slave node to complete the parallel computing task.

[0090] 2. Perform in-core parallel computation on core tensors and factor matrices;

[0091] The parallel computing device based on the tensor Tucker decomposition result performs intra-core parallel computing on the core tensor block set and the matrix segment set based on the operation rule, and obtains the second computing result including:

[0092] Determine a matrix segment corresponding to each core tensor block in the core tensor block set in the matrix segment set;

[0093] Based on the operation rule, each core tensor block in the core tensor block set is contracted and merged with the corresponding matrix segment to obtain a second calculation result.

[0094] In this embodiment, the calculation between the core tensor and the factor matrix mainly involves the basic operations of the tensor, including taking elements, taking fibers, taking slices, taking sub-tensors, and restoring tensors. The parallel computing device based on the tensor Tucker decomposition result divides the entire core tensor into blocks, and the factor matrix involved in the calculation also needs to be divided into blocks of dimension R according to the division of the core tensor. n Finally, each block of the core tensor is contracted and merged with the corresponding vector segment to achieve the goal of parallel computing.

[0095] It should be noted that this partitioning concept is basically consistent with the in-core parallel partitioning method of core tensor and vector calculations. Figure 4 An example of in-core and down-division of a third-order tensor is given. Each core tensor block needs to be identified by N subscripts, expressed as s1,s2,…s N is the segment number of each order of the block. For the convenience of analysis, assume that each order of the tensor is divided into B core segment, then s n ,1≤n≤N ranges from 1≤s n ≤B core The factor matrix block can be expressed as Where n represents the order with which the block is to be collapsed, and m represents the order in which the block is divided in the entire factor matrix. According to the above numbering rules, the subscripts S1, S2, ... S of the core tensor blocks are N You can determine which vector segments are corresponding to the shrinkage and traverse s1, s2, ...s NFor each subscript of , we can get the number of segments that the vectors to be condensed at each order are divided into, for example, S n The corresponding vector segment is

[0096] 3. Perform intra-core parallel computation between core tensor blocks;

[0097] The parallel computing device based on the tensor Tucker decomposition result performs intra-core parallel computing on each core tensor block in the core tensor block set based on the computing rule, and obtains the third computing result including:

[0098] Determine the identifier corresponding to the second core tensor block and The second core tensor block is any core tensor block in the core tensor block set;

[0099] According to the operation rules and Perform calculations to obtain the sub-calculation results corresponding to the second core tensor block;

[0100] Get the overall shape of the final result tensor;

[0101] Divide the overall shape according to preset rules to obtain multiple sub-areas;

[0102] Determine a target sub-region corresponding to the second core tensor in the plurality of regions according to the sub-calculation results;

[0103] The target sub-region is assigned a value to obtain a third calculation result.

[0104] In this embodiment, the calculation between two core tensors mainly involves Hadamard product, inner product and Frobenius norm. These operations are mixed operations, involving operations between factor matrices and between core tensors at the same time, and are suitable for calculation in a core parallel manner. Please refer to Figure 5 , Figure 5 The following is a schematic diagram of the block division method between different core tensors provided in the embodiment of the present invention. Since the calculation between core tensors mainly involves Kronecker products, block calculation rules are designed for this operation. An example of performing block Kronecker products between third-order tensors is given as follows: Figure 6 As shown, for an N-order core tensor, after block division, each core tensor block needs to be determined by N subscripts, respectively. and In the whole process, since Kronecker products are performed between each core tensor block, and the calculation result is part of the final result, the overall shape of the final result tensor must be obtained first, and the overall shape is divided according to the preset rules to obtain multiple sub-areas, and determine which part of the calculation result each sub-area is. After the calculation is completed, the partial result tensor can be directly assigned to the corresponding sub-area.

[0105] That is, according to the core tensor G (X) and G (Y) The shape of the resulting tensor is determined by G (Z) The overall shape of G (Z) Perform secondary block division, the first level block division method is the same as the core tensor G (X) The second level of block division is based on each block divided by the first level. G (Y) Therefore, G (Z) Each divided tensor block can be G (X) and G (Y) The tensor block is determined, assuming that G (X) Tensor block and G (Y) Tensor block To perform an operation, you need to determine the result of the operation. G (Z) The position in the Find the block in the first level block that belongs to the first segment at each level, and then in this block according to Find the blocks whose second order belongs to the second segment, and whose first and third orders belong to the first segment.

[0106] According to the above rules, the following rules can be summarized: each calculation result core tensor block needs to be determined by 2N subscripts, and the calculation result is expressed as The calculation result can be calculated by the following formula:

[0107] It should be noted that, during the process of performing intra-core parallel computing, different operation rules can be selected from Table 1 for computing according to actual needs.

[0108] In summary, it can be seen that in the embodiment provided by the present invention, the core tensor and factor matrix corresponding to the target tensor data are obtained by performing tensor Tucker decomposition on the constructed target tensor data; the operation rules corresponding to the target tensor data are determined; the parallel computing mode of the target tensor data is determined according to the operation rules, and the parallel computing mode includes an inter-core parallel computing mode and an intra-core parallel computing mode; finally, the core tensor and factor matrix are parallelly calculated based on the parallel computing mode and the operation rules to obtain the calculation result. Thus, tensor operations can be directly performed on the basis of the Tucker decomposition results, and the calculation results are kept in the form of Tucker decomposition, so that there is no need to reconstruct the original tensor of the Tucker decomposition results and then perform operations. At the same time, the parallel computing method adopted when performing operations greatly improves the calculation efficiency of the Tucker decomposition results.

[0109] The above describes an embodiment of the present invention from the perspective of a parallel computing method based on a tensor Tucker decomposition result. The following describes an embodiment of the present invention from the perspective of a parallel computing device based on a tensor Tucker decomposition result.

[0110] See also Figure 7 , a virtual structural diagram of a parallel computing device based on tensor Tucker decomposition results in an embodiment of the present invention, the parallel computing device based on tensor Tucker decomposition results 700 includes:

[0111] A decomposition module 701 is used to perform tensor Tucker decomposition on the constructed target tensor data to obtain a core tensor and a factor matrix corresponding to the target tensor data;

[0112] A first determination module 702, used to determine the operation rule corresponding to the target tensor data;

[0113] A second determination module 703 is used to determine the parallel computing mode of the target tensor data according to the operation rule, wherein the parallel computing mode includes an inter-core parallel computing mode and an intra-core parallel computing mode;

[0114] The computing module 704 is used to perform parallel computing on the core tensor and the factor matrix based on the parallel computing mode and the operation rule to obtain a computing result.

[0115] In a possible design, when the parallel computing mode is the intra-core parallel computing mode, the computing module 704 is specifically used for:

[0116] Determine the vector corresponding to the target tensor data;

[0117] Dividing the core tensor into blocks to obtain a core tensor block set corresponding to the core tensor;

[0118] Dividing the vector into blocks to obtain a vector segment set corresponding to the vector, wherein the core tensor block set is associated with the vector segment set;

[0119] Segmenting the factor matrix to obtain a set of matrix segments, wherein the set of core tensor blocks is associated with the set of matrix segments;

[0120] Based on the operation rule, performing in-core parallel calculation on the core tensor block set and the vector segment set to obtain a first calculation result;

[0121] Based on the operation rule, performing in-core parallel calculation on the core tensor block set and the matrix segment set to obtain a second calculation result;

[0122] Based on the operation rule, perform intra-core parallel calculation on each core tensor block in the core tensor block set to obtain a third calculation result;

[0123] Among them, the first calculation result, the second calculation result and the third calculation result are all the calculation results.

[0124] In a possible design, the calculation module 704 is further specifically configured to:

[0125] Determine a vector segment corresponding to each core tensor block in the core tensor block set in the vector segment set;

[0126] Based on the operation rule, each core tensor block in the core tensor block set is contracted and merged with the corresponding vector segment to obtain the first calculation result.

[0127] In a possible design, the calculation module 704 is further specifically configured to:

[0128] Determine the identifier corresponding to the first core tensor block The first core tensor block is any core tensor block in the core tensor block set, s1, s2, ...s N is the segment number of each order in the target vector, N is the order of the core tensor, 1≤s N ≤B core , B core The number of segments per order of the first core tensor block;

[0129] Determine the identifier corresponding to the target vector segment The target vector segment is any vector segment in the vector segment set, n is the order of contraction of the target vector segment and the target core tensor, and m is the number of segments of the target vector segment in the target vector;

[0130] According to the identification and the identification Determine a vector segment in the vector segment set corresponding to each core tensor block in the first core tensor block set.

[0131] In a possible design, the calculation module 704 is further specifically configured to:

[0132] Determine a matrix segment corresponding to each core tensor block in the core tensor block set in the matrix segment set;

[0133] Based on the operation rule, each core tensor block in the core tensor block set is contracted and merged with the corresponding matrix segment to obtain the second calculation result.

[0134] In a possible design, the calculation module 704 is further specifically configured to:

[0135] Determine the identifier corresponding to the second core tensor block and The second core tensor block is any core tensor block in the core tensor block set;

[0136] According to the operation rules and Perform calculation to obtain a sub-calculation result corresponding to the second core tensor block;

[0137] Get the overall shape of the final result tensor;

[0138] Dividing the overall shape according to a preset rule to obtain a plurality of sub-areas;

[0139] Determine, according to the sub-calculation result, a target sub-region among the multiple regions corresponding to the second core tensor;

[0140] A value is assigned to the target sub-region to obtain the third calculation result.

[0141] In a possible design, the calculation module 704 is further specifically configured to:

[0142] The sub-calculation result corresponding to the second core tensor block is determined by the following formula:

[0143]

[0144] in, It is the sub-computation result corresponding to the second core tensor block.

[0145] above Figure 7The parallel computing device based on the tensor Tucker decomposition result in the embodiment of the present invention is described from the perspective of modular functional entities. The parallel computing device based on the tensor Tucker decomposition result in the embodiment of the present invention is described in detail from the perspective of hardware processing. Please refer to Figure 8 , a schematic diagram of an embodiment of a parallel computing device 800 based on tensor Tucker decomposition results in an embodiment of the present invention, the parallel computing device 800 based on tensor Tucker decomposition results includes:

[0146] An input device 801, an output device 802, a processor 803 and a memory 804 (the number of the processor 803 can be one or more, Figure 8 In some embodiments of the present invention, the input device 801, the output device 802, the processor 803 and the memory 804 may be connected via a communication bus or other means, wherein: Figure 8 The communication bus connection is taken as an example.

[0147] Wherein, by calling the operation instruction stored in the memory 804, the processor 803 is used to perform the following steps:

[0148] Performing tensor Tucker decomposition on the constructed target tensor data to obtain the core tensor and factor matrix corresponding to the target tensor data;

[0149] Determining an operation rule corresponding to the target tensor data;

[0150] Determine a parallel computing mode of the target tensor data according to the operation rule, wherein the parallel computing mode includes an inter-core parallel computing mode and an intra-core parallel computing mode;

[0151] The core tensor and the factor matrix are calculated in parallel based on the parallel computing mode and the operation rule to obtain a calculation result.

[0152] By calling the operation instructions stored in the memory 804, the processor 803 is also used to execute Figure 1 Any method in the corresponding embodiment.

[0153] See also Fig. 9 , Fig. 9 A schematic diagram of an electronic device according to an embodiment of the present invention.

[0154] like Fig. 9 As shown, an embodiment of the present invention provides an electronic device, including a memory 910, a processor 920, and a computer program 911 stored in the memory 910 and executable on the processor 920. When the processor 920 executes the computer program 911, the following steps are implemented:

[0155] Performing tensor Tucker decomposition on the constructed target tensor data to obtain the core tensor and factor matrix corresponding to the target tensor data;

[0156] Determining an operation rule corresponding to the target tensor data;

[0157] Determine a parallel computing mode of the target tensor data according to the operation rule, wherein the parallel computing mode includes an inter-core parallel computing mode and an intra-core parallel computing mode;

[0158] The core tensor and the factor matrix are calculated in parallel based on the parallel computing mode and the operation rule to obtain a calculation result.

[0159] In the specific implementation process, when the processor 920 executes the computer program 911, it can achieve Figure 1 Any implementation manner in the corresponding embodiments.

[0160] Since the electronic device introduced in this embodiment is a device used to implement a parallel computing device based on the tensor Tucker decomposition result in the embodiment of the present invention, based on the method introduced in the embodiment of the present invention, the technical personnel in this field can understand the specific implementation mode of the electronic device of this embodiment and its various variations. Therefore, how the electronic device implements the method in the embodiment of the present invention is not introduced in detail here. As long as the equipment used by the technical personnel in this field to implement the method in the embodiment of the present invention is within the scope of protection of the present invention.

[0161] See also Fig.10 , Fig.10 A schematic diagram of an embodiment of a computer-readable storage medium provided in an embodiment of the present invention.

[0162] like Fig.10 As shown, the embodiment of the present invention further provides a computer-readable storage medium 1000, on which a computer program 1011 is stored. When the computer program 1011 is executed by a processor, the following steps are implemented:

[0163] Performing tensor Tucker decomposition on the constructed target tensor data to obtain the core tensor and factor matrix corresponding to the target tensor data;

[0164] Determining an operation rule corresponding to the target tensor data;

[0165] Determine a parallel computing mode of the target tensor data according to the operation rule, wherein the parallel computing mode includes an inter-core parallel computing mode and an intra-core parallel computing mode;

[0166] The core tensor and the factor matrix are calculated in parallel based on the parallel computing mode and the operation rule to obtain a calculation result.

[0167] In the specific implementation process, the computer program 1011 is executed by the processor to achieve Figure 1 Any implementation manner in the corresponding embodiments.

[0168] It should be noted that in the above embodiments, the description of each embodiment has its own emphasis, and for parts that are not described in detail in a certain embodiment, reference can be made to the relevant descriptions of other embodiments.

[0169] The embodiment of the present invention also provides a computer program product, which includes computer software instructions. When the computer software instructions are executed on a processing device, the processing device executes the following Figure 1 The process in the corresponding embodiment.

[0170] The computer program product includes one or more computer instructions. When the computer program instructions are loaded and executed on a computer, the process or function described in the embodiment of the present invention is fully or partially generated.

[0171] Those skilled in the art can clearly understand that, for the convenience and brevity of description, the specific working processes of the systems, devices and units described above can refer to the corresponding processes in the aforementioned method embodiments and will not be repeated here.

[0172] As described above, the above embodiments are only used to illustrate the technical solutions of the present invention, rather than to limit the same. Although the present invention has been described in detail with reference to the aforementioned embodiments, those skilled in the art should understand that the technical solutions described in the aforementioned embodiments may still be modified, or some of the technical features thereof may be replaced by equivalents. However, these modifications or replacements do not deviate the essence of the corresponding technical solutions from the spirit and scope of the technical solutions of the embodiments of the present invention.

Claims

1. A parallel computing method based on tensor Tucker decomposition results, characterized in that: The method comprises: Performing tensor Tucker decomposition on the constructed target tensor data to obtain the core tensor and factor matrix corresponding to the target tensor data; Determining an operation rule corresponding to the target tensor data; Determine a parallel computing mode of the target tensor data according to the operation rule, wherein the parallel computing mode includes an inter-core parallel computing mode and an intra-core parallel computing mode; The core tensor and the factor matrix are calculated in parallel based on the parallel computing mode and the operation rule to obtain a calculation result.

2. The method according to claim 1, characterized in that When the parallel computing mode is the intra-core parallel computing mode, the core tensor and the factor matrix are parallelly computed based on the parallel computing mode and the operation rule to obtain the computation result, including: Determine the vector corresponding to the target tensor data; Dividing the core tensor into blocks to obtain a core tensor block set corresponding to the core tensor; Dividing the vector into blocks to obtain a vector segment set corresponding to the vector, wherein the core tensor block set is associated with the vector segment set; Segmenting the factor matrix to obtain a set of matrix segments, wherein the set of core tensor blocks is associated with the set of matrix segments; Based on the operation rule, performing in-core parallel calculation on the core tensor block set and the vector segment set to obtain a first calculation result; Based on the operation rule, performing in-core parallel calculation on the core tensor block set and the matrix segment set to obtain a second calculation result; Based on the operation rule, perform intra-core parallel calculation on each core tensor block in the core tensor block set to obtain a third calculation result; Among them, the first calculation result, the second calculation result and the third calculation result are all the calculation results.

3. The method according to claim 2, characterized in that The performing of in-core parallel calculation on the core tensor block set and the vector segment set based on the operation rule to obtain a first calculation result includes Determine a vector segment corresponding to each core tensor block in the core tensor block set in the vector segment set; Based on the operation rule, each core tensor block in the core tensor block set is contracted and merged with the corresponding vector segment to obtain the first calculation result.

4. The method according to claim 3, characterized in that: The determining of the vector segment corresponding to each core tensor block in the core tensor block set in the vector segment set comprises: Determine the identifier corresponding to the first core tensor block The first core tensor block is any core tensor block in the core tensor block set, s1, s2, ...s N is the segment number of each order in the target vector, N is the order of the core tensor, 1≤s N ≤B core , B core The number of segments per order of the first core tensor block; Determine the identifier corresponding to the target vector segment The target vector segment is any vector segment in the vector segment set, n is the order of contraction of the target vector segment and the target core tensor, and m is the number of segments of the target vector segment in the target vector; According to the identification and the identification Determine a vector segment corresponding to each core tensor block in the first core tensor block set in the vector segment set.

5. The method according to claim 2, characterized in that: The performing in-core parallel calculation on the core tensor block set and the matrix segment set based on the operation rule to obtain a second calculation result includes: Determine a matrix segment corresponding to each core tensor block in the core tensor block set in the matrix segment set; Based on the operation rule, each core tensor block in the core tensor block set is contracted and merged with the corresponding matrix segment to obtain the second calculation result.

6. The method according to claim 3, characterized in that The performing intra-core parallel calculations on the core tensor blocks in the core tensor block set based on the operation rule to obtain a third calculation result includes: Determine the identifier corresponding to the second core tensor block and The second core tensor block is any core tensor block in the core tensor block set; According to the operation rules and Perform calculation to obtain a sub-calculation result corresponding to the second core tensor block; Get the overall shape of the final result tensor; Dividing the overall shape according to a preset rule to obtain a plurality of sub-areas; Determine, according to the sub-calculation result, a target sub-region among the multiple regions corresponding to the second core tensor; A value is assigned to the target sub-region to obtain the third calculation result.

7. The method according to claim 6, characterized in that The operation rules are and Performing calculations to obtain sub-calculation results corresponding to the second core tensor block includes: The sub-calculation result corresponding to the second core tensor block is determined by the following formula: in, It is the sub-computation result corresponding to the second core tensor block.

8. A parallel computing device based on tensor Tucker decomposition results, characterized in that: The method comprises: A decomposition module, used to perform tensor Tucker decomposition on the constructed target tensor data to obtain a core tensor and a factor matrix corresponding to the target tensor data; A first determination module, used to determine the operation rule corresponding to the target tensor data; A second determination module is used to determine a parallel computing mode of the target tensor data according to the operation rule, wherein the parallel computing mode includes an inter-core parallel computing mode and an intra-core parallel computing mode; A computing module is used to perform parallel computing on the core tensor and the factor matrix based on the parallel computing mode and the operation rule to obtain a computing result.

9. An electronic device, characterized in that: include: A memory and a processor, wherein the processor is used to implement the steps of the parallel computing method based on tensor Tucker decomposition results as described in any one of claims 1 to 7 when executing a computer management program stored in the memory.

10. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores a computer management program, and when the computer management program is executed by the processor, the steps of the parallel computing method based on tensor Tucker decomposition results as described in any one of claims 1 to 7 are implemented.

Citation Information

Patent Citations

  • Heterogeneous big data core feature extraction method and system based on tensor decomposition

    CN111209974A

  • Parallel computing acceleration method for super-large-scale artificial neural network numerical operation

    CN112926732A

  • Large-scale high-order tensor network performance parallel computing method, device and equipment

    CN118012619A

  • Overhead type air conditioning apparatus for automotive vehicle

    KR1020200134731A