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

By performing parallel computation on the tensor Tucker decomposition results, the curse of dimensionality problem of Tucker decomposition in edge computing devices is solved, improving computational efficiency and making it suitable for fields such as image processing and data mining.

CN119598084BActive Publication Date: 2026-01-02HAINAN UNIV
View PDF 2 Cites 0 Cited by

Patent Information

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

AI Technical Summary

Technical Problem

In environments with limited computing resources, especially with edge computing devices, Tucker decomposition faces the curse of dimensionality and the time-consuming nature of traditional serial computation, making it difficult to meet real-time response requirements.

Method used

This paper presents a parallel computing method based on the results of tensor Tucker decomposition. By decomposing the target tensor data, the parallel computing mode of operation rules is determined, including inter-core and intra-core parallel computing modes, and tensor operations are performed directly on the Tucker decomposition results.

Benefits of technology

It improves the computational efficiency of Tucker decomposition results, allowing computation without reconstructing the original tensor, and is suitable for fields such as image processing, data mining, and social network analysis.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119598084B_ABST
    Figure CN119598084B_ABST
Patent Text Reader

Abstract

Embodiments of the present application provide a parallel computing method based on tensor Tucker decomposition result and related equipment, without reconstructing the original tensor from the Tucker decomposition result for operation, and the parallel computing mode used in operation greatly improves the computing efficiency of the Tucker decomposition result. The method comprises: performing tensor Tucker decomposition on the target tensor data which has been constructed to obtain the core tensor and the factor matrix corresponding to the target tensor data; determining the operation rule corresponding to the target tensor data; determining the parallel computing mode of the target tensor data according to the operation rule, wherein the parallel computing mode comprises inter-core parallel computing mode and intra-core parallel computing mode; and performing parallel computing on the core tensor and the factor matrix based on the parallel computing mode and the operation rule to obtain the computing result.
Need to check novelty before this filing date? Find Prior Art

Description

TECHNICAL FIELD

[0001] The present application 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

[0002] With the vigorous development of Internet, Internet of Things, cloud computing and other technologies in recent years, human society gradually enters the big data era from the information society. In the big data era, data presents the characteristics of mass, multi-dimension and heterogeneity, and the typical characteristics of big data are increasingly prominent, such as large data size (Volume), multiple types (Variety), high generation speed (Velocity), incomplete data (Veracity), and low value density (Value). The existing data processing method often organizes multi-dimensional data into a vector form for analysis in the data preprocessing stage, which not only destroys the original structure of the data and makes it difficult to fuse different characteristics, but also suffers from the dimension disaster problem of data vectorization representation. Using tensor theory to represent high-dimensional data can not only maintain the internal structure of complex data types but also effectively extract core data. However, performing big data analysis and calculation on the original tensor often brings the dimension disaster problem with the rapid accumulation of characteristic data.

[0003] Tucker decomposition, as a tensor decomposition method, is widely used in image processing, data mining and social network analysis due to its strong data interpretability, flexibility and high scalability. However, in the environment with limited computing resources, especially in the scenario of edge computing with limited device performance, Tucker decomposition still faces the challenge of dimension disaster problem. In addition, the data volume in the big data era is very large, and the traditional serial computing method is extremely time-consuming, which is difficult to meet the actual time response demand. SUMMARY

[0004] The present application provides a parallel computing method and device based on tensor Tucker decomposition results, which can directly perform tensor operation on the basis of Tucker decomposition results and keep the calculation results in the form of Tucker decomposition, so that the original tensor does not need to be reconstructed from the Tucker decomposition results for operation, and the parallel computing method used in the operation greatly improves the calculation efficiency of the Tucker decomposition results.

[0005] The first aspect of the present application provides a parallel computing method based on tensor Tucker decomposition results, which comprises:

[0006] performing tensor Tucker decomposition on the target tensor data which has been constructed to obtain the core tensor and factor matrix corresponding to the target tensor data;

[0007] determine 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, the parallel computing mode including an inter-core parallel computing mode and an intra-core parallel computing mode;

[0009] perform parallel computation on the core tensor and the factor matrix based on the parallel computing mode and the operation rule to obtain a computation result.

[0010] The second aspect of the present application provides a parallel computing device based on a tensor Tucker decomposition result, and the method includes:

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

[0012] a first determination module configured to determine an operation rule corresponding to the target tensor data;

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

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

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

[0016] determine a vector corresponding to the target tensor data;

[0017] perform block division on the core tensor to obtain a core tensor block set corresponding to the core tensor;

[0018] perform block division on the vector to obtain a vector segment set corresponding to the vector, the core tensor block set and the vector segment set having an association relationship;

[0019] perform segmentation on the factor matrix to obtain a matrix segment set, the core tensor block set and the matrix segment set having an association relationship;

[0020] perform intra-core parallel computation on the core tensor block set and the vector segment set based on the operation rule to obtain a first computation result;

[0021] performing in-core parallel calculation between each core tensor block in the core tensor block set based on the operation rule to obtain a third calculation result;

[0022] performing in-core parallel calculation between each core tensor block in the core tensor block set based on the operation rule to obtain a third calculation result;

[0023] The first calculation result, the second calculation result, and the third calculation result are all the calculation result.

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

[0025] determine a corresponding vector segment of each core tensor block in the core tensor block set in the vector segment set;

[0026] perform contraction operation on each core tensor block in the core tensor block set and the corresponding vector segment based on the operation rule to obtain the first calculation result.

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

[0028] determine an identifier corresponding to a first core tensor block The first core tensor block is any one of the core tensor blocks in the core tensor block set, s1, s2, … s N is a segment number of each order of the target vector, N is an order number of the core tensor, and 1≤s N ≤B core , B core is a segment number of each order of the first core tensor block;

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

[0030] determine a corresponding vector segment of each core tensor block in the core tensor block set in the vector segment set according to the identifier and the identifier The first core tensor block set.

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

[0032] determine a corresponding matrix segment of each core tensor block in the core tensor block set in the matrix segment set;

[0033] perform a folding operation on each core tensor block in the core tensor block set and the corresponding matrix segment based on the operation rule to obtain the second calculation result.

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

[0035] determine the identity corresponding to the second core tensor block and The second core tensor block is any one of the core tensor blocks in the core tensor block set.

[0036] perform calculation on and to obtain the sub-computation result corresponding to the second core tensor block.

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

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

[0039] determine a target sub-region corresponding to the second core tensor in the plurality of regions according to the sub-computation result;

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

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

[0042] determine the sub-computation result corresponding to the second core tensor block by the following formula:

[0043]

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

[0045] The third aspect of the embodiment of the present application provides an electronic device, including a memory and a processor, the processor is used for executing the computer management program stored in the memory to realize the steps of the parallel computing method based on the tensor Tucker decomposition result as described in the first aspect.

[0046] The fourth aspect of the embodiment of the present application provides a computer readable storage medium, which stores a computer management program, and the computer management program is executed by a processor to realize the steps of the parallel computing method based on the tensor Tucker decomposition result as described in the first aspect.

[0047] In summary, it can be seen that, in the embodiments provided by the present application, the target tensor data that has been constructed is subjected to tensor Tucker decomposition to obtain a core tensor and factor matrices corresponding to the target tensor data; an operation rule corresponding to the target tensor data is determined; a parallel computing mode of the target tensor data is determined according to the operation rule, and the parallel computing mode includes an inter-core parallel computing mode and an intra-core parallel computing mode; and finally, the core tensor and the factor matrices are subjected to parallel computing based on the parallel computing mode and the operation rule to obtain a computing result. In this way, tensor operation can be directly performed on the basis of the Tucker decomposition result, and the computing result is still in the form of Tucker decomposition, so that it is not necessary to reconstruct the original tensor from the Tucker decomposition result and then perform operation, and meanwhile, the parallel computing mode is adopted when performing operation, which greatly improves the computing efficiency of the Tucker decomposition result. BRIEF DESCRIPTION OF DRAWINGS

[0048] Figure 1 A flowchart of a parallel computing method based on tensor Tucker decomposition result provided by an embodiment of the present application;

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

[0050] Figure 3 A schematic diagram of a block division mode of a core tensor and a vector provided by an embodiment of the present application;

[0051] Figure 4 A schematic diagram of a block division and computing division of a third-order core tensor and a factor matrix provided by an embodiment of the present application;

[0052] Figure 5 A schematic diagram of a block division mode between different core tensors provided by an embodiment of the present application;

[0053] Figure 6 A schematic diagram of a computing rule of Kronecker product between core tensors provided by an embodiment of the present application;

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

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

[0056] Figure 9 An embodiment schematic diagram of an electronic device provided by an embodiment of the present application;

[0057] Figure 10An embodiment of a computer readable storage medium provided by the embodiment of the present application is shown in the figure. DETAILED DESCRIPTION

[0058] The technical solutions in the embodiments of the present application will be clearly and completely described in combination with the drawings in the embodiments of the present application. Obviously, the described embodiments are only some of the embodiments of the present application, but not all the embodiments. Based on the embodiments in the present application, all other embodiments obtained by those skilled in the art without creative work fall within the scope of the present application.

[0059] In the following description, specific embodiments of the present application will be described with reference to steps and symbolic representations of operations that are performed by one or more computers. Unless specifically stated otherwise, as is apparent from the following discussions, it is appreciated that throughout the specification, discussions utilizing terms such as "processing," "computing," "calculating," "determining," "displaying," and / or "determining," involve the actions and / or processes of a computer system, or similar electronic computing device.

[0060] The principles of the present application are operable utilizing a multitude of other general purpose or special purpose computing devices, environments, or configurations. Examples of well known computing systems, environments, and / or configurations that can be suitable for use with the present application include, but are not limited to, handheld or laptop computers, personal computers, servers, multiprocessor systems, microcomputer-based systems, networked computer systems, mainframe computers, and distributed computing environments, where appropriate.

[0061] The terms "first", "second", and "third" and the like in the present application are used to distinguish different objects, and are not used to describe a particular order. In addition, the terms "include" and "have" and any variations thereof are intended to cover non-exclusive inclusion.

[0062] The following will be described in combination with Figure 1 The parallel computing method based on tensor Tucker decomposition result is described from the parallel computing device based on tensor Tucker decomposition result, which can be a master node, please refer to Figure 1 , Figure 1 The flowchart of the parallel computing method based on tensor Tucker decomposition result provided by the embodiment of the present application is shown in the figure, which includes:

[0063] 101. Tensor Tucker decomposition is performed on the constructed target tensor data to obtain a core tensor and factor matrices 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 a core tensor and factor matrices corresponding to the target tensor data.

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

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

[0067] In this embodiment, the parallel computing device based on the tensor Tucker decomposition result can directly perform tensor operation on the basis of the Tucker decomposition result, and keep the calculation result still in the form of Tucker decomposition, so as to avoid reconstructing the original tensor from the Tucker decomposition result and then performing operation. According to the characteristics of tensor operation, the tensor operation is divided into three types: the first type is basic tensor operation, which involves extracting a certain determined value or sub-tensor in the tensor. The second type is tensor mathematical operation, which mainly involves operation on the numerical value in the tensor. The third type is contraction operation, which involves order change between different tensors. When a certain operation needs to be performed on the target tensor data (operation rules are selected according to actual needs), the corresponding operation rule can be determined, and all operation rules are shown in Table 1. Please refer to Table 1, which is a table of tensor operation rules based on Tucker decomposition result provided by the embodiment of the present application:

[0068] Table 1

[0069]

[0070]

[0071]

[0072] It should be noted that the core tensor and the factor matrix can be determined through step 101, and the operation rule can be determined through step 102, and there is no sequence limitation between the two steps, and step 101 can be performed first, or step 102 can be performed first, or the two steps can be performed simultaneously, and the specific implementation is not limited.

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

[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 rule, and 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 participating in the calculation in the operation rule. If yes, the parallel computing mode of the target tensor data is determined as the inter-core parallel computing mode. If no, the parallel computing mode of the target tensor data is determined as the intra-core parallel computing mode. The following will be described in detail in combination with Figure 2 Figure 2 Figure 2 The following is a schematic diagram of the parallel computing architecture based on the tensor chain provided by the embodiment of the present application:

[0075] The parallel computing device based on the tensor Tucker decomposition result can perform tensor Tucker decomposition on the constructed tensor, and store the decomposed tensor core and the factor matrix in a distributed manner. In the inter-core parallel computing, the core tensors and the factor matrices are calculated in pairs, and this parallel mode is suitable for most binary operations. The intra-core parallel computing is designed to solve the parallel computing bottleneck problem caused by the large data volume of the core tensor or the factor matrix, and the parallel unit is the core tensor block, the factor matrix, and the vector block.

[0076] 104. Perform parallel computing on the core tensor and the factor matrix based on the parallel computing mode and the operation rule to obtain a calculation result.

[0077] In this embodiment, according to the parallel mode determined in step 103, the operation rule determined in step 102 is combined to implement specific parallel computing, which will be described below:

[0078] When there is no direct calculation between the core tensor and the factor matrix participating in the operation in the operation rule, the inter-core parallel computing is used for calculation (i.e., the inter-core parallel computing mode), and specifically, each pair of core tensor and factor matrix is regarded as a basic parallel unit and is allocated to different computing nodes for operation.

[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 a vector corresponding to the target tensor data; 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, the core tensor block set and the vector segment set having an association relationship; segment the factor matrix to obtain a matrix segment set, the core tensor block set and the matrix segment set having an association relationship; perform intra-core parallel computing on the core tensor block set and the vector segment set based on an operation rule to obtain a first calculation result; perform intra-core parallel computing on the core tensor block set and the matrix segment set based on the operation rule to obtain a second calculation result; perform intra-core parallel computing among the core tensor blocks in the core tensor block set based on the operation rule to obtain a third calculation result; and 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 relatively complex. When performing intra-core parallelism, the core tensor, the vector, and the factor matrix need to be segmented or blocked first. The ways of intra-core parallel block of the core tensor and the vector, the core tensor and the factor matrix, and the core tensor are different. The following will explain the three cases respectively:

[0081] I. Intra-core parallel computing of the core tensor and the vector;

[0082] The parallel computing device based on the tensor Tucker decomposition result performs intra-core parallel computing on the core tensor block set and the vector segment set based on an operation rule to obtain a first calculation result, which includes:

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

[0084] Performing a contraction operation on each core tensor block in the core tensor block set and the corresponding vector segment based on the operation rule to obtain the first calculation result.

[0085] In this embodiment, the calculation of the core tensor and the vector involves multiple operations, such as the multiplication of multilinear vectors, the partial calculation of inner products, and the solution of Frobenius norms. Therefore, the parallel computing device based on the tensor Tucker decomposition result designs a block scheme for the core tensor and the vector to realize intra-core parallelism. Taking the multiplication of multilinear vectors as an example to illustrate this parallel computing method. Under the strategy of intra-core parallelism, the entire core tensor needs to be blocked to parallelize the calculation tasks of multiple sub-blocks. Correspondingly, the vector participating in the calculation also needs to be segmented according to the division of the core tensor. Finally, each block of the core tensor and the corresponding vector segment are contracted to achieve the goal of parallel computing. Please refer toFigure 3 , Figure 3 The schematic diagram of the core tensor and the block mode of the vector provided by the embodiment of the present application is shown in FIG. 1. Each group of core tensor blocks and vector segments is regarded as a basic unit of parallel execution, so that the parallelization of the tensor operation is realized, and the execution efficiency is improved. The following describes how to determine the corresponding vector segment of 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 one of the core tensor blocks in the core tensor block set, s1, s2, … s N is the segment number of each order of the target vector, N is the order number of the core tensor, 1≤s N ≤B core , B core is the segment number of each order of the first core tensor block;

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

[0088] The corresponding vector segment of each core tensor block in the first core tensor block set in the vector segment set is determined according to the identifier and the identifier .

[0089] That is, for an N-order core tensor, after blocking, each core tensor block needs to be determined by N subscripts, which is represented as s1, s2, … s N is the segment number of each order of the block. In order to facilitate analysis, it is assumed that the tensor is divided into B core segments for each order, and the value range of s n is 1≤s n ≤B core . The vector segment can be represented as where n represents the order to be contracted with the first order, and m represents the segment in the entire vector that belongs to the divided segment. According to the above label rule, the vector segments corresponding to the contraction with the core tensor block subscript s1, s2, … s N can be determined, and each subscript of s1, s2, … s N is traversed to obtain the segment number of the vector segment required to be contracted for each order, for example, the vector segment corresponding to s n is After obtaining the corresponding computational relationships between different blocks using this block-based method, the master node in the parallel system groups the blocks with corresponding computational relationships into different groups and assigns them to different slave nodes. The slave nodes only need to receive the blocks assigned by the master node, perform computations, 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-kernel parallel computation on the core tensor and factor matrix;

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

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

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

[0094] In this embodiment, the calculation between the core tensor and the factor matrix mainly involves basic tensor operations, including element extraction, fiber extraction, slice extraction, sub-tensor extraction, and tensor reconstruction. A parallel computing device based on the tensor Tucker decomposition results divides the entire core tensor into blocks, and the factor matrices involved in the calculation also need to be in dimension R according to the partitioning of the core tensor. n This order is segmented to maintain consistency with the corresponding order of the core tensor. Finally, the blocks of the core tensor are shrunk together with their corresponding vector segments, thereby achieving the goal of parallel computation.

[0095] It should be noted that this block-based approach is essentially consistent with the kernel-parallel block-based method for core tensor and vector computation. Figure 4 An example of kernel subdivision for element-wise access to a third-order tensor is given. Each kernel tensor block needs to be determined by N indices, denoted as follows: s1,s2,…s N This refers to the segment number to which each order of this block belongs. For ease of analysis, it is assumed that each order of the tensor is divided into B segments. core Segment, then s n The range of values ​​for 1 ≤ n ≤ N is 1 ≤ s. n ≤B core The factor matrix block can be represented as Where n represents the order with which the block will be condensed, and m represents the block number within the entire factor matrix. According to the above labeling rules, the core tensor blocks are condensed using their indices S1, S2, ... S... N This allows us to determine which vector segments need to be shrunk, by iterating through s1, s2, ... s Neach subscript of each core tensor block, the vector segment to be contracted in each order is divided into several segments, for example, S n The corresponding vector segment is

[0096] III. Intra-core parallel computing between core tensor blocks;

[0097] The parallel computing device based on the tensor Tucker decomposition result performs intra-core parallel computing between each core tensor block in the core tensor block set based on the operation rule, to obtain a third calculation result, including:

[0098] determining the identifier corresponding to the second core tensor block and The second core tensor block is any one of the core tensor blocks in the core tensor block set;

[0099] According to the operation rule, the calculation of and is performed to obtain the sub-computation result corresponding to the second core tensor block;

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

[0101] According to the preset rule, the overall shape is divided to obtain a plurality of sub-regions;

[0102] According to the sub-computation result, the target sub-region corresponding to the second core tensor in the plurality of regions is determined;

[0103] The target sub-region is assigned a value to obtain the 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, and involve operations between factor matrices and between core tensors, which are suitable for intra-core parallel computing. Please refer to Figure 5 , Figure 5 The schematic diagram of the block partitioning mode between different core tensors provided by the embodiment of the application, since the calculation between core tensors mainly involves Kronecker product, the block partitioning calculation rule is designed for this operation. An example of block partitioning Kronecker product between three-order tensors is shown in Figure 6 For an N-order core tensor, after block partitioning, each core tensor block needs to be determined by N subscripts, respectively and This is represented by the formula. Throughout the process, since Kronecker products are performed between each core tensor block, and the calculation result is part of the final result, it is necessary to first obtain the overall shape of the final result tensor, and then divide the overall shape according to preset rules to obtain multiple sub-regions. It is then necessary to determine which part of the calculation result is in each sub-region, and after the calculation is completed, the partial result tensor can be directly assigned to the corresponding sub-region.

[0105] That is, according to the core tensor G (X) and G (Y) Shape determination result tensor G (Z) The overall shape, the next step will be G (Z) Perform two-level partitioning, the first-level partitioning method and the core tensor G (X) The second-level partitioning is based on the same method as the first-level partitioning, where each block is partitioned according to... G (Y) The blocks are divided in a specific way. Therefore, G (Z) Each tensor block after being divided can be derived from... G (X) and G (Y) The tensor block is determined, assuming there is G (X) tensor blocks and G (Y) tensor blocks To perform a calculation, it is necessary to determine the result within... G (Z) The position in the middle should first be based on Find the blocks in the first-level partitioning where every level belongs to the first segment, and then in this block, according to... Find the blocks that belong to the second segment in the second order, and the blocks that belong to the first and third orders in the first segment.

[0106] Based on the above rules, the following pattern can be summarized: each calculation result's core tensor block needs to be determined by 2N indices, and the calculation result is represented as follows: The result can be calculated using the following formula:

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

[0108] In summary, it can be seen that, in the embodiment provided by the application, the target tensor data that has been constructed is subjected to tensor Tucker decomposition to obtain a core tensor and factor matrices corresponding to the target tensor data; an operation rule corresponding to the target tensor data is determined; a parallel computing mode of the target tensor data is determined according to the operation rule, and the parallel computing mode includes an inter-core parallel computing mode and an intra-core parallel computing mode; and finally, the core tensor and the factor matrices are subjected to parallel computing based on the parallel computing mode and the operation rule to obtain a computing result. In this way, tensor operation can be directly performed on the basis of the Tucker decomposition result, and the computing result is still in the form of Tucker decomposition, so that it is not necessary to reconstruct the original tensor from the Tucker decomposition result and then perform operation, and meanwhile, the parallel computing mode is adopted when performing operation, which greatly improves the computing efficiency of the Tucker decomposition result.

[0109] The above describes the embodiment of the application from the parallel computing method based on the tensor Tucker decomposition result, and the following describes the embodiment of the application from the parallel computing device based on the tensor Tucker decomposition result.

[0110] Referring to Figure 7 The parallel computing device 700 based on the tensor Tucker decomposition result in the embodiment of the application includes:

[0111] A decomposition module 701 is configured to subject the target tensor data that has been constructed to tensor Tucker decomposition to obtain a core tensor and factor matrices corresponding to the target tensor data.

[0112] A first determination module 702 is configured to determine an operation rule corresponding to the target tensor data.

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

[0114] A computing module 704 is configured to subject the core tensor and the factor matrices to parallel computing 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 configured to:

[0116] determine a vector corresponding to the target tensor data;

[0117] perform block division on the core tensor to obtain a core tensor block set corresponding to the core tensor.

[0118] The vector is blocked to obtain a vector segment set corresponding to the vector, and the core tensor block set and the vector segment set have an association relationship;

[0119] The factor matrix is segmented to obtain a matrix segment set, and the core tensor block set and the matrix segment set have an association relationship;

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

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

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

[0123] 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 the corresponding vector segment of each core tensor block in the core tensor block set in the vector segment set;

[0126] Based on the operation rule, the core tensor block set and the corresponding vector segment are calculated in parallel to obtain the first calculation result.

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

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

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

[0130] According to the identifier And the identifier Determine the corresponding vector segment of each core tensor block in the first core tensor block set in the vector segment set.

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

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

[0133] According to the operation rule, perform the folding operation on each core tensor block in the core tensor block set and 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 one of the core tensor blocks in the core tensor block set;

[0136] According to the operation rule, perform calculation on And To obtain the sub calculation result corresponding to the second core tensor block;

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

[0138] According to the preset rule, divide the overall shape to obtain a plurality of sub regions;

[0139] According to the sub calculation result, determine the target sub region corresponding to the second core tensor in the plurality of regions;

[0140] Value 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] Determine the sub calculation result corresponding to the second core tensor block by the following formula:

[0143]

[0144] Wherein, The sub calculation result corresponding to the second core tensor block.

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

[0146] The input device 801, the output device 802, the processor 803, and the memory 804 (wherein the number of the processor 803 can be one or more, Figure 8 for example, one processor 803) are connected through a communication bus or other means in some embodiments of the application. Figure 8 For example, the communication bus is taken as an example in the embodiments of the application.

[0147] The processor 803 is configured to execute the following steps by calling the operation instructions stored in the memory 804.

[0148] Tensor Tucker decomposition is performed on the target tensor data that has been constructed to obtain a core tensor and factor matrices corresponding to the target tensor data.

[0149] An operation rule corresponding to the target tensor data is determined.

[0150] A parallel computing mode of the target tensor data is determined according to the operation rule, and 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 matrices are parallel computed based on the parallel computing mode and the operation rule to obtain a computing result.

[0152] The processor 803 is further configured to execute any one of the manners in the corresponding embodiments by calling the operation instructions stored in the memory 804. Figure 1

[0153] Please refer to Figure 9 , Figure 9 FIG. 9 is an embodiment schematic diagram of an electronic device provided by the embodiment of the application.

[0154] As shown in Figure 9 FIG. 9, the embodiment of the application provides an electronic device, which includes a memory 910, a processor 920, and a computer program 911 stored in the memory 910 and capable of running on the processor 920. The processor 920 implements the following steps when executing the computer program 911.​

[0155] perform tensor Tucker decomposition on the constructed target tensor data to obtain a core tensor and factor matrices corresponding to the target tensor data;

[0156] determine 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, the parallel computing mode including an inter-core parallel computing mode and an intra-core parallel computing mode;

[0158] perform parallel computation on the core tensor and the factor matrices based on the parallel computing mode and the operation rule to obtain a computation result.

[0159] In the specific implementation process, when the processor 920 executes the computer program 911, the following steps can be implemented Figure 1 any of the embodiments of the corresponding embodiments.

[0160] Since the electronic device introduced in the embodiment is the device used in the implementation of the parallel computing device based on the tensor Tucker decomposition result in the embodiment, the specific implementation of the electronic device and various changes thereof can be understood by those skilled in the art based on the method introduced in the embodiment, and therefore, how the electronic device implements the method in the embodiment will not be introduced in detail, as long as the device used by those skilled in the art to implement the method in the embodiment belongs to the scope of the present application.

[0161] Please refer to Figure 10 , Figure 10 an embodiment of a computer readable storage medium provided in the embodiment.

[0162] As Figure 10 shown, the embodiment further provides a computer readable storage medium 1000, which stores a computer program 1011, and the computer program 1011 is executed by a processor to implement the following steps:

[0163] perform tensor Tucker decomposition on the constructed target tensor data to obtain a core tensor and factor matrices corresponding to the target tensor data;

[0164] determine 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, the parallel computing mode including 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 a specific implementation process, the computer program 1011 is executed by a processor to implement Figure 1 any of the embodiments of the corresponding embodiments.

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

[0169] The embodiment of the application further provides a computer program product, which comprises computer software instructions, and when the computer software instructions run on a processing device, the processing device executes the flow in the corresponding embodiment. Figure 1 The computer program product comprises one or more computer instructions.

[0170] The computer program product comprises one or more computer instructions.

[0171] Those skilled in the art can clearly understand that, for the convenience and brevity of the description, the specific working process of the system, device and unit described above can refer to the corresponding process in the foregoing method embodiments, which will not be described here.

[0172] The above-described embodiments are only used to illustrate the technical solutions of the present application, rather than limit them; although the present application has been described in detail with reference to the foregoing embodiments, those skilled in the art should understand that they can still modify the technical solutions recorded in the foregoing embodiments, or make equivalent replacements to some technical features; and these modifications or replacements do not make the essence of the corresponding technical solutions deviate from the spirit and scope of the technical solutions of the embodiments of the present application.

Claims

1. A parallel computing method based on tensor Tucker decomposition results, characterized in that, The method includes: Tensor Tucker decomposition is performed on the constructed target tensor data to obtain the core tensor and factor matrix corresponding to the target tensor data. The decomposed tensor core and factor matrix are stored in a distributed manner. Determine the computation rules corresponding to the target tensor data; The parallel computing mode of the target tensor data is determined according to the operation rules, and the parallel computing mode includes inter-core parallel computing mode and intra-core parallel computing mode. The core tensor and the factor matrix are computed in parallel based on the parallel computing mode and the operation rules to obtain the calculation results; When the parallel computing mode is an in-core parallel computing mode, the parallel computing of the core tensor and the factor matrix based on the parallel computing mode and the operation rules to obtain the calculation result includes: Determine the vector corresponding to the target tensor data; The core tensor is divided into blocks to obtain the core tensor block set corresponding to the core tensor; The vector is divided into blocks to obtain a set of vector segments corresponding to the vector, and there is a correlation between the core tensor block set and the set of vector segments; The factor matrix is ​​segmented to obtain a set of matrix segments, and there is an association between the core tensor block set and the set of matrix segments; In a parallel system, the master node groups blocks with corresponding computational relationships into different groups and assigns them to different slave nodes. The slave nodes only need to receive the blocks assigned by the master node, perform computation, 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.

2. The method according to claim 1, characterized in that, When the parallel computing mode is an in-core parallel computing mode, the step of performing parallel computing on the core tensor and the factor matrix based on the parallel computing mode and the operation rules to obtain the calculation result further includes: Based on the aforementioned computation rules, the core tensor block set and the vector segment set are subjected to in-kernel parallel computation to obtain a first computation result; Based on the aforementioned operational rules, the core tensor block set and the matrix segment set are subjected to in-kernel parallel computation to obtain a second computation result. Based on the aforementioned computational rules, intra-kernel parallel computation is performed on each core tensor block in the core tensor block set to obtain a third computational result. Wherein, 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 first calculation result obtained by performing intra-kernel parallel computation on the core tensor block set and the vector segment set based on the aforementioned computation rules includes: Determine the vector segment corresponding to each core tensor block in the core tensor block set in the vector segment set; Based on the aforementioned operational rules, each core tensor block in the core tensor block set is shrunk and merged with its corresponding vector segment to obtain the first calculation result.

4. The method according to claim 3, characterized in that, The step of determining the vector segment corresponding to each core tensor block in the core tensor block set in the vector segment set includes: Determine the identifier corresponding to the first core tensor block. The first core tensor block is any one of the core tensor blocks in the set of core tensor blocks, s1, s2, ... s N The N represents the segment number to which each order belongs in the target vector, where N is the order of the core tensor, 1 ≤ s. N ≤B core B core This represents the number of segments in each order of the first core tensor block; Determine the identifier corresponding to the target vector segment Wherein, the target vector segment is any one of the vector segments in the set of vector segments, n is the order of the condensation 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 identifier and the identifier Determine the 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 second calculation result obtained by performing intra-kernel parallel computation on the core tensor block set and the matrix segment set based on the aforementioned computation rules includes: Determine the matrix segment corresponding to each core tensor block in the core tensor block set in the matrix segment set; Based on the aforementioned operational rules, each core tensor block in the core tensor block set is shrunk and merged with its corresponding matrix segment to obtain the second calculation result.

6. The method according to claim 3, characterized in that, The third calculation result obtained by performing intra-kernel parallel computation on each core tensor block in the core tensor block set based on the aforementioned computation rules includes: Determine the identifier corresponding to the second core tensor block. and The second core tensor block is any one of the core tensor blocks in the set of core tensor blocks; According to the aforementioned calculation rules and Perform calculations to obtain the sub-calculation results corresponding to the second core tensor block; Obtain the overall shape of the final result tensor; The overall shape is divided into multiple sub-regions according to preset rules; Based on the sub-calculation results, the target sub-regions corresponding to the second core tensor in the plurality of regions are determined; The target sub-region is assigned a value to obtain the third calculation result.

7. The method according to claim 6, characterized in that, The operation is performed according to the aforementioned rules. and The calculations yielded the following sub-computation results corresponding to the second core tensor block: The sub-computation result corresponding to the second core tensor block is determined by the following formula: in, This is the sub-computation result corresponding to the second core tensor block.

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

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

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