A parallel tensor filling method based on GPU

Through the GPU-based parallel tensor filling method, the problems of incomplete and unbalanced data in the prior art are solved, and efficient and accurate data filling and processing are achieved.

CN119356883BActive Publication Date: 2025-03-18HUNAN UNIV OF SCI & TECH
View PDF 4 Cites 0 Cited by

Patent Information

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

AI Technical Summary

Technical Problem

The prior art can easily lead to incomplete and unbalanced data during tensor filling, resulting in low computational efficiency and poor filling accuracy.

Method used

The parallel tensor filling method based on GPU is adopted, and the process of tensor division and parallel tensor filling is optimized to improve data processing efficiency and accuracy through steps such as initial matrix generation, tensor division accuracy determination, sub-tensor parallel processing and parallel tensor filling.

Benefits of technology

It significantly improves the efficiency and filling accuracy of data processing, enhances the accuracy and completeness of data, and improves the computing efficiency and resource utilization of GPUs.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119356883B_ABST
    Figure CN119356883B_ABST
Patent Text Reader

Abstract

The present invention relates to the technical field of electronic digital data processing, and specifically discloses a parallel tensor filling method based on a GPU. The method comprises: initial matrix generation, tensor division accuracy determination, sub-tensor parallel processing and parallel tensor filling, wherein the initial matrix is ​​generated according to a matrix method, sub-tensors are obtained by a preset tensor division method based on the data amount of a data set to be filled, and the division accuracy is verified to optimize the division method; sub-tensor binary coordinates are obtained by a predefined coordinate positioning method, a parallel sub-tensor sequence is obtained by combining a parallel tensor search method, and the sub-tensor sequence is transmitted to a GPU memory space for parallel processing, the GPU parallel processing performance is evaluated, the weight of each sub-tensor sequence is obtained by parallel processing, the initial matrix is ​​updated to an update matrix, and finally the missing data is filled in a predefined method, the parallel tensor filling of the data is completed, and the accuracy and integrity of the data are improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the technical field of electronic digital data processing, and in particular to a parallel tensor filling method based on a GPU. Background Art

[0002] Tensors are widely used in traffic forecasting, big data analysis and prediction, signal processing, computer vision and other fields because of their inherent characteristics of being able to express more complex high-dimensional data. In these fields, some data is missing due to factors such as high acquisition overhead, sensor failure, data transmission errors and environmental interference. This data loss not only reduces the accuracy of data analysis, but also increases the complexity of subsequent processing. Therefore, how to quickly and accurately fill these missing data has become a key issue that needs to be solved urgently. Tensor filling can effectively capture the relationship between high-order data, use the existing partial data to infer and restore the original complete tensor, and improve the filling accuracy while maintaining the integrity of the data structure. Therefore, it has become a key technology in the field of data recovery.

[0003] For example, the invention patent with announcement number CN110046116B announces a tensor filling method, device, equipment and storage medium, wherein the method includes: obtaining the first tensor data to be filled and the filling configuration information and filling numerical information of the first tensor data, the dimension of the first tensor data is less than or equal to the preset number of dimensions; according to the first tensor data and the dimension of the first tensor data, obtaining the second tensor data of the preset number of dimensions; filling the second tensor data according to the filling configuration information, the filling numerical information, and the tensor filling rule.

[0004] For example, the invention patent with announcement number CN108804392B announces a method for filling traffic data tensors based on spatiotemporal constraints, which obtains incomplete traffic data and establishes a traffic flow data tensor; establishes a tensor filling model based on factor decomposition; constructs a spatiotemporal constraint tensor by analyzing the spatiotemporal characteristics of the data, and optimizes the tensor filling model based on factor decomposition; performs tensor filling with spatiotemporal constraints to restore the original traffic data.

[0005] In combination with the above technical solutions, it is found that there is a tensor filling technical solution. Directly obtaining data for filling processing may cause the obtained data to be incomplete and unbalanced, so that when performing tensor filling operations on the data, the calculation efficiency of the data is low and the filling accuracy is poor, which ultimately affects the use of the data. Summary of the invention

[0006] In view of the deficiencies in the prior art, the present invention provides a GPU-based parallel tensor filling method, which can effectively solve the problems involved in the above-mentioned background technology.

[0007] To achieve the above objectives, the present invention is implemented through the following technical solutions: a GPU-based parallel tensor filling method, including: initial matrix generation: obtaining feature information of the data set to be filled, and establishing a matrix method according to preset data features to generate each initial matrix of the data set to be filled; tensor division accuracy determination: obtaining the data amount of the data set to be filled, and obtaining each sub-tensor of the data set to be filled through a preset tensor division method, determining the division accuracy of each sub-tensor of the data set to be filled, and verifying it with a predefined division reference accuracy to determine whether to optimize the tensor division method; sub-tensor parallel processing: according to each sub-tensor of the data set to be filled, obtaining the binary coordinates of each sub-tensor of the data set to be filled according to a predefined coordinate positioning method The preset parallel tensor search method is integrated to obtain the parallel sub-tensor sequences of the data set to be filled, and the sequences are transmitted to the GPU memory space for parallel processing, and the parallel processing performance evaluation value of the GPU memory space is determined, and the parallel processing performance evaluation value is verified with the predefined parallel processing performance evaluation threshold to determine whether to update the parallel processing algorithm of the GPU memory space; Parallel tensor filling: through the process of parallel processing in the GPU memory space, the corresponding weights of each parallel sub-tensor sequence are obtained, and according to the corresponding weights of each parallel sub-tensor sequence, the initial matrices of the data set to be filled are updated, marked as the updated matrices of the data set to be filled, and finally the missing data in the data set to be filled is filled according to the predefined data filling method, so as to complete the parallel tensor filling of the data.

[0008] As a further method, the division accuracy of each sub-tensor of the data set to be filled is determined, and the specific determination process is: obtaining each data, the maximum value of the data, and the minimum value of the data of each sub-tensor of the data set to be filled; performing variance processing on each data of each sub-tensor of the data set to be filled, and obtaining the data discreteness value of each sub-tensor of the data set to be filled; performing difference processing on the maximum value of the data of each sub-tensor of the data set to be filled and the minimum value of the data of each sub-tensor of the data set to be filled, and obtaining the data range of each sub-tensor of the data set to be filled; obtaining the division time of each sub-tensor of the data set to be filled, and performing variance processing, and the obtained result is recorded as the division deviation influence coefficient of the data set to be filled; obtaining GP The network transmission data of U during the data partitioning process, specifically including the network bandwidth of the GPU in the data partitioning cycle, the network delay duration of the GPU in each data partitioning period, the maximum data packet loss rate of the GPU in the data partitioning cycle, and the number of transmission freezes of the GPU in the data partitioning cycle, are comprehensively analyzed to obtain the network transmission performance index of the GPU in the data partitioning cycle; the data discreteness value of each sub-tensor of the data set to be filled, the data extreme value of each sub-tensor of the data set to be filled, the network transmission performance index of the GPU in the data partitioning cycle, and the partition deviation influence coefficient of the data set to be filled are comprehensively analyzed to obtain the partition accuracy of each sub-tensor of the data set to be filled.

[0009] As a further method, the binary coordinates of each sub-tensor of the data set to be filled are obtained according to a predefined coordinate positioning method. Specifically, the hash coordinates of each sub-tensor are established according to the balance index of the hash algorithm, so as to obtain the binary coordinates of each sub-tensor of the data set to be filled.

[0010] As a further method, the parallel tensor search method specifically establishes a parallel binary tree based on the binary coordinates of each sub-tensor of the data set to be filled, thereby searching for the parallel sub-tensors corresponding to each sub-tensor of the data set to be filled through the parallel binary tree, and recording them as the sequence of each parallel sub-tensor of the data set to be filled.

[0011] As a further method, the parallel processing performance evaluation value of the GPU memory space is determined, and the specific determination process is: obtaining the performance data of the GPU memory space during the parallel processing process, specifically including the total amount of data processing of the GPU memory space in the parallel processing cycle, the memory access delay duration, and the maximum memory occupancy; performing ratio processing on the total amount of data processing of the GPU memory space in the parallel processing cycle and the corresponding duration of the parallel processing cycle to obtain the data processing rate of the GPU memory space in the parallel processing cycle; obtaining the amount of data of each sub-tensor of the data set to be filled; obtaining the memory access delay limit duration and the data processing reference rate from the tensor filling management library; performing a comprehensive analysis on the total amount of data processing of the GPU memory space in the parallel processing cycle, the amount of data of each sub-tensor of the data set to be filled, the data processing rate of the GPU memory space in the parallel processing cycle, the memory access delay duration of the GPU memory space in the parallel processing cycle, and the maximum memory occupancy of the GPU memory space in the parallel processing cycle to obtain the parallel processing performance evaluation value of the GPU memory space, and the specific method is as follows:

[0012] ;

[0013] In the formula, is the parallel processing performance evaluation value of GPU memory space, is the amount of data that needs to be filled in the zth sub-tensor of the dataset, where z is the number of each sub-tensor. , T is the total amount of sub-tensors, is the total amount of data processed by the GPU memory space during the parallel processing cycle, is the data processing rate of the GPU memory space in the parallel processing cycle, is the data processing reference rate, is the maximum memory usage of GPU memory space during the parallel processing cycle, max represents the maximum value, is the memory access latency of the GPU memory space during the parallel processing cycle, Defines the duration of memory access latency, Fill in the tensor management library with the predefined data processing deviation values ​​corresponding to the processing performance influencing parameters, Fill in the tensor management library with the predefined data processing rate deviation value corresponding to the processing performance influencing parameter, It is the processing performance influencing parameter corresponding to the maximum memory usage predefined in the tensor filling management library, and e is a natural constant.

[0014] As a further method, the corresponding weights of each parallel sub-tensor sequence are specifically obtained based on the operation results of the GPU memory space block and combined with the conflict scheduling strategy to obtain the corresponding weights of each parallel sub-tensor sequence.

[0015] As a further method, the updating of each initial matrix of the data set to be filled is specifically based on a stochastic gradient descent algorithm, and the corresponding weights of each parallel sub-tensor sequence are comprehensively considered to update each initial matrix of the data set to be filled.

[0016] As a further method, the missing data in the data set to be filled is filled according to a predefined data filling method, specifically, the process of parallel processing of the GPU memory space is iterated until the parallel processing result reaches a convergence state, and the missing data in the data set to be filled is filled in this data filling method.

[0017] Compared with the prior art, the embodiments of the present invention have at least the following advantages or beneficial effects:

[0018] (1) The present invention provides a parallel tensor filling method based on a GPU. First, the characteristics of a data set are obtained, an initial matrix is ​​generated according to a matrix method, and based on the amount of data in the data set to be filled, a sub-tensor is obtained by a preset tensor division method, and the division accuracy is verified to optimize the division method; the binary coordinates of the sub-tensor are obtained by a predefined coordinate positioning method, and a parallel sub-tensor sequence is obtained by combining a parallel tensor search method, which is transmitted to the GPU memory space for parallel processing, the GPU parallel processing performance is evaluated, and the processing algorithm is updated when necessary. By processing multiple data sub-tensors in parallel, the efficiency of data processing can be significantly improved, and the weights of each sub-tensor sequence are obtained by parallel processing, and the initial matrix is ​​updated to an update matrix. Finally, the missing data is filled in according to a predefined method, and the parallel tensor filling of the data is completed, thereby improving the accuracy and integrity of the data;

[0019] (2) The present invention improves the network transmission performance index of the GPU during the data partitioning cycle, which means that the GPU can receive and process data from other devices or networks more quickly, which helps to reduce delays and bottlenecks in the data transmission process and enables the GPU to use computing resources more efficiently. As the network transmission performance improves, the amount of data that the GPU can process per unit time also increases accordingly, which helps to improve the data processing throughput, allowing the GPU device to complete the processing task of large-scale data sets more quickly, thereby improving the partition accuracy of each sub-tensor of the data set to be filled;

[0020] (3) The present invention determines the parallel processing performance evaluation value of the GPU memory space to understand the performance of the GPU memory space during parallel processing. Different parallel processing tasks may be suitable for different parallel strategies. By determining the relationship between the parallel processing performance evaluation value and the parallel processing performance evaluation threshold, the algorithm is adjusted to better utilize the GPU global memory for large-scale data parallel processing, thereby improving the overall computing efficiency.

[0021] (4) The present invention designs a new dynamic hashing dimension method to make the data volume between the divided sub-tensors as balanced as possible, thereby reducing the waiting time for calculation, thereby avoiding the calculation waiting time caused by the excessive data volume of some sub-tensors. This helps to improve the computing efficiency of the GPU, enabling the device to complete tasks faster, and proposes a conflict-based scheduling strategy to maximize parallel efficiency without reducing accuracy. By reasonably scheduling computing tasks, it can ensure that the various computing units of the GPU maintain efficient collaboration during the parallel computing process, thereby improving the overall computing performance. BRIEF DESCRIPTION OF THE DRAWINGS

[0022] The present invention is further described with the aid of the accompanying drawings, but the embodiments in the accompanying drawings do not constitute any limitation to the present invention. A person skilled in the art can obtain other accompanying drawings based on the following accompanying drawings without creative work.

[0023] Figure 1 It is a schematic diagram of the method flow of the present invention;

[0024] Figure 2 Schematic diagram of tensor partitioning;

[0025] Figure 3 To establish a parallel binary tree diagram;

[0026] Figure 4 To find the schematic diagram of parallel subtensors;

[0027] Figure 5 Schematic diagram of weight-based update strategy;

[0028] Figure 6This is a schematic diagram of the effectiveness of the balanced data volume partitioning method;

[0029] Figure 7 This is a schematic diagram of the convergence speed of the BTC-GPU algorithm;

[0030] Figure 8 Schematic diagram of data recovery accuracy at different sampling rates. DETAILED DESCRIPTION

[0031] The technical solutions in the embodiments of the present invention will be clearly and completely described below in conjunction with the drawings in the embodiments of the present invention. Obviously, the described embodiments are only part of the embodiments of the present invention, rather than all the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without making creative work are within the scope of protection of the present invention.

[0032] In a specific embodiment, tensor filling is to estimate the unobserved elements using the factor matrix obtained by CANDECOMP / PARAFAC (CP) decomposition. CP decomposition represents a tensor as the sum of a finite number of first-order tensors. If a third-order tensor is to be decomposed by CP, for any third-order tensor , if the rank of CP decomposition is R: , where r is the rank of CP decomposition, , R is the total rank of CP decomposition, then any element It can be expressed as (2), where , , is the factor matrix of CP decomposition, Represented as the index of a third-order tensor in three dimensions, the value range of x is 1 to X, the value range of y is 1 to Y, and the value range of z is 1 to Z. , , is any element of the factor matrix, Represented as the row index of factor matrices A, B, and C, i corresponds to the row index in matrix A ( ), j corresponds to the row index in the B matrix ( ), k corresponds to the row index in the C matrix ( ), in tensor filling, the factor matrix obtained by CP decomposition is used to estimate the unobserved elements.

[0033] After the tensor is decomposed by CP according to formula (2), the tensor filling problem is defined as:

[0034] ;

[0035] Where X, Y, Z are factor matrices, is a third-order tensor The index set of data, is the regularization parameter, F is the norm, and the factor matrix A, B, C is found by this formula to minimize the loss Solving for approximate tensors .

[0036] The original tensor is fitted by the A, B, and C factor matrices, so the SGD (stochastic gradient descent) algorithm is used to minimize the error between the original tensor and the decomposition result to solve the factor matrix. (where I, J, and K represent the size of the tensor in three dimensions. Specifically, I is the number of elements in the first dimension, J is the number of elements in the second dimension, and K is the number of elements in the third dimension. Here, i ranges from 1 to I, j ranges from 1 to J, and k ranges from 1 to K.) Randomly select an observation Its approximate value Calculation error , using the learning rate and the regularization parameter Update the factor matrix:

[0037] ;

[0038] ;

[0039] ;

[0040] When updating the factor matrix, each iteration only updates one row in the factor matrix A, B, C, for example, calculating a random value in the tensor When the factor matrix A updates the xth row (i.e. ), the factor matrix B updates the y-th row (i.e. ), the factor matrix C updates the zth row (i.e. ), since the update of the factor matrix is ​​essentially executed sequentially, when extended to parallel execution on the GPU, if the calculated data coordinates conflict, it is very likely that multiple threads will update the same row of the factor matrix, such as parallel calculation and When the data coordinates conflict, the two threads will update the zth row of the factor matrix C at the same time. The conflict between threads will reduce the accuracy of data recovery. Therefore, when performing parallel computing, we need to find data with non-overlapping coordinates to avoid conflicts between threads. To avoid conflicts, the tensor is usually divided into sub-tensors of equal size, and the diagonal sub-tensors are taken and put into the block for calculation. In this way, the coordinates of the data X, Y, and Z dimensions will not overlap, and there will be no conflicts when the factor matrix is ​​updated.

[0041] After obtaining the three factor update matrices U, V, and W, the original tensor is restored by the following method:

[0042] ;

[0043] The above is the main process of tensor filling. Although tensor filling can characterize the high-dimensional characteristics of data and make the filling accuracy high, the complexity and time of calculation increase significantly with the size of the tensor due to the increase in dimension, which makes it difficult for high-dimensional and large tensors to meet the timeliness requirements. In order to further accelerate the calculation of tensor filling, parallel tensor filling methods have been proposed and become an effective solution. These methods significantly reduce the overall calculation time by decomposing the calculation task into multiple small tasks for parallel processing, and GPU (graphics processing unit) can adapt well to the needs of parallel tensor filling with its highly parallel computing architecture.

[0044] The calculation in GPU architecture is divided into three levels: grid, block and thread. All threads started at runtime are called a grid. The grid can be divided into many blocks. Each block contains the same number of threads, and the thread is the smallest calculation unit. When using GPU to accelerate tensor filling, the tensor needs to be divided into sub-tensors of equal size, and then distributed to the GPU block, and then calculated in parallel by the block.

[0045] Reference Figure 1 As shown, the present invention provides a parallel tensor filling method based on GPU, including: initial matrix generation: obtaining feature information of the data set to be filled, and establishing a matrix method according to preset data features to generate each initial matrix of the data set to be filled.

[0046] The above-mentioned data sets that need to be filled come from the fields of traffic prediction, big data analysis and prediction, signal processing, and computer vision. In these fields, due to various factors such as high acquisition overhead, sensor failure, data transmission errors, and environmental interference, some data are missing, thus forming data sets that need to be filled. For example, in traffic data collection, sensors may not be able to accurately obtain traffic flow data for certain time periods or sections due to failures or bad weather. These data sets with missing values ​​are data sets that need to be filled.

[0047] In this embodiment, the GPU has powerful parallel computing capabilities and can process multiple data points and complex computing tasks at the same time. In the process of data filling, the GPU can significantly accelerate the data processing speed, including data cleaning, missing value detection, filling algorithm application and other steps, which helps to quickly generate a complete data set and provide timely and accurate data support for subsequent analysis and prediction by data collection personnel. For the data set to be filled in this embodiment, various filling algorithms (such as mean filling, interpolation, regression method, machine learning method, etc.) require efficient computing power to support. The parallel computing architecture of the GPU enables these algorithms to complete calculations in a shorter time while maintaining high accuracy. This helps to ensure that the filled data set can truly reflect the characteristics and trends of the original data.

[0048] The dataset is modeled as a third-order tensor to accommodate its complex internal structure and data relationships. The third-order tensor can be expressed as (in Represents the indexes on three dimensions respectively), this structure can better describe the relationship between multiple variables. For example, in traffic flow prediction, one dimension may represent different monitoring sites, one dimension represents different time points, and another dimension represents different types of traffic data, such as traffic flow, speed, etc. By organizing the data into a third-order tensor, the spatiotemporal characteristics and multivariate relationships of traffic data can be analyzed more comprehensively.

[0049] In this embodiment, the data is modeled as a third-order tensor , and I=144, J=168, K=288, to generate the three initial factor matrices to fill the data set, , , .

[0050] Tensor partition accuracy determination: obtain the amount of data of the data set to be filled, and obtain the sub-tensors of the data set to be filled through the preset tensor partitioning method, determine the partition accuracy of each sub-tensor of the data set to be filled, and verify it with the predefined partition reference accuracy to determine whether to optimize the tensor partitioning method.

[0051] The above-mentioned preset tensor division method specifically divides the tensor according to the data volume on the host, and the balanced data volume division tensor is divided into the following three steps: 1) Generate a binary representation of the data coordinates through a hash function and map it to the corresponding sub-tensor; 2) If the data entry in a sub-tensor exceeds the preset upper limit, the sub-tensor is dynamically divided; 3) In this embodiment, it is defined to divide in the order of X-axis, Y-axis, and Z-axis to ensure that the division process is carried out in an orderly manner, as shown in the following specific steps: Figure 2 As shown, Figure 2 This is a schematic diagram of tensor partitioning. Assuming that the upper limit of a single sub-tensor processing is 4, a 144*168*244 tensor model is established. Now there are 16 data from P0 to P15 to be partitioned, where G records the global maximum Level value, and level is abbreviated as L.

[0052] As the data is read sequentially, the three coordinate dimensions of the data are mapped to binary through a hash function, and the sub-tensors of each dimension are established according to the balanced index method. At the beginning, the binary index of tensor B0 is , each dimension axis records a level, denoted as , , , and both are 1. As P4 is read in, B0 exceeds the processing limit. At this time, B0 is divided into two sub-tensors in the X-axis dimension, namely B0 and B1 , and the two sub-tensors becomes 2. Re-hash the x-axis coordinates of the data from P0 to P4, and the level in eq7 is now , end is the maximum value of the x dimension, 144, start is 0, and x is the X coordinate of the data. After obtaining the new binary representation of the data, it is matched with the sub-tensor index. Later, with the addition of P5, the sub-tensor B0 exceeds the processing limit. At this time, B0 is divided into two according to the Y-axis dimension, divided into B0 and Two sub-tensors, B0 and B2 Equal to 2. Re-hash the data in B0, and the level value in the hash function is , end is 168, start is 0, and x is the y coordinate of the data. Then remap the data to the sub-tensor.

[0053] It is worth noting that since the B1 subtensor The y-axis is only divided once, but in order to better represent the global Y-axis division, * will be added to make it reach the global level. When P6 is read in, the data of the B0 sub-tensor exceeds the processing limit. At this time, B0 is divided into two according to the Z-axis dimension, divided into B0 and B3 Two sub-tensors, B0 and B3 becomes 3, and the data is remapped according to the hash value. At this time, the level value in the hash function is , end is 288, start is 0, and x is the z coordinate of the data. B1 and B2 The Z axis of the sub-tensor is only divided once, so it is supplemented with *. Then it is divided according to the above method, and finally 7 sub-tensors of different sizes from B0 to B6 and the corresponding binary indexes are obtained.

[0054] If a sub-tensor has not been divided before, or only part of the axis dimensions have been divided, it is necessary to find the next dimension to divide. Since the level is set for each dimension of the sub-tensor in this embodiment, it is only necessary to simply compare the number of levels of each dimension to compare the direction of the next division. Figure 2 In the figure, after comparing the binary levels of B1 at time t4, it is found that the X-axis level is 2 and the levels of other dimensions are 1, which means that the B1 sub-tensor is only divided along the x-axis dimension. So next time at time t5, when the amount of data in the B1 sub-tensor exceeds the processing limit, it will be divided along the y-axis dimension.

[0055] Specifically, the determination of the division accuracy of each sub-tensor of the data set to be filled is carried out as follows:

[0056] Get the data, maximum value, and minimum value of each sub-tensor of the dataset to be filled.

[0057] The data required to fill in the data set, such as traffic flow data, can be obtained through the traffic management platform.

[0058] The variance processing is performed on each data of each sub-tensor of the data set to be filled, so as to obtain the data discreteness value of each sub-tensor of the data set to be filled.

[0059] The maximum value of each sub-tensor of the data set to be filled is subtracted from the minimum value of each sub-tensor of the data set to be filled, and the data range of each sub-tensor of the data set to be filled is obtained.

[0060] The partitioning duration of each sub-tensor of the data set to be filled is obtained, and variance processing is performed. The obtained result is recorded as the partition deviation influence coefficient of the data set to be filled.

[0061] The above-mentioned divided durations can be extracted from the GPU operation report.

[0062] The network transmission data of the GPU during the data partitioning process is obtained, including the network bandwidth of the GPU during the data partitioning cycle, the network delay duration of the GPU in each data partitioning period, the maximum data packet loss rate of the GPU during the data partitioning cycle, and the number of transmission freezes of the GPU during the data partitioning cycle. Comprehensive analysis is performed to obtain the network transmission performance indicators of the GPU during the data partitioning cycle.

[0063] The above-mentioned data partitioning cycle specifically refers to the duration used by the GPU to partition the data set to be filled into sub-tensors. It is the period from when the GPU receives the tensor partitioning instruction to when the partitioning result is given. The data partitioning time period specifically refers to a number of data partitioning time periods that divide the data partitioning cycle into time periods, where the division method can be 1 minute.

[0064] The above network transmission data can be extracted from the GPU operation report.

[0065] Based on the network bandwidth of the GPU in the data partitioning cycle, the network delay duration of the GPU in each data partitioning period, the maximum data packet loss rate of the GPU in the data partitioning cycle, and the number of transmission freezes of the GPU in the data partitioning cycle, a comprehensive analysis is performed to obtain the network transmission performance index of the GPU in the data partitioning cycle. The specific analysis method is as follows:

[0066] ;

[0067] In the formula, It is the network transmission performance index of GPU in the data partitioning cycle. is the network bandwidth of the GPU during the data partitioning period, Adapt bandwidth to predefined networks in the tensor fill management library, is the network delay duration of the GPU in the dth data partition period, d is the number of each data partition period, , D is the total amount of data divided into time periods, is the maximum packet loss rate of the GPU during the data partitioning period. The number of transmission stalls of the GPU during the data partitioning cycle. The network transmission impact factor corresponding to the average network delay duration predefined in the tensor filling management library, The network transmission impact factor corresponding to the maximum value of the data packet loss rate predefined in the tensor filling management library, It is the network transmission impact factor corresponding to the number of transmission jams predefined in the tensor filling management library, and e is a natural constant.

[0068] In this embodiment, the network transmission performance index of the GPU during the data partitioning cycle is used to measure the efficiency and ability of the GPU's own network to transmit data during the data partitioning process. The higher the GPU's network transmission performance, the better the transmission performance of the GPU when partitioning the data set to be filled, thereby reducing the negative impact of data errors and other negative effects caused by the GPU's network transmission problems, and the sub-tensors obtained are more accurate.

[0069] It needs to be explained that the above-mentioned network bandwidth refers to the amount of data that the GPU network can transmit within the data partitioning cycle, usually expressed in bits per second (bps), which reflects the ability of the GPU network to transmit data; the network adaptation bandwidth refers to the reference value corresponding to the pre-set network bandwidth; the network delay time refers to the time from the host to which the GPU belongs sending a data request or data packet to the time the processor to which the GPU belongs receives the request or data packet; the maximum data packet loss rate refers to the maximum allowed packet loss ratio during the GPU network communication process within the data partitioning cycle; the number of transmission freezes refers to the frequency of freezes in the GPU data transmission process within the data partitioning cycle. The freeze phenomenon usually refers to a brief stagnation in data transmission, which makes it impossible for data to be smoothly transmitted from one node to another.

[0070] The network transmission impact factor corresponding to the above-mentioned average network delay duration, the network transmission impact factor corresponding to the maximum data packet loss rate, and the network transmission impact factor corresponding to the number of transmission freezes are all extracted from the tensor filling management library. For example, the average network delay duration and the network transmission impact factor corresponding to the average network delay duration preset in the tensor filling management library form a mapping set, and the real-time average network delay duration is brought into the mapping set to obtain the network transmission impact factor corresponding to the average network delay duration, wherein the mapping relationship may be a one-to-one correspondence or a many-to-one relationship; the maximum data packet loss rate and the network transmission impact factor corresponding to the maximum data packet loss rate preset in the tensor filling management library form a mapping set, and the real-time average network delay duration is brought into the mapping set to obtain the network transmission impact factor corresponding to the average network delay duration. The maximum value of the data packet loss rate at that time is brought into the mapping set to obtain the network transmission impact factor corresponding to the maximum value of the data packet loss rate, where the mapping relationship can be a one-to-one correspondence or a many-to-one relationship; the number of transmission jams and the network transmission impact factor corresponding to the number of transmission jams preset in the tensor filling management library form a mapping set, and the real-time number of transmission jams is brought into the mapping set to obtain the network transmission impact factor corresponding to the number of transmission jams, where the mapping relationship can be a one-to-one correspondence or a many-to-one relationship. In this embodiment, the value ranges of the network transmission impact factor corresponding to the average network delay duration, the network transmission impact factor corresponding to the maximum value of the data packet loss rate, and the network transmission impact factor corresponding to the number of transmission jams are all (0, 1).

[0071] In this embodiment, the increase in network bandwidth helps to reduce network delay, because higher bandwidth allows data to be transmitted at a faster speed, and higher network bandwidth can provide more transmission channels and reduce data packet loss; however, when the network bandwidth is too high, it may lead to excess performance of the GPU network device, resulting in a waste of resources, and if the data transmission traffic is not managed properly, it may cause network congestion, affecting the smoothness of data transmission and the stability of GPU operation; at the same time, when the network bandwidth is insufficient, data packets may be lost due to untimely GPU network transmission, resulting in an increase in packet loss rate, and lower bandwidth may cause data transmission speed to decrease, thereby increasing the number of transmission jams; longer delays will directly affect the smoothness of data transmission, resulting in jams, and the longer the delay, the longer the data packet takes to be transmitted in the network, making it more susceptible to factors such as network instability and congestion, resulting in data packet loss; in summary, the network bandwidth, network delay duration, data packet loss rate and number of transmission jams of the GPU are interrelated, and jointly affect the network transmission performance indicators of the GPU during the data partitioning cycle, so as to affect the accuracy of the GPU's partitioning of each sub-tensor of the data set to be filled.

[0072] The data discreteness value of each sub-tensor of the data set to be filled, the data range of each sub-tensor of the data set to be filled, the network transmission performance index of the GPU during the data partitioning cycle, and the partition deviation influence coefficient of the data set to be filled are comprehensively analyzed to obtain the partition accuracy of each sub-tensor of the data set to be filled. The specific method is as follows:

[0073] ;

[0074] In the formula, is the partition accuracy of the zth sub-tensor of the dataset to be filled, where z is the number of each sub-tensor. , T is the total amount of sub-tensors, is the data discreteness value of the z-th sub-tensor of the dataset to be filled. is the data range of the z-th sub-tensor of the dataset to be filled, is the partition deviation influence coefficient of the data set to be filled, is the network transmission performance index of the GPU during the parallel processing cycle. Fill in the tensor management library with the accurate weight parameters corresponding to the data discreteness values ​​predefined in the partition. Fill in the tensor with the accurate weight parameters corresponding to the predefined data range in the management library. The accurate weight parameters of the partition corresponding to the partition deviation influence coefficient predefined in the tensor filling management library, It is the accurate weight parameter corresponding to the predefined network transmission performance index in the tensor filling management library, and e is a natural constant.

[0075] The network transmission performance index of the above-mentioned GPU in the parallel processing cycle is obtained by comprehensive analysis of the network bandwidth of the GPU in the data partitioning cycle, the network delay duration of the GPU in each data partitioning period, the maximum data packet loss rate of the GPU in the data partitioning cycle, and the number of transmission freezes of the GPU in the data partitioning cycle.

[0076] In this embodiment, the division accuracy of each sub-tensor of the data set to be filled is a key indicator used to measure the effect of tensor division. It is of great significance for optimizing parallel computing efficiency, ensuring data recovery accuracy, and evaluating the effectiveness of the entire parallel tensor filling method. It reflects the comprehensive performance of sub-tensor division in data volume balance, computing load balancing, adaptation to computing resources, and data processing integrity.

[0077] It needs to be explained that the above-mentioned data dispersion value is a statistic used to measure the degree of data dispersion. The smaller the variance, the more concentrated the data is near the mean, that is, the more balanced the data volume between sub-tensors is; the data range refers to the difference between the maximum and minimum values ​​in a set of sub-tensor data. The smaller the range, the smaller the fluctuation range of the sub-tensor data volume, that is, the more stable the data volume, reflecting the more accurate tensor division; the division deviation influence coefficient refers to the discrete relationship between the division durations of different sub-tensors. The closer the division durations are, the smaller the division deviation influence coefficient is, and the higher the division accuracy is.

[0078] The accurate weight parameters for division corresponding to the above-mentioned data discreteness values, the accurate weight parameters for division corresponding to the data extreme values, the accurate weight parameters for division corresponding to the deviation influence coefficients, and the accurate weight parameters for division corresponding to the network transmission performance indicators are all obtained in the tensor filling management library. For example, the data discreteness values ​​and the accurate weight parameters for division corresponding to the preset data discreteness values ​​in the tensor filling management library form a mapping set, and the real-time data discreteness values ​​are brought into the mapping set to obtain the accurate weight parameters for division corresponding to the data discreteness values. The mapping relationship may be a one-to-one correspondence or a many-to-one relationship. In this embodiment, the accurate weight parameters for division corresponding to the data discreteness values, the accurate weight parameters for division corresponding to the data extreme values, the accurate weight parameters for division corresponding to the deviation influence coefficients, and the accurate weight parameters for division corresponding to the network transmission performance indicators all have a value range of (0, 1).

[0079] In this embodiment, the data range is a simple and intuitive expression of the data discreteness value, which is a boundary range description of the data discreteness. Generally speaking, the larger the data discreteness value, the larger the data range is, because a larger discreteness means that the data distribution is wider, and the gap between the maximum and minimum values ​​is more likely to increase; the data discreteness value will also affect the partition deviation influence coefficient. When the data discreteness value is also large, it means that the fluctuation of the sub-tensor data volume is large, which is likely to cause the partition deviation influence coefficient to increase, because the larger discreteness indicates that the data volume difference between the sub-tensors is large, deviating from the ideal balanced partition state; in addition, there is also a certain correlation between the data range and the partition deviation influence coefficient. A larger data range often implies that there may be a larger deviation in the partition, because a large range indicates that the range of variation of the sub-tensor data volume is wide, which may lead to an increase in the imbalance of the data volume between the sub-tensors, thereby increasing the partition deviation influence coefficient; in summary, these parameters are interrelated and influence each other, and work together to affect the partition accuracy of each sub-tensor of the data set to be filled.

[0080] In this embodiment, the larger the network transmission performance index of the GPU within the parallel processing cycle, the larger the GPU network bandwidth is within a reasonable range, which allows the GPU to read and write data faster, reducing the time required for data transmission, which helps to ensure that each sub-tensor of the data set can be timely and completely transmitted to the GPU for calculation during the division process, thereby improving the accuracy of the division; with the improvement of network transmission performance, the bottleneck in the data transmission process is effectively reduced, which helps to maintain the continuity and stability of data transmission and avoids division errors caused by transmission interruption or delay; and the larger the network transmission performance index, the shorter the network delay time, which helps to ensure that each sub-tensor of the data set can be calculated and updated in real time during the division process, thereby improving the real-time and accuracy of the division.

[0081] Furthermore, the determination of whether to optimize the tensor partitioning method is performed includes the following specific determination process:

[0082] The division accuracy of each sub-tensor of the data set to be filled is compared with the division reference accuracy predefined in the tensor filling management library. If the division accuracy of each sub-tensor of the data set to be filled is greater than or equal to the division reference accuracy, there is no need to optimize the tensor division method. If the division accuracy of a sub-tensor of the data set to be filled is less than the division reference accuracy, the tensor division method needs to be optimized.

[0083] The above-mentioned optimization of the tensor partitioning method can be specifically to adjust the parameters in the hash function, such as end, start, and level, which directly affect the mapping distribution of the data, and then affect the data discreteness value of the sub-tensor data volume, and select the data range that is suitable for end and start to reduce the data discreteness value; by preprocessing the original data set to be filled, such as sorting, grouping and other operations, the data can be made more orderly before entering the partitioning process, thereby effectively reducing the data range; clearly stipulate the specific methods and sequence of operations such as data cleaning, conversion, and sorting, and ensure that they are strictly executed in accordance with the standard operating procedures during each data processing, reduce the fluctuation of the sub-tensor partitioning time caused by preprocessing differences, and reduce the partition deviation influence coefficient, thereby improving the partition accuracy of each sub-tensor of the data set to be filled.

[0084] Through the above optimization operations, the data discreteness value, data range and partition deviation influence coefficient are significantly reduced, which can make the data volume of each sub-tensor more balanced. In parallel computing, the amount of data processed by each computing unit (such as the block in the GPU) is similar, and the computing speed tends to be consistent, which reduces the time for computing units with small data volume to wait for computing units with large data volume, thereby speeding up the overall computing speed. When the sub-tensor data volume is balanced and the data mapping is accurate, computing resources (such as CPU and GPU cores) can be more fully and efficiently utilized, and there will be no situation where some computing resources are idle and waiting while some computing resources are overly busy, so that hardware resources are always in a high-load operation state, improving the overall resource utilization.

[0085] Sub-tensor parallel processing: According to the sub-tensors of the data set to be filled, the binary coordinates of each sub-tensor of the data set to be filled are obtained according to the predefined coordinate positioning method. Based on this, the preset parallel tensor search method is combined to obtain the sequence of each parallel sub-tensor of the data set to be filled, and the sequence is transferred to the GPU memory space for parallel processing. The parallel processing performance evaluation value of the GPU memory space is determined, and it is verified with the predefined parallel processing performance evaluation threshold to determine whether to update the parallel processing algorithm of the GPU memory space.

[0086] Specifically, the binary coordinates of each sub-tensor of the data set to be filled are obtained according to the predefined coordinate positioning method. Specifically, the hash coordinates of each sub-tensor are established according to the balance index of the hash algorithm, so as to obtain the binary coordinates of each sub-tensor of the data set to be filled, wherein the binary coordinates of the z-th sub-tensor of the data set to be filled are specifically established as follows:

[0087] ;

[0088] In the formula, is the binary hash value of x, where x is the coordinate value of the sub-tensor in a certain dimension. When the data is modeled as a third-order tensor, the data has corresponding coordinates in the three dimensions of X, Y, and Z. Here x can be the coordinate value of the data in the X dimension. If the Y or Z dimension is hashed, x represents the coordinate value of the Y or Z dimension respectively. end and start represent the maximum and minimum values ​​of the model dimension. binary means that the hash result is binarized, and the binary is represented from high to low. level represents the number of bits of the index binary.

[0089] Furthermore, the parallel tensor search method specifically establishes a parallel binary tree based on the binary coordinates of each sub-tensor of the data set to be filled, thereby searching the parallel sub-tensors corresponding to each sub-tensor of the data set to be filled through the parallel binary tree, and recording them as the sequence of each parallel sub-tensor of the data set to be filled.

[0090] Through the binary coordinates of the sub-tensors, a parallel binary tree is established. The parallel binary tree is gradually established as the sub-tensors are divided. All sub-tensor indexes are established as a binary tree, and are established in the order of X, Y, and Z dimensions. During the establishment process, each leaf node represents a sub-tensor. When the processing data entry of the node exceeds the upper limit, the node is further divided according to the aforementioned division method. The dimension of each sub-tensor division is the dimension of the corresponding node division of the binary tree, so the formula for the node division dimension is:

[0091] ;

[0092] in is the set of dimensions selected for partitioning the sub-tensors, p is the dimension selected for this partitioning of the sub-tensors, and h is the height of the sub-tensor binary tree.

[0093] like Figure 3 As shown, Figure 3 To build a parallel binary tree diagram, the tensor has been divided into 7 sub-tensors on the left, and a parallel binary tree is built for the sub-tensors on the right. Figure 3 In the binary tree, the root node represents the sub-tensor at time t0 At time t2, as the sub-tensor is divided along the X-axis, the binary tree generates two nodes, and the left child node represents the index The right child node represents the sub-tensor of At time t3, the sub-tensor Along the y-axis, the left node of the binary tree generates two new nodes, and the left child node represents the index The B2 sub-tensor of the right child node represents the index B2 is no longer divided after this, so B2 is a leaf node. At time t4, the index is The subtensors are divided along the Z axis, so The node generates a child node, and the left child node represents the index The B0 sub-tensor of the right child node represents the index B0 is no longer divided from this moment on, so B0 is a leaf node. At t5, all data is read, and through the conversion of different dimensions of the tree, the final sub-tensor falls on the leaf node of the tree, generating Figure 3 The binary tree in .

[0094] After obtaining the parallel binary tree, the design search method based on breadth-first traversal in this embodiment is used to find parallel sub-tensors, that is, when traversing the binary tree in breadth-first order, the left and right sub-trees of the current node are compared. If a conflict with the target sub-tensor is found, the conflicting sub-tree is discarded. Since the binary tree is established in the order of X, Y, and Z, when looking for parallel sub-tensors, it is necessary to find the coordinate dimension that needs to be compared based on the height of the current binary tree. When the compared node is a leaf node, the search is stopped, and the leaf nodes that have not been discarded are data without conflict. When searching again, the pruned tree is used instead of the initial tree for searching until the parallel sequence of the target sub-tensor is established.

[0095] like Figure 4 As shown, when looking for data that can be parallelized with subtensor B6, first compare the root node of the binary tree The left and right child nodes of the binary tree are compared with the x-axis binary index of B6. If the coordinates of the right child node conflict, all nodes of the right subtree will be discarded. Then continue to search downward and compare the left node of the second layer of the binary tree. , and need to compare the y-axis binary index of the node with B6. It is found that the left child conflicts with B6, so the left subtree is discarded. Then compare The left child node of B6 is compared with the binary index of the Z axis, and it is found that the left child conflicts with B6, so it is discarded. At this time, there is no need to search for B6 further, and only the leaf node B3 is left. and B4 , so B3 and B4 do not conflict with B6. Since there is more than one sub-tensor that can be parallel with B6, a set of non-conflicting sub-tensor sequences will be created, from which a sub-tensor is randomly selected as the new target, and a sub-tensor that can be parallel with the sub-tensor is searched in the pruned binary tree to improve the search efficiency and obtain the parallel sub-tensor sequences of the data set to be filled.

[0096] Copy each parallel sub-tensor sequence and the corresponding factor matrix to the GPU, and assign a block to each parallel sequence for calculation.

[0097] Specifically, the parallel processing performance evaluation value of the GPU memory space is determined by:

[0098] Get the performance data of GPU memory space during parallel processing, including the total amount of data processed by GPU memory space during the parallel processing cycle, memory access latency, and maximum memory usage.

[0099] The above-mentioned parallel processing cycle is specifically the duration of time that the GPU memory space performs parallel processing calculations on each parallel sub-tensor sequence. The parallel processing cycle is determined by the operator based on a comprehensive analysis of factors such as the state of the host GPU memory space, the corresponding number of data sets, and actual computing requirements.

[0100] The above performance data can be extracted from the background operation report of the host where the GPU is located.

[0101] The total amount of data processed by the GPU memory space in the parallel processing cycle is ratioed to the corresponding duration of the parallel processing cycle to obtain the data processing rate of the GPU memory space in the parallel processing cycle.

[0102] Get the amount of data to be filled in each sub-tensor of the dataset, where the amount of data can be obtained through autonomous counting by the host.

[0103] Get memory access latency bounds and data processing reference rates from the tensor filling library.

[0104] The total amount of data processed by the GPU memory space in the parallel processing cycle, the amount of data to be filled in each sub-tensor of the data set, the data processing rate of the GPU memory space in the parallel processing cycle, the memory access delay duration of the GPU memory space in the parallel processing cycle, and the maximum memory occupancy of the GPU memory space in the parallel processing cycle are comprehensively analyzed to obtain the parallel processing performance evaluation value of the GPU memory space. The specific method is as follows:

[0105] ;

[0106] In the formula, is the parallel processing performance evaluation value of GPU memory space, is the amount of data that needs to be filled in the zth sub-tensor of the dataset, where z is the number of each sub-tensor. , T is the total amount of sub-tensors, is the total amount of data processed by the GPU memory space during the parallel processing cycle, is the data processing rate of the GPU memory space in the parallel processing cycle, is the data processing reference rate, is the maximum memory usage of GPU memory space during the parallel processing cycle, max represents the maximum value, is the memory access latency of the GPU memory space during the parallel processing cycle, Defines the duration of memory access latency, Fill in the tensor management library with the predefined data processing deviation values ​​corresponding to the processing performance influencing parameters, Fill in the tensor management library with the predefined data processing rate deviation value corresponding to the processing performance influencing parameter, It is the processing performance influencing parameter corresponding to the maximum memory usage predefined in the tensor filling management library, and e is a natural constant.

[0107] In this embodiment, the parallel processing performance evaluation value of the GPU memory space is a comprehensive indicator used to measure the memory space related performance of the GPU when processing parallel tasks. It evaluates the efficiency and ability of the GPU when executing parallel computing tasks such as the parallel tensor filling method of the present invention, and can reflect the performance of the GPU memory space in data storage, data transmission, and collaboration with computing units.

[0108] It needs to be explained that the above expression Expressed as the data processing deviation value, it refers to the difference between the amount of data of each sub-tensor input into the GPU and the amount of data actually involved in the calculation and processing by the GPU, indicating the deviation performance of GPU data processing; the amount of data of each sub-tensor refers to the amount of data divided into each sub-tensor; the total amount of data processing refers to the amount of data calculated and processed in the GPU; the data processing rate refers to the ratio of the amount of data that can be calculated in the GPU memory space to the time used during the parallel processing cycle, reflecting the amount of data that the GPU can process per unit time and the efficiency of data processing; the data processing reference rate refers to the adaptation value corresponding to the predefined data processing rate; the maximum memory occupancy refers to the memory usage of the GPU when performing parallel tensor filling calculation tasks; the memory access delay duration refers to the time interval from the time when a computing unit, such as a thread or block in a GPU, issues an access request to data in the memory to the actual acquisition of the required data; the memory access delay definition duration refers to the maximum duration value corresponding to the preset memory access delay duration.

[0109] The processing performance influencing parameters corresponding to the above-mentioned data processing deviation values, the processing performance influencing parameters corresponding to the data processing rate deviation values, and the processing performance influencing parameters corresponding to the maximum memory occupancy are all obtained in the tensor filling management library. For example, the data processing deviation value and the processing performance influencing parameters corresponding to the data processing deviation values ​​preset in the tensor filling management library form a mapping set, and the real-time data processing deviation value is brought into the mapping set to obtain the processing performance influencing parameters corresponding to the data processing deviation value. The mapping relationship can be a one-to-one correspondence or a many-to-one relationship. In this embodiment, the value ranges of the processing performance influencing parameters corresponding to the data processing deviation value, the processing performance influencing parameters corresponding to the data processing rate deviation value, and the processing performance influencing parameters corresponding to the maximum memory occupancy are all (0, 1).

[0110] In this embodiment, a long memory access delay may lead to untimely data acquisition, so that the actual calculation progress of the computing unit deviates from the expected calculation progress while waiting for data, resulting in the data input into the GPU not actually fully participating in the calculation processing, increasing the data processing deviation value, which means that the GPU memory space processing performance is poor; if the memory access delay of the GPU memory space is long when performing data processing tasks, the delay directly occupies the calculation time, reducing the proportion of time used for actual calculation, thereby reducing the data processing rate; and too high a maximum memory occupancy may lead to intensified competition for memory bandwidth, and different computing units need to queue up when accessing the memory, which reduces the data transmission speed and further affects the data processing rate. Therefore, the memory occupancy should be the highest within a reasonable range to ensure that the GPU memory space processing performance is in the best state; in this embodiment, when the data processing rate is unreasonable, it will have a negative impact on the GPU memory space processing performance. When the data processing rate is high, the unit with weaker computing power may cause load imbalance because it cannot keep up with the rhythm. When the data processing rate is low, it may not be able to meet the real-time processing requirements. Therefore, when the data processing rate is close to or equal to the reference rate, the GPU processing performance is in the best state.

[0111] Furthermore, the parallel processing algorithm for determining whether to update the GPU memory space has a specific determination process as follows:

[0112] If the parallel processing performance evaluation value of the GPU memory space is greater than or equal to the parallel processing performance evaluation threshold predefined in the tensor filling management library, there is no need to update the parallel processing algorithm of the GPU memory space.

[0113] If the parallel processing performance evaluation value of the GPU memory space is less than the parallel processing performance evaluation threshold, the parallel processing performance evaluation value of the GPU memory space is differenced with the parallel processing performance evaluation threshold to obtain the parallel processing performance evaluation deviation value of the GPU memory space, and the deviation value is matched with the optimized parallel processing algorithm corresponding to each parallel processing performance evaluation deviation value interval predefined in the tensor filling management library. The specific matching process is: obtaining a mapping set of the parallel processing performance evaluation deviation value of the GPU memory space and the optimized parallel processing algorithm from the tensor filling management library, determining a specific interval of the parallel processing performance evaluation deviation value of the GPU memory space, and assigning the optimized parallel processing algorithm corresponding to the interval to the GPU memory space corresponding to the parallel processing performance evaluation deviation value, thereby matching and obtaining the optimized parallel processing algorithm of the GPU memory space, thereby updating the parallel processing algorithm of the GPU memory space to the optimized parallel processing algorithm, and completing the update of the parallel processing algorithm of the GPU memory space.

[0114] The above-mentioned optimized parallel processing algorithm can be specifically optimized by filling, reordering data or remapping threads to data, and writing allocation tools to optimize the pairing of threads and data, so as to reduce the number of accesses to global memory; the impact of branch divergence on parallel processing performance can be reduced by replacing or removing branches, replacing branches with arithmetic instructions, algorithm flattening, lookup tables, and core splitting; use finer-grained primitives to replace barriers to reduce synchronization overhead.

[0115] Parallel tensor filling: Through the process of parallel processing in GPU memory space, the corresponding weights of each parallel sub-tensor sequence are obtained, and the initial matrices of the data set to be filled are updated according to the corresponding weights of each parallel sub-tensor sequence, and the updated matrices of the data set to be filled are marked. Finally, the missing data in the data set to be filled is filled according to the predefined data filling method, thereby completing the parallel tensor filling of the data.

[0116] Specifically, the corresponding weights of the parallel sub-tensor sequences are obtained based on the operation results of the GPU memory space block and in combination with the conflict scheduling strategy.

[0117] Specifically, the above-mentioned conflict scheduling strategy is that, in order to maximize the number of parallel operations, in this embodiment, conflicting sub-tensors are also taken into account in parallel computing.

[0118] Due to the special data partitioning method, the conflict is defined as the sub-tensor coordinate axis conflict, such as Figure 5 As shown, Figure 5This is a schematic diagram of the weight update strategy. Subtensor B2 conflicts with subtensor B1 on the Z axis. When searching for parallel subtensors, the highest priority is the non-conflicting subtensor, followed by the subtensor with the least conflict. If the non-conflicting subtensors cannot reach the maximum number of parallel operations, the subtensor with the least conflict is selected to be added to the parallel sequence. When a conflict occurs during GPU acceleration, that is, there are n blocks (the amount of data is ) Calculate the result of the same coordinate at the same time and update the corresponding factor matrix at the same time. If multiple blocks are updated together, it may cause "data competition", which may lead to errors in the results. In order to restore the accuracy before the conflict, a weight is defined in this embodiment. The weight is , which is the proportion of the data volume of the i-th updated sub-tensor, where i is the number of each updated sub-tensor. , n is the total number of updated sub-tensors, and the weight is multiplied when updating the factor matrix to restore the accuracy of the data. For example, when solving the factor matrix of sub-tensor B2 (with d2 data) and sub-tensor B1 (with d1 data), the factor matrix corresponding to the Z axis will be calculated d1+d2 times, so when updating the corresponding factor matrix of B2, it needs to be multiplied by To restore the accuracy. When B1 updates the corresponding factor matrix, it needs to be multiplied by To restore accuracy.

[0119] Furthermore, the updating of each initial matrix of the data set to be filled is specifically based on a stochastic gradient descent algorithm, and the corresponding weights of each parallel sub-tensor sequence are comprehensively considered to update each initial matrix of the data set to be filled.

[0120] It should be explained that the specific process of updating the initial matrices of the data set to be filled is as follows:

[0121] 1) Calculation error:

[0122] From the tensor Randomly draw an observation (in are the indices of the tensor in three dimensions respectively), according to the current factor matrices A, B, and C, using the formula (Here R is the rank of CP decomposition, , , Calculate the approximate value of the elements in the factor matrices A, B, and C respectively ;

[0123] Then calculate the error between the observed value and the approximation ;

[0124] 2) Update the factor matrix elements:

[0125] For the factor matrix A, calculate its update amount (in is the learning rate, is the regularization parameter). Then the i-th row element in the factor matrix A is updated to , the update here should be combined with the weights defined above , the actual update is ;

[0126] Similarly, for the factor matrix B, calculate the update amount , and update ( is the weight of the corresponding sub-tensor in the update of the B matrix);

[0127] For the factor matrix C, calculate the update amount ,renew ( is the corresponding weight).

[0128] Specifically, the missing data in the data set to be filled is filled according to a predefined data filling method, specifically, the process of parallel processing of the GPU memory space is iterated until the parallel processing result reaches a convergence state, and the missing data in the data set to be filled is filled in this data filling method.

[0129] It should be explained that the above filling needs to fill the missing data in the data set. The specific process is:

[0130] 1) Repeated iteration:

[0131] Repeat the above process of randomly extracting observations, calculating errors, and updating the factor matrix until the stopping condition is met. There are usually two stopping conditions: one is that the difference in the recovery loss (such as a measurement indicator such as mean square error) between two consecutive iterations is less than a given threshold. In the embodiment of the present invention, it is set to ; The second is to reach the maximum number of iterations (such as 1000). When any of the stop conditions is met, the iteration ends;

[0132] 2) Obtain the converged factor matrix;

[0133] When the above iterative process reaches convergence, the final factor matrices A, B, and C are obtained;

[0134] 3) Recover the tensor using the factor matrix;

[0135] According to the formula , substitute the converged factor matrices A, B, and C to calculate the values ​​of the missing items in the original tensor. Here, i, j, and k traverse the index range of the entire tensor, and for the originally missing data positions, the restored values ​​are calculated, thereby achieving complete recovery of the entire original tensor data and obtaining complete, filled tensor data that can be used for subsequent analysis and application.

[0136] All algorithms used in the embodiments of the present invention are implemented on NVIDIA GPU. Specifically, NVIDIA's CUDA SDK 9.2 is used on NVIDIA GeForce GTX 960. CUDA is started by the host thread of the CPU and transfers the flow data to the GPU device memory before calling the GPU kernel code. When the kernel execution is completed, the recovered flow data is transferred back to the CPU main memory.

[0137] In a specific implementation, five public real data sets are used to verify the effectiveness of the algorithm BTC-GPU (GPU-based parallel tensor filling) involved in the embodiment of the present invention, including the network traffic data set Abilene, with a size of 144*288*168, the network traffic data set GEANT, with a size of 529*96*199, the New York taxi data set NYC, with a size of 30*30*1464, the traffic data set PeMS, with a size of 228*288*44, and the Web service QoS data set Webservice, with a size of 142*4500*64. The five data sets are unevenly sampled to model the experimental conditions of data imbalance, with sampling rates ranging from 10% to 90%.

[0138] The efficiency of BTC-GPU in recovering data is evaluated from five aspects: the effectiveness of the balanced data volume partitioning method, the impact of different processing upper limits on the BTC-GPU computing speed, the convergence speed of the BTC-GPU algorithm, the accuracy convergence of BTC-GPU under different sampling rates, and the impact of the high-dimensional structure of BTC-GPU on accuracy. The convergence speed of BTC-GPU is compared with the tensor filling algorithms of cuTC (tensor filling of unified computing architecture), FlexiFaCT (scalable flexible tensor decomposition), and HPTC (high-performance tensor filling optimization algorithm), and the accuracy is compared with the matrix filling methods of NMF, SRMF, and SGDMF, among which cuTC, FlexiFaCT, HPTC, NMF, SRMF, and SGDMF are all existing tensor filling methods.

[0139] Figure 6 The BTC-GPU method of dividing sub-tensors to balance data volume is demonstrated. Figure 6This is a schematic diagram of the effectiveness of the balanced data volume partitioning method. In the figure, the horizontal axis Sub-tensor ID is the number of each sub-tensor, and the vertical axis Data Volume is the data volume. The left side is the method of dividing into sub-tensors of the same size, and the right side is the BTC-GPU method. This method makes the computational workload of each worker as balanced as possible, reduces computational waiting time, and improves computational efficiency. In order to evaluate the performance of BTC-GPU and FlexiFaCT, an evenly divided sub-tensor algorithm, in terms of the number of sub-tensors, the actual amount of data stored in each sub-tensor in BTC-GPU and FlexiFaCT is compared when the sampling rate is 50% and the upper limit of BTC-GPU's sub-tensor processing is 4096. Figure 6 As shown, according to the experimental results, in the Abilene dataset, the maximum number of sub-tensors processed by the BTC-GPU method is 4076 and the minimum is 1247, while in FlexiFaCT the maximum number of sub-tensors processed is 5587 and the minimum is 13. In the GEANT dataset, the maximum number of sub-tensors processed by the BTC-GPU method is 4094 and the minimum is 835, while in FlexiFaCT the maximum number of sub-tensors processed is 8284 and the minimum is 54. In the NYC dataset, the maximum number of sub-tensors processed by the BTC-GPU method is 4079 and the minimum is 959, while in FlexiFaCT the maximum number of sub-tensors processed is 6068 and the minimum is 3. In the PeMS dataset, the maximum number of sub-tensors processed by the BTC-GPU method is 4091 and the minimum is 1212, while in FlexiFaCT the maximum number of sub-tensors processed is 6316 and the minimum is 47. In the Webservice dataset, the maximum number of sub-tensors processed by the BTC-GPU method is 4096, and the minimum is 1078, while the maximum number of sub-tensors processed in FlexiFaCT is 8323, and the minimum is 21. The experiment found that whether it is a large data set or a small data set, the data volume gap between the sub-tensors divided by the uniform tensor division method in FlexiFaCT is too large, while the BTC-GPU division is more balanced and the data volume gap is small.

[0140] Figure 7 When the sampling rate of the five data sets is 50%, Figure 7This is a schematic diagram of the convergence speed of the BTC-GPU algorithm. The horizontal axis Training Time in the figure is the training time in seconds, and the vertical axis RMSE is the root mean square error, which is a statistic used to measure the difference between the predicted value and the true value. BTC-GPU is compared with cuTC, Lock-free and uniform partitioning algorithms, and the algorithm accuracy and training time are compared. Through a conflict-based scheduling strategy to maximize parallel efficiency, small-scale conflicts are allowed to allow more sub-tensors to be calculated in parallel, and in order to reduce the impact of conflicts, the accuracy is improved by multiplying the weights at the end. When the sampling rate of the five data sets is 50%, BTC-GPU is compared with cuTC, Lock-free and uniform partitioning algorithms, and the algorithm accuracy and training time are compared to verify the effectiveness of the method. Figure 7 As shown in the figure, the cuTC algorithm distributes non-zero data evenly to the Block, but each epoch needs to synchronize the factor matrix, so it takes more time to wait for the update. The algorithms of FlexiFaCT and HPTC both divide the sub-tensors evenly, but the amount of data in the sub-tensors is different, and HPTC uses a lock-free scheduling method, so it converges faster. The BTC-GPU algorithm makes the amount of calculation in each Block similar, and adds conflicting sub-tensors to the parallel, which increases the parallel efficiency, can converge faster, and reach the ideal accuracy first, and the time required to reach the same accuracy is also the shortest. Experiments show that in the Abilene dataset, the time required for BTC-GPU to reach the same accuracy is 42%, 48%, and 69% faster than cuTC, HPTC, and FlexiFaCT methods. BTC-GPU is 49%, 61%, and 70% faster than cuTC, HPTC, and FlexiFaCT methods in the GEANT dataset. BTC-GPU is 67%, 66%, and 79% faster than cuTC, HPTC, and FlexiFaCT methods in the NYC dataset. BTC-GPU is 53%, 64%, and 75% faster than cuTC, HPTC, and FlexiFaCT in the PeMS dataset, and 49%, 48%, and 57% faster than cuTC, HPTC, and FlexiFaCT in the Webserver dataset.

[0141] Figure 8 The five data sets are sampled with non-zero bits. Figure 8 The following is a schematic diagram of the accuracy of data recovery at different sampling rates. The horizontal axis Sampling ratio is the sampling rate, and the vertical axis RMSE is the root mean square error. The sampling rate ranges from 10% to 90%, and BTC-GPU is run at each sampling rate, and the errors at non-sampling positions are compared at different sampling rates. Figure 8As shown in the figure, it is found that as the sampling rate of all data sets increases, the error at the non-sampling position gradually decreases. And different data sets have different sampling rates to reach a smaller error. Abilene has reached a smaller error at a sampling rate of 30%. Although the GEANT data set reaches a smaller error at 80%, the error at all sampling rates is small enough. The NYC data set reaches the minimum error at a sampling rate of 50%, and the PeMS and Webservice data sets both reach a smaller error at a sampling rate of 40%. As the amount of data increases, the tensor filling recovery accuracy increases, but by sampling part of the data for tensor filling, the approximate minimum error can be achieved. And through this experiment, it is found that although the BTC-GPU algorithm uses conflicting sub-tensors to add to the parallel sequence, it uses weights to recover the accuracy caused by the conflict, so the accuracy of the recovered data is basically not lower than that of other algorithms.

[0142] The above contents are merely examples and explanations of the structure of the present invention. The technicians in this technical field may make various modifications or additions to the specific embodiments described or replace them in a similar manner. As long as they do not deviate from the structure of the invention or exceed the scope defined by the present invention, they should all fall within the protection scope of the present invention.

Claims

1. A parallel tensor filling method based on GPU, characterized in that: include: Initial matrix generation: obtain the characteristic information of the data set to be filled, and establish a matrix method based on the preset data characteristics to generate each initial matrix of the data set to be filled; Tensor partition accuracy determination: obtain the amount of data in the data set to be filled, and obtain each sub-tensor of the data set to be filled through the preset tensor partitioning method, determine the partition accuracy of each sub-tensor of the data set to be filled, and verify it with the predefined partition reference accuracy to determine whether to optimize the tensor partitioning method; Sub-tensor parallel processing: According to each sub-tensor of the data set to be filled, the binary coordinates of each sub-tensor of the data set to be filled are obtained according to the predefined coordinate positioning method, and the preset parallel tensor search method is combined to obtain the sequence of each parallel sub-tensor of the data set to be filled, and transmit it to the GPU memory space for parallel processing, determine the parallel processing performance evaluation value of the GPU memory space, and verify it with the predefined parallel processing performance evaluation threshold to determine whether to update the parallel processing algorithm of the GPU memory space; Parallel tensor filling: Through the process of parallel processing in GPU memory space, the corresponding weights of each parallel sub-tensor sequence are obtained, and the initial matrices of the data set to be filled are updated according to the corresponding weights of each parallel sub-tensor sequence, and the updated matrices of the data set to be filled are marked. Finally, the missing data in the data set to be filled is filled according to the predefined data filling method, thereby completing the parallel tensor filling of the data.

2. A GPU-based parallel tensor filling method according to claim 1, characterized in that: The determination of the division accuracy of each sub-tensor of the data set to be filled is carried out as follows: Get the data, maximum value and minimum value of each sub-tensor of the data set to be filled; Perform variance processing on each data of each sub-tensor of the data set to be filled, and obtain the data discreteness value of each sub-tensor of the data set to be filled; Perform difference processing on the maximum value of each sub-tensor of the data set to be filled and the minimum value of each sub-tensor of the data set to be filled, and obtain the data range of each sub-tensor of the data set to be filled; Obtain the partitioning time of each sub-tensor of the data set to be filled, and perform variance processing. The obtained result is recorded as the partition deviation influence coefficient of the data set to be filled; Obtain the network transmission data of the GPU during the data partitioning process, including the network bandwidth of the GPU in the data partitioning cycle, the network delay duration of the GPU in each data partitioning period, the maximum data packet loss rate of the GPU in the data partitioning cycle, and the number of transmission freezes of the GPU in the data partitioning cycle. Comprehensively analyze and obtain the network transmission performance index of the GPU in the data partitioning cycle. The data discreteness value of each sub-tensor of the data set to be filled, the data range of each sub-tensor of the data set to be filled, the network transmission performance index of the GPU during the data partitioning cycle, and the partition deviation influence coefficient of the data set to be filled are comprehensively analyzed to obtain the partition accuracy of each sub-tensor of the data set to be filled.

3. A GPU-based parallel tensor filling method according to claim 2, characterized in that: The specific process of determining whether to optimize the tensor partitioning method is as follows: The division accuracy of each sub-tensor of the data set to be filled is compared with the division reference accuracy. If the division accuracy of each sub-tensor of the data set to be filled is greater than or equal to the division reference accuracy, there is no need to optimize the tensor division method. If the division accuracy of a sub-tensor of the data set to be filled is less than the division reference accuracy, the tensor division method needs to be optimized.

4. The GPU-based parallel tensor filling method according to claim 1, characterized in that: The binary coordinates of each sub-tensor of the data set to be filled are obtained according to the predefined coordinate positioning method, specifically, the hash coordinates of each sub-tensor are established according to the balance index of the hash algorithm, so as to obtain the binary coordinates of each sub-tensor of the data set to be filled.

5. The GPU-based parallel tensor filling method according to claim 1, characterized in that: The parallel tensor search method specifically establishes a parallel binary tree based on the binary coordinates of each sub-tensor of the data set to be filled, thereby searching the parallel sub-tensors corresponding to each sub-tensor of the data set to be filled through the parallel binary tree, and recording them as the sequence of each parallel sub-tensor of the data set to be filled.

6. The GPU-based parallel tensor filling method according to claim 1, characterized in that: The specific determination process of determining the parallel processing performance evaluation value of the GPU memory space is as follows: Obtain the performance data of GPU memory space during parallel processing, including the total amount of data processed by GPU memory space during the parallel processing cycle, memory access latency, and maximum memory usage; The total amount of data processed by the GPU memory space in the parallel processing cycle is ratioed to the corresponding duration of the parallel processing cycle to obtain the data processing rate of the GPU memory space in the parallel processing cycle; Get the amount of data that needs to be filled in each sub-tensor of the dataset; Get the memory access latency bound and data processing reference rate from the tensor filling management library; The total amount of data processed by the GPU memory space in the parallel processing cycle, the amount of data to be filled in each sub-tensor of the data set, the data processing rate of the GPU memory space in the parallel processing cycle, the memory access delay duration of the GPU memory space in the parallel processing cycle, and the maximum memory occupancy of the GPU memory space in the parallel processing cycle are comprehensively analyzed to obtain the parallel processing performance evaluation value of the GPU memory space. The specific method is as follows: ; In the formula, is the parallel processing performance evaluation value of GPU memory space, is the amount of data that needs to be filled in the zth sub-tensor of the dataset, where z is the number of each sub-tensor. , T is the total amount of sub-tensors, is the total amount of data processed by the GPU memory space during the parallel processing cycle, is the data processing rate of GPU memory space in the parallel processing cycle, is the data processing reference rate, It is the maximum memory usage of GPU memory space during the parallel processing cycle, and max represents the maximum value. is the memory access latency of the GPU memory space during the parallel processing cycle, Defines the duration of memory access latency, Fill in the tensor management library with the predefined data processing deviation values ​​corresponding to the processing performance influencing parameters, Fill in the tensor management library with the predefined data processing rate deviation value corresponding to the processing performance influencing parameter, It is the processing performance influencing parameter corresponding to the maximum memory usage predefined in the tensor filling management library, and e is a natural constant.

7. The GPU-based parallel tensor filling method according to claim 6, characterized in that: The parallel processing algorithm for determining whether to update the GPU memory space has the following specific determination process: If the parallel processing performance evaluation value of the GPU memory space is greater than or equal to the parallel processing performance evaluation threshold, there is no need to update the parallel processing algorithm of the GPU memory space; If the parallel processing performance evaluation value of the GPU memory space is less than the parallel processing performance evaluation threshold, the parallel processing performance evaluation value of the GPU memory space is differenced with the parallel processing performance evaluation threshold to obtain the parallel processing performance evaluation deviation value of the GPU memory space, which is matched with the optimized parallel processing algorithm corresponding to each predefined parallel processing performance evaluation deviation value interval to obtain the optimized parallel processing algorithm of the GPU memory space. The parallel processing algorithm of the GPU memory space is thereby updated to the optimized parallel processing algorithm, thereby completing the update of the parallel processing algorithm of the GPU memory space.

8. The GPU-based parallel tensor filling method according to claim 1, characterized in that: The corresponding weights of the parallel sub-tensor sequences are specifically obtained based on the operation results of the GPU memory space block and in combination with the conflict scheduling strategy.

9. The GPU-based parallel tensor filling method according to claim 1, characterized in that: The updating of each initial matrix of the data set to be filled is specifically based on a stochastic gradient descent algorithm, and the corresponding weights of each parallel sub-tensor sequence are comprehensively considered to update each initial matrix of the data set to be filled.

10. The GPU-based parallel tensor filling method according to claim 1, characterized in that: The method of filling the missing data in the data set to be filled in accordance with a predefined data filling method specifically involves iterating the process of parallel processing of the GPU memory space until the parallel processing result reaches a convergence state, and filling the missing data in the data set to be filled in this data filling method.

Citation Information

Patent Citations

  • A method for tensor filling of traffic data based on spatiotemporal constraints

    CN108804392B

  • A tensor filling method, apparatus, device and storage medium

    CN110046116B

  • GPU-enabled multilevel tensor CP decomposition distributed parallel acceleration method under Spark framework

    CN118642863A

  • Deep neural network compression method and related device

    WO2020233130A1