End-to-end MTTKRP acceleration method and device based on GPU platform
By extracting the feature parameters of sparse tensors and using the parameter selection model to optimize the GPU kernel configuration, combining CUDA streams for pipeline transmission and concurrent execution, the problem of low performance in MTTKRP operations is solved, and efficient sparse tensor decomposition calculation is achieved.
Patent Information
- Application Number
- CN202411279694.7
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-09-12
- Publication Date
- 2025-01-14
AI Technical Summary
The prior art is difficult to fully solve the performance problems in MTTKRP operations, especially in sparse data and irregular data access modes. Traditional GPU core startup configurations are difficult to adapt to different input features, resulting in inefficient computing.
By extracting the feature parameters of sparse tensors, using the parameter selection model to determine the optimal startup parameter combination, and using CUDA streams for pipeline transmission and concurrent execution of MTTKRP operations, dynamically adjusting the kernel configuration to optimize data transmission and computational coordination.
It effectively improves the computing efficiency of MTTKRP operation, is suitable for large-scale sparse tensor decomposition calculation, fully utilizes the parallel processing capabilities of the GPU, and improves performance.
Smart Images

Figure CN119311402A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of computer technology, and in particular to an end-to-end MTTKRP acceleration method and device based on a GPU platform. Background Art
[0002] As an advanced extension of matrices, tensors are multidimensional arrays that can naturally express complex and interrelated data. For example, in computer vision, video data is represented by three-dimensional tensors, whose different dimensions correspond to video segments, frame heights, and frame widths, facilitating operations such as convolution and machine learning for tasks such as action recognition and object detection. Many key fields, such as data mining, recommendation systems, social network analysis, network security, numerical linear algebra, computer vision, numerical analysis, and healthcare, have generated a wide range of multidimensional data sets in the form of sparse tensors. Tensors are also the basic data structure in deep learning libraries such as TensorFlow and PyTorch. These libraries provide high-level abstractions and operations for creating, manipulating, and performing calculations on tensors, enabling deep learning models and algorithms to be implemented efficiently. As a basic building block, Tensor operations often play a decisive role in the performance of tensor algorithms and applications. Tensor decomposition can be used to efficiently and quickly analyze tensors. Tensor decomposition technology was first used in the field of psychometrics in 1970, and was adopted by chemometrics 11 years later. In recent years, due to its outstanding performance in various applications such as recommendation systems and dialogue detection, its application popularity has increased significantly. Among them, the CPD (Regularized Multivariate Decomposition) model, as the most popular tensor decomposition method, is a generalization of singular value decomposition, which approximates the tensor as the sum of a finite number of rank tensors, each rank tensor corresponding to a useful data attribute.
[0003] When performing regular multivariate decomposition, a complete iteration involves the Matricized Tensor TimesKhatri-Rao Product (MTTKRP) operation in each mode, and the calculation of sparse tensor CPD is mainly affected by this operation, accounting for about 90% of the total execution time, so it becomes the focus of tensor decomposition optimization. To improve the performance of memory-constrained workloads, most recent studies have attempted to create a compact representation of tensors for each mode and accelerate the MTTKRP kernel with the help of massively parallel architectures equipped with high-bandwidth memory (such as GPUs). However, when effectively utilizing GPU capabilities, the sparsity of the dataset itself and the irregular data access pattern bring new challenges. Sparse data means that only a small number of data matrices / tensors contain non-zero elements, resulting in inefficient memory usage and complex memory access patterns. Moreover, the kernel launch configuration in GPU programming determines how tasks are allocated between GPU threads and blocks. Finding the best configuration is crucial to maximizing GPU performance, but it is highly dependent on the specific characteristics of the input tensor (such as dimension, sparsity, and structure). Traditional static configurations are difficult to adapt to different inputs, resulting in poor performance. Therefore, a dynamic mechanism that can automatically identify and apply the best launch settings is needed to optimize computational efficiency. MTTKRP operation optimization can be seen as a key issue in computing acceleration. It has been proven that this issue is crucial to improving GPU computing performance, and related technologies have shown significant effects in many fields.
[0004] Specifically, GPUs have been widely used in high-performance computing due to their powerful parallel processing capabilities. However, due to the complex characteristics of the tensors to be processed, such methods face many challenges in optimizing MTTKRP operations. Although various optimization strategies have been proposed, their application in MTTKRP is limited, mainly due to the following reasons. First, the sparsity of the dataset leads to inefficient memory usage and complex access patterns, which reduces computing efficiency, resulting in huge performance losses; second, the GPU kernel startup configuration is highly dependent on the characteristics of the input tensors. The traditional fixed configuration is difficult to adapt to diverse inputs and cannot give full play to the GPU performance. Existing solutions mainly focus on optimization in specific aspects, which can be summarized as follows: (1) Kernel internal optimization method
[0005] Research in this area focuses on improving the MTTKRP computing kernel, such as algorithm optimization, instruction adjustment, etc. Commonly used techniques include data locality optimization, instruction parallelization, etc. However, such methods are often limited to the kernel, ignoring the coordination with external data transmission and the overall computing process, making it difficult to achieve optimal global performance.
[0006] (2) Data transmission optimization method
[0007] Research in this area is to improve the way data is transmitted between the host and the GPU, such as using asynchronous transmission, data compression, etc. However, such methods fail to fully consider the dynamic interaction between kernel computing and data transmission, which may lead to a mismatch between transmission and computing.
[0008] In summary, existing solutions, whether based on kernel internal optimization or data transmission optimization methods, are difficult to fully solve the performance problems in MTTKRP operations. MTTKRP operation optimization brings special challenges to GPU computing: 1) The kernel launch configuration needs to be dynamically adjusted according to tensor characteristics; 2) Data transmission needs to be optimized while ensuring data integrity; 3) Kernel computing and data transmission need to be comprehensively considered to achieve efficient coordination between the two. Summary of the invention
[0009] The present invention provides an end-to-end MTTKRP acceleration method and device based on a GPU platform, which are used to solve the performance problem in the MTTKRP operation that is difficult to fully solve in the prior art, realize MTTKRP acceleration in the case of irregular data access patterns of sparse data sets, and effectively improve the computing efficiency.
[0010] The invention provides an end-to-end MTTKRP acceleration method based on a GPU platform, comprising: extracting characteristic parameters of a sparse tensor in an input file, and inputting the extracted characteristic parameters into a parameter selection model to obtain an optimal startup parameter combination output by the parameter selection model, wherein the optimal startup parameter combination includes a thread prediction number and a thread prediction number; wherein the parameter selection model is obtained by training based on historical tensors and the calculation time and resource usage information of a matrix-tensor product MTTKRP configured based on the historical thread number and the historical thread number; determining a factor matrix of the sparse tensor based on the dimension of the sparse tensor in the input file and a preset tensor decomposition result; based on the optimal startup parameter combination, allocating threads to each factor matrix, and transmitting the value of the matrixed tensor to a graphics processing unit in a pipeline transmission manner, so that the graphics processing unit concurrently executes an MTTKRP operation based on the corresponding received matrixed tensor using at least one parallel execution operation mechanism CUDA stream; wherein the CUDA stream is created by the graphics processing unit based on the number of factor matrices, the size of the factor matrix and the storage capacity of the graphics processing unit, and each CUDA stream corresponds to one thread.
[0011] According to an end-to-end MTTKRP acceleration method based on a GPU platform provided by the present invention, before the extracted feature parameters are input into a parameter selection model, the method includes: collecting historical tensors and computing time and resource usage information of MTTKRP under the configuration of historical thread numbers and historical thread numbers; extracting feature parameters of historical tensors to obtain historical parameter features; wherein the historical parameter features include tensor size features and sparsity features; standardizing the computing time and resource usage information of MTTKRP under the configuration of historical thread numbers and historical thread numbers; training a model to be trained using the historical parameter features and the computing time and resource usage information of MTTKRP under the configuration of historical thread numbers and historical thread numbers after the standardized processing, and adjusting the parameters of the model to be trained using an optimization algorithm until the loss function is minimized and the training is terminated.
[0012] According to an end-to-end MTTKRP acceleration method based on a GPU platform provided by the present invention, the models to be trained include at least two of a decision tree model, a random forest model, a support vector machine model, an ensemble learning AdaBoost model, and an ensemble learning Bagging model; after the models to be trained are trained using historical parameter features and the computing time and resource usage information of MTTKRP under the configuration of the historical thread number and the historical thread number after standardization, the method includes: determining the degree of fit of each model to the data based on the mean square error or the mean absolute error for at least two trained models; evaluating the prediction cost of each model, the prediction cost including computing resource consumption and time cost; and selecting a parameter selection model for parameter prediction of the extracted feature parameters from the at least two trained models based on the degree of fit of each model to the data and the prediction cost of each model.
[0013] According to an end-to-end MTTKRP acceleration method based on a GPU platform provided by the present invention, the factor matrix of the sparse tensor is determined based on the dimension of the sparse tensor in the input file and the preset tensor decomposition result, including: determining the number of factor matrices and the size of the factor matrices based on the dimension of the sparse tensor and the preset tensor decomposition result; allocating memory space for the factor matrix according to the size of the factor matrix, and randomly initializing the factor matrix.
[0014] According to the present invention, an end-to-end MTTKRP acceleration method based on a GPU platform is provided, which utilizes at least one concurrent execution operation mechanism CUDA stream to concurrently execute MTTKRP operations based on corresponding received matrixed tensors, including: each CUDA stream concurrently executes MTTKRP operations based on the corresponding received matrixed tensor to obtain the matrix-tensor product of the factor matrix of the corresponding tensor mode; based on the matrix-tensor product of the factor matrix of each tensor mode, a corresponding first matrix is obtained; according to the current tensor mode and the corresponding first matrix, a second matrix is obtained; according to the pseudo-inverse of the first matrix and the corresponding second matrix, the factor matrix of the current tensor mode is updated, and the updated factor matrix is optimized by minimizing the reconstruction error to obtain the corresponding segmented matrix.
[0015] According to an end-to-end MTTKRP acceleration method based on a GPU platform provided by the present invention, after obtaining the corresponding segmentation matrix, the method includes: obtaining a reconstructed tensor according to the segmentation matrix; optimizing a parameter selection model according to the reconstructed tensor and the corresponding optimal startup parameter combination.
[0016] According to an end-to-end MTTKRP acceleration method based on a GPU platform provided by the present invention, before the value of a matrixed tensor is transmitted to a graphics processing unit in a pipeline transmission manner so that the graphics processing unit uses at least one parallel execution operation mechanism CUDA stream to concurrently perform an MTTKRP operation based on the corresponding received matrixed tensor, the method includes: based on each dimension of a sparse tensor, according to the non-zero elements in the sparse tensor, determining a left boundary index and a right boundary index; based on the left boundary index and the right boundary index, determining whether the number of non-zero elements between the two is less than 2, and if less than 2, not sorting; otherwise, according to the non-zero elements in the sparse tensor, selecting an intermediate element as a reference, and using open multi-processing task parallelization to recursively sort the non-zero elements on the left and right parts of the intermediate element to obtain a sorted array corresponding to each dimension; and transmitting the sorted array corresponding to each dimension to the graphics processing unit in a pipeline transmission manner.
[0017] According to the present invention, an end-to-end MTTKRP acceleration method based on a GPU platform is provided, which utilizes at least one concurrent execution operation mechanism CUDA stream to concurrently execute MTTKRP operations based on corresponding received matrixed tensors, and also includes: based on the sorted array corresponding to each dimension, accessing the factor matrix, and storing the calculation results in the process of executing the MTTKRP operation into the result matrix, storing the values of the factor matrix whose access times exceed a preset threshold into a first preset position, and storing the calculation results into a shared memory.
[0018] The present invention also provides an end-to-end MTTKRP acceleration device based on a GPU platform, comprising: a parameter selection module, which extracts characteristic parameters of a sparse tensor in an input file, and inputs the extracted characteristic parameters into a parameter selection model to obtain an optimal startup parameter combination output by the parameter selection model, wherein the optimal startup parameter combination includes a predicted number of threads and a predicted number of threads; wherein the parameter selection model is obtained by training based on historical tensors and the calculation time and resource usage information of a matrix-tensor product MTTKRP configured based on the historical number of threads and the historical number of threads; a factor determination module, which determines the factor matrix of the sparse tensor based on the dimension of the sparse tensor in the input file and a preset tensor decomposition result; an operation execution module, which allocates threads to each factor matrix based on the optimal startup parameter combination, and transmits the value of the matrixed tensor to a graphics processing unit in a pipeline transmission manner, so that the graphics processing unit uses at least one parallel execution operation mechanism CUDA stream to concurrently execute MTTKRP operations based on the corresponding received matrixed tensor; wherein the CUDA stream is created by the graphics processing unit based on the number of factor matrices, the size of the factor matrix and the storage capacity of the graphics processing unit, and each CUDA stream corresponds to one thread.
[0019] The present invention also provides an electronic device, comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein when the processor executes the computer program, the end-to-end MTTKRP acceleration method based on a GPU platform as described above is implemented.
[0020] The present invention also provides a non-transitory computer-readable storage medium having a computer program stored thereon. When the computer program is executed by a processor, the end-to-end MTTKRP acceleration method based on a GPU platform as described above is implemented.
[0021] The present invention also provides a computer program product, including a computer program, wherein when the computer program is executed by a processor, the end-to-end MTTKRP acceleration method based on a GPU platform as described above is implemented.
[0022] The end-to-end MTTKRP acceleration method and device based on the GPU platform provided by the present invention performs parameter selection based on input feature parameters by utilizing a parameter selection model, so as to configure a graphics processing unit according to an optimal startup parameter combination, and transmits the value of a matrixed tensor by a pipeline transmission mode, and combines with a previously configured CUDA stream to realize concurrent execution of MTTKRP operations, so as to divide the tensor into fragments for processing, adopt pipeline parallel strategy transmission and calculation, and effectively improve the computing efficiency under the premise of complying with hardware resource constraints, and is suitable for efficient processing of various large-scale sparse tensor decomposition calculations on the GPU. BRIEF DESCRIPTION OF THE DRAWINGS
[0023] In order to more clearly illustrate the technical solutions in the present invention or the prior art, the following briefly introduces the drawings required for use in the embodiments or the description of the prior art. Obviously, the drawings described below are some embodiments of the present invention. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying creative work.
[0024] Figure 1 This is one of the flow charts of the end-to-end MTTKRP acceleration method based on the GPU platform provided by the present invention; Figure 2 This is the second flow chart of the end-to-end MTTKRP acceleration method based on the GPU platform provided by the present invention; Figure 3 It is a schematic diagram of pipeline parallel computing provided by the present invention; Figure 4 is a schematic diagram of the self-tuning startup provided by the present invention; Figure 5 It is a structural schematic diagram of an end-to-end MTTKRP acceleration device based on a GPU platform provided by the present invention; Figure 6 It is a structural schematic diagram of the electronic device provided by the present invention. DETAILED DESCRIPTION
[0025] In order to make the purpose, technical solution and advantages of the present invention clearer, the technical solution of the present invention will be clearly and completely described below in conjunction with the drawings of the present invention. Obviously, the described embodiments are part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of the present invention.
[0026] Figure 1 : is a flow chart of the end-to-end MTTKRP acceleration method based on the GPU platform provided by the present invention, such as Figure 1 As shown, the method includes: S11, extracting characteristic parameters of the sparse tensor in the input file, and inputting the extracted characteristic parameters into the parameter selection model to obtain the best startup parameter combination output by the parameter selection model, the best startup parameter combination including the predicted number of threads and the predicted number of threads; wherein the parameter selection model is trained based on the historical tensor and the calculation time and resource usage information of the matrix-tensor product MTTKRP under the configuration of the historical number of threads and the historical number of threads; S12, determining a factor matrix of the sparse tensor based on the dimension of the sparse tensor in the input file and a preset tensor decomposition result; S13, based on the optimal startup parameter combination, assign a thread to each factor matrix, and transmit the value of the matrixed tensor to the graphics processing unit in a pipeline transmission manner, so that the graphics processing unit uses at least one parallel execution operation mechanism CUDA stream to concurrently execute the MTTKRP operation based on the corresponding received matrixed tensor; wherein the CUDA stream is created by the graphics processing unit based on the number of factor matrices, the size of the factor matrices and the storage capacity of the graphics processing unit, and each CUDA stream corresponds to a thread.
[0027] It should be noted that the step numbers "S1N" in this specification do not represent the order of the XX method. Figure 2-Figure 4 The end-to-end MTTKRP acceleration method based on a GPU platform of the present invention is described.
[0028] Step S11, extracting characteristic parameters of the sparse tensor in the input file, and inputting the extracted characteristic parameters into the parameter selection model to obtain the optimal startup parameter combination output by the parameter selection model, the optimal startup parameter combination including the predicted number of threads and the predicted number of threads; wherein the parameter selection model is trained based on historical tensors and the computing time and resource usage information of the matrix-tensor product MTTKRP under the configuration of historical number of threads and historical thread numbers.
[0029] It should be noted that the feature parameters include tensor size, dimensional information, number of elements, and sparsity, etc. The feature parameters need to cover the specific distribution pattern and proportion of non-zero elements, so that the extracted feature parameters can be input into the parameter selection model in the future. Through the prediction and analysis of the model, the best startup parameter combination for the tensor can be obtained. The specific feature parameters and the method of extracting the feature parameters of sparse tensors can be referred to in the feature parameters extracted based on historical tensors and the method of extracting feature parameters from historical tensors below, which will not be further elaborated here.
[0030] In an optional embodiment, after obtaining the best startup parameter combination output by the parameter selection model, it also includes: transmitting the best startup parameter combination to the graphics processing unit to ensure the integrity and accuracy of the data to ensure that the GPU can start the MTTKR operation according to the optimal configuration.
[0031] In an optional embodiment, before the extracted feature parameters are input into the parameter selection model, the steps include: collecting historical tensors and computing time and resource usage information of MTTKRP under the configuration of historical number of threads and historical thread numbers; extracting feature parameters of historical tensors to obtain historical parameter features; wherein the historical parameter features include tensor size features and sparsity features; standardizing the computing time and resource usage information of MTTKRP under the configuration of historical number of threads and historical thread numbers; training the model to be trained using the historical parameter features and the standardized computing time and resource usage information of MTTKRP under the configuration of historical number of threads and historical thread numbers, and adjusting the parameters of the model to be trained using an optimization algorithm until the loss function is minimized and the training is terminated.
[0032] It should be noted that the collected historical tensors can be taken from fields such as geography, knowledge, social media, and transportation networks. They can be collected based on actual design requirements and are not further limited here. In addition, the tensor size features include the dimension and the number of elements, and the sparsity features include the distribution and proportion of non-zero elements. In the actual feature extraction process, for each real tensor downloaded from the database, its structure needs to be deeply analyzed to accurately extract key feature parameters. The feature parameters include the dimension size of the tensor, the number of non-zero values (Number of Non-zeros, referred to as NNZ), the proportion of non-zero values (sparsity), sparsity, the number of slices (slice), the number of fibers (fiber), the slice ratio (sliceRatio), the fiber ratio (fiberRatio), the NNZ under each slice, the NNZ under each fiber, and the number of fibers under each slice.
[0033] Furthermore, according to the NNZ under each slice, we can obtain: the average number of non-zero values under all slices (aveNnzPerSlice), the maximum number of non-zero values under all slices (maxNnzPerSlice), the minimum number of non-zero values under all slices (minNnzPerSlice), and the average adjacent value difference of non-zero values under all slices (adjNnzPerSlice); according to the NNZ under each fiber, we can obtain: the average number of non-zero values under all fibers (aveNnzPerFiber), the maximum number of non-zero values under all fibers (maxNnzPerFiber), the minimum number of non-zero values under all fibers (minNnzPerFiber), and the average adjacent value difference of non-zero values under all fibers (adjNnzPerFiber).
[0034] In an optional embodiment, the extracted parameter features can be saved based on a preset format file, such as .csv, which can be specifically set according to actual design requirements and is not further limited here.
[0035] In addition, in the process of using feature parameters extracted based on historical tensors to train the parameter selection model, the model will output the best startup parameter combination scheme for different tensor features through calculation and analysis prediction. The selected startup parameters are the execution parameters gridSize and blockSize of the MTTKRP kernel on the GPU. gridSize represents the number of threads in the grid, and blockSize represents the thread number in each task block (Task Block, TB for short). Different execution configurations of the kernel function are set according to different tensor changes, thereby determining the parallelism of the kernel function.
[0036] In an optional embodiment, the model to be trained includes at least two of a decision tree model, a random forest model, a support vector machine model, an ensemble learning AdaBoost model, and an ensemble learning Bagging model; after training the model to be trained using historical parameter features and the computing time and resource usage information of MTTKRP under the configuration of the historical thread number and the historical thread number after standardization, it also includes: for at least two trained models, based on the mean square error or the mean absolute error, determining the degree of fit of each model to the data; evaluating the prediction cost of each model, the prediction cost includes computing resource consumption and time cost; based on the degree of fit of each model to the data and the prediction cost of each model, selecting a parameter selection model for parameter prediction of the extracted feature parameters from at least two trained models.
[0037] It should be noted that during the training process, for the decision tree model, it is necessary to optimize the selection criteria for splitting nodes and the depth of the tree; for the random forest model, it is necessary to determine the number of trees in the forest and the feature sampling ratio; for the support vector machine (SVM), by finding the optimal decision boundary (hyperplane) in the high-dimensional space to distinguish different categories, the features are mapped to the high-dimensional space so that the data can be separated in the space; for AdaBoost, the prediction results of weak classifiers are combined by weighted majority voting, and the weights are based on the accuracy of each classifier; for bagging, the variance of the prediction is reduced by building multiple models and voting or averaging.
[0038] In addition, during the training process, the training time of each model is recorded, and the degree of fit of the model to the actual data is measured by calculating indicators such as mean square error and mean absolute error, and the prediction cost of each model is evaluated, including computing resource consumption and time cost, so as to select the best performing model in the application process and improve the accuracy of parameter selection. In addition, the iterative canonical / parallel factor analysis decomposition (CANDECOMP / PARAFAC decomposition, referred to as CPD) process involves many MTTKRP operations, which further dilutes the inference overhead.
[0039] It is worth noting that if the efficient end-to-end MTTKRP acceleration method is to be implemented on a new hardware platform, due to differences in different hardware platforms, only the parameter selection model needs to be retrained, and the remaining steps refer to the context and are not further described here.
[0040] Step S12, determining a factor matrix of the sparse tensor based on the dimension of the sparse tensor in the input file and a preset tensor decomposition result.
[0041] In this embodiment, the factor matrix of the sparse tensor is determined based on the dimension of the sparse tensor in the input file and the preset tensor decomposition result, including: determining the number of factor matrices and the size of the factor matrices based on the dimension of the sparse tensor and the preset tensor decomposition result; allocating memory space for the factor matrix according to the size of the factor matrix, and randomly initializing the factor matrix to break the limitations of the initial conditions and increase the chance of finding the optimal solution of the factor matrix required for the tensor MTTKRP calculation process.
[0042] In an optional embodiment, before the value of the matrixed tensor is transmitted to the graphics processing unit in a pipeline transmission manner, so that the graphics processing unit uses at least one parallel execution operation mechanism CUDA stream to concurrently perform the MTTKRP operation based on the corresponding received matrixed tensor, it includes: based on each dimension of the sparse tensor, according to the non-zero elements in the sparse tensor, determining the left boundary index and the right boundary index; based on the left boundary index and the right boundary index, determining whether the number of non-zero elements between the two is less than 2, if less than 2, no sorting is performed; otherwise, according to the non-zero elements in the sparse tensor, the middle element is selected as the benchmark, and the non-zero elements on the left and right parts of the middle element are recursively sorted using Open Multi-Processing (OpenMP) task parallelization to obtain a sorted array corresponding to each dimension; and the sorted array corresponding to each dimension is transmitted to the graphics processing unit in a pipeline transmission manner.
[0043] Step S13, based on the optimal combination of startup parameters, assigning threads to each factor matrix, and transmitting the value of the matrixed tensor to the graphics processing unit in a pipeline transmission manner, so that the graphics processing unit uses at least one parallel execution operation mechanism CUDA stream to concurrently perform the MTTKRP operation based on the corresponding received matrixed tensor; wherein the CUDA stream is created by the graphics processing unit based on the number of factor matrices, the size of the factor matrix and the storage capacity of the graphics processing unit, and each CUDA stream corresponds to one thread, reference Figure 2 .
[0044] It should be noted that, according to the performance characteristics of the graphics processing unit (GPU) such as computing power, memory bandwidth and storage capacity, as well as the number of tensor segments obtained based on the previous execution of this method, a corresponding number of CUDA streams are created. The number of segments and streams is 1 by default. When performing pipeline parallel processing, a reasonable number of segments and streams is set according to actual needs and hardware performance. Each CUDA stream is responsible for transmitting and processing a specific data segment, so as to realize the parallelization of data transmission and processing and give full play to the hardware advantages of the GPU.
[0045] In addition, by assigning threads to each factor matrix, it is convenient to assign the processing tasks of the factor matrix to the threads, and the values of the matrixed tensors are transferred to the GPU in a pipelined manner, so that the data transmission and calculation processes are overlapped to improve the overall efficiency, and then each CUDA is used on the GPU to concurrently execute the MTTKRP operation to utilize the GPU's large-scale parallel computing capabilities. MTTKRP operations are performed on multiple factor matrices at the same time, greatly improving the calculation speed. When a section of the matrix is transferred, the GPU begins to process the data that has been transferred, and while calculating, it starts the transmission of the next section of the matrix to ensure that data transmission and calculation are closely connected. If the data transmission time is greater than the calculation time, it means that the communication is not fully covered, resulting in idle GPU resources. At this time, a more reasonable number of segments is required, and they are assigned to different streams to minimize latency and optimize the synergy between data transmission and calculation. Refer to Figure 3 .
[0046] In this embodiment, at least one concurrent execution operation mechanism CUDA stream concurrently executes MTTKRP operations based on the corresponding received matrixed tensors, including: each CUDA stream concurrently executes the MTTKRP operation based on the corresponding received matrixed tensor to obtain the matrix-tensor product of the factor matrix of the corresponding tensor mode; based on the matrix-tensor product of the factor matrix of each tensor mode, the corresponding first matrix is obtained; according to the current tensor mode and the corresponding first matrix, the second matrix is obtained; according to the pseudo-inverse of the first matrix and the corresponding second matrix, the factor matrix of the current tensor mode is updated, and the updated factor matrix is optimized by minimizing the reconstruction error to obtain the corresponding segmented matrix.
[0047] It should be added that the calculation formula of MTTKRP is , where A, B, and C represent a factor matrix respectively, constituting a decomposition representation of the sparse tensor, and X represents the original sparse tensor, that is, the object of tensor decomposition.
[0048] It should be noted that for each CUDA, based on the corresponding assigned tensor mode, the MTTKRP operation is concurrently performed to obtain the matrix-tensor (Khatri-Rao) product of the factor matrix of the corresponding tensor mode. The Khatri-Rao product is a special matrix product, which is obtained by multiplying the corresponding elements of the factor matrices of all other tensor modes except the current tensor mode, so as to facilitate obtaining the first matrix based on the result of the Khatri-Rao product. In addition, the factor matrices of all tensor modes are updated in the above manner until the update is completed.
[0049] In an optional embodiment, at least one concurrent execution operation mechanism CUDA stream is used to concurrently execute MTTKRP operations based on corresponding received matrixed tensors, and also includes: accessing the factor matrix based on the sorted array corresponding to each dimension, and storing the calculation results during the execution of the MTTKRP operation in the result matrix, storing the values of the factor matrix whose access times exceed a preset threshold to a first preset position, and storing the calculation results in a shared memory.
[0050] It should be noted that by accessing the factor matrix according to the sorted array, the factor matrix value can be quickly found according to the sorting information, thereby reducing the delay of data access. In addition, when the calculation results in the MTTKRP operation are stored in the result matrix, the non-zero elements in the result matrix can be stored in a specific order based on the sorted array to more efficiently organize the storage of the result matrix and avoid unnecessary memory allocation and data movement.
[0051] In addition, the values of frequently accessed factor matrices are stored in specific locations for quick access, thereby reducing repeated calculations and data access delays. The calculation results include intermediate results and final results generated by the calculations, and the calculation results are placed in shared memory to reduce data access delays.
[0052] In an optional embodiment, when the corresponding first matrix is obtained based on the matrix-tensor product of the factor matrices of each tensor mode, the first matrix can also be calculated in combination with the sorted arrays corresponding to each dimension, so that during the calculation process, the position of non-zero elements can be quickly determined according to the index, avoiding unnecessary traversal and searching, thereby improving the efficiency of the multiplication operation.
[0053] In an optional embodiment, after obtaining the corresponding segmentation matrix, the method includes: obtaining a reconstructed tensor according to the segmentation matrix; optimizing the parameter selection model according to the reconstructed tensor and the corresponding optimal startup parameter combination to give full play to the advantages of the self-tuning strategy in the startup parameter selection, and combining the tensor characteristic parameters to adapt to the determination of the optimal startup parameter combination, referring to Figure 4 .
[0054] In an optional embodiment, after using at least one concurrent execution operation mechanism CUDA stream to concurrently execute the MTTKRP operation based on the corresponding received matrixed tensor, it also includes: the device side synchronously transfers the calculation result from the device side memory back to the host memory; the host uses the CPU to execute the same tensor MTTKRP operation, and compares and checks whether the GPU execution result is correct.
[0055] In summary, the embodiment of the present invention uses a parameter selection model to perform parameter selection based on the input feature parameters, so as to configure the graphics processing unit according to the optimal startup parameter combination, and transmit the value of the matrixed tensor through pipeline transmission. Combined with the previously configured CUDA stream, the concurrent execution of the MTTKRP operation is realized, so that under the premise of complying with hardware resource constraints, the tensor is divided into fragments for processing, and the pipeline parallel strategy is adopted for transmission and calculation, etc., which effectively improves the computing efficiency, and is suitable for efficient processing of various large-scale sparse tensor decomposition calculations on the GPU.
[0056] The end-to-end MTTKRP acceleration device based on a GPU platform provided by the present invention is described below. The end-to-end MTTKRP acceleration device based on a GPU platform described below and the end-to-end MTTKRP acceleration method based on a GPU platform described above can refer to each other.
[0057] Figure 5 The schematic diagram of the structure of an end-to-end MTTKRP acceleration device based on a GPU platform is shown, and the device comprises: The parameter selection module 51 extracts characteristic parameters of the sparse tensor in the input file, and inputs the extracted characteristic parameters into the parameter selection model to obtain the best startup parameter combination output by the parameter selection model, wherein the best startup parameter combination includes the predicted number of threads and the predicted number of threads; wherein the parameter selection model is trained based on the historical tensor and the calculation time and resource usage information of the matrix-tensor product MTTKRP under the configuration of the historical number of threads and the historical number of threads; A factor determination module 42 determines a factor matrix of the sparse tensor based on the dimension of the sparse tensor in the input file and a preset tensor decomposition result; The operation execution module 53 allocates threads to each factor matrix based on the optimal startup parameter combination, and transmits the value of the matrixed tensor to the graphics processing unit in a pipeline transmission manner, so that the graphics processing unit uses at least one parallel execution operation mechanism CUDA stream to concurrently execute the MTTKRP operation based on the corresponding received matrixed tensor; wherein the CUDA stream is created by the graphics processing unit based on the number of factor matrices, the size of the factor matrices and the storage capacity of the graphics processing unit, and each CUDA stream corresponds to one thread.
[0058] In an optional embodiment, the device further includes: a transmission module, after obtaining the best startup parameter combination output by the parameter selection model, transmitting the best startup parameter combination to the graphics processing unit to ensure the integrity and accuracy of the data to ensure that the GPU can start the MTTKR operation according to the optimal configuration.
[0059] In an optional embodiment, the device includes: a historical data collection module, which collects historical tensors and the computing time and resource usage information of MTTKRP under the configuration of historical thread numbers and historical thread numbers before inputting the extracted feature parameters into the parameter selection model; a feature extraction module, which extracts feature parameters from historical tensors to obtain historical parameter features; wherein the historical parameter features include tensor size features and sparsity features; a standardization processing module, which standardizes the computing time and resource usage information of MTTKRP under the configuration of historical thread numbers and historical thread numbers; a model training module, which trains the model to be trained using the historical parameter features and the computing time and resource usage information of MTTKRP under the configuration of historical thread numbers and historical thread numbers after standardization, and adjusts the parameters of the model to be trained using an optimization algorithm until the loss function is minimized and the training is terminated.
[0060] In an optional embodiment, the device further includes: a saving module, which saves the extracted parameter features in a preset format file.
[0061] In an optional embodiment, the model to be trained includes at least two of a decision tree model, a random forest model, a support vector machine model, an ensemble learning AdaBoost model, and an ensemble learning Bagging model; the device also includes: a fitting degree determination module, which uses historical parameter features and the computing time and resource usage information of MTTKRP under the configuration of the historical thread number and the historical thread number after standardization to train the model to be trained, and then determines the fitting degree of each model to the data based on the mean square error or the mean absolute error for at least two trained models; a model evaluation module, which evaluates the prediction cost of each model, and the prediction cost includes computing resource consumption and time cost; a model selection module, which selects a parameter selection model for parameter prediction of the extracted feature parameters from at least two trained models based on the fitting degree of each model to the data and the prediction cost of each model.
[0062] In this embodiment, the factor determination module 42 includes: a factor matrix determination unit, which determines the number of factor matrices and the size of factor matrices based on the dimension of the sparse tensor and the preset tensor decomposition result; an initialization unit, which allocates memory space for the factor matrix according to the size of the factor matrix, and randomly initializes the factor matrix to break the limitations of the initial conditions and increase the chance of finding the optimal solution of the factor matrix required for the tensor MTTKRP calculation process.
[0063] In an optional embodiment, the device further includes: a boundary index determination module, which determines a left boundary index and a right boundary index based on each dimension of the sparse tensor and the non-zero elements in the sparse tensor before transmitting the value of the matrixed tensor to the graphics processing unit in a pipeline transmission manner so that the graphics processing unit uses at least one parallel execution operation mechanism CUDA stream to concurrently execute the MTTKRP operation based on the corresponding received matrixed tensor; a judgment module, which determines whether the number of non-zero elements between the left boundary index and the right boundary index is less than 2 based on the left boundary index and the right boundary index, and if less than 2, no sorting is performed; otherwise, a sorting module, which selects the middle element as a benchmark based on the non-zero elements in the sparse tensor, and recursively sorts the non-zero elements on the left and right parts of the middle element using open multi-processing (Open Multi-Processing, referred to as OpenMP) task parallelization to obtain a sorted array corresponding to each dimension; a transmission module, which transmits the sorted array corresponding to each dimension to the graphics processing unit in a pipeline transmission manner.
[0064] In addition, the operation execution module 53 includes: a concurrent execution unit, each CUDA stream concurrently executes the MTTKRP operation based on the corresponding received matrixed tensor to obtain the matrix-tensor product of the factor matrix of the corresponding tensor mode; a first matrix determination unit, based on the matrix-tensor product of the factor matrix of each tensor mode, to obtain the corresponding first matrix; a second matrix determination unit, based on the current tensor mode and the corresponding first matrix, to obtain the second matrix; an update unit, based on the pseudo-inverse of the first matrix and the corresponding second matrix, to update the factor matrix of the current tensor mode, and optimize the updated factor matrix by minimizing the reconstruction error to obtain the corresponding segmented matrix.
[0065] In an optional embodiment, the operation execution module 53 also includes: a storage unit, which accesses the factor matrix based on the sorted array corresponding to each dimension, and stores the calculation results in the process of executing the MTTKRP operation in the result matrix, stores the value of the factor matrix whose access times exceed the preset threshold to the first preset position, and stores the calculation results in the shared memory.
[0066] In an optional embodiment, in the first matrix determination unit, when obtaining the corresponding first matrix based on the matrix-tensor product of the factor matrices of each tensor mode, the first matrix can also be calculated in combination with the sorted arrays corresponding to each dimension, so that during the calculation process, the position of non-zero elements can be quickly determined according to the index, avoiding unnecessary traversal and searching, thereby improving the efficiency of the multiplication operation.
[0067] In an optional embodiment, the device also includes: a reconstruction module, which obtains a reconstructed tensor according to the segmented matrix after obtaining the corresponding segmented matrix; a tuning module, which optimizes the parameter selection model according to the reconstructed tensor and the corresponding optimal startup parameter combination, so as to give full play to the advantages of the self-tuning strategy in startup parameter selection, and combines the tensor characteristic parameters to adapt to the determination of the optimal startup parameter combination.
[0068] In an optional embodiment, the device also includes: a synchronization module, after using at least one concurrent execution operation mechanism CUDA stream to concurrently execute the MTTKRP operation based on the corresponding received matrixed tensor, the device side synchronously transfers the calculation result from the device side memory back to the host memory; a checking module, the host uses the CPU to execute the same tensor MTTKRP operation, and compares and checks whether the GPU execution result is correct.
[0069] In summary, the embodiment of the present invention uses a parameter selection model through a parameter selection module to perform parameter selection based on input feature parameters, so as to configure the graphics processing unit according to the optimal startup parameter combination, and transmit the value of the matrixed tensor through a pipeline transmission method. The operation execution module is combined with the previously configured CUDA stream to realize concurrent execution of the MTTKRP operation, so as to divide the tensor into fragments for processing, adopt pipeline parallel strategy transmission and calculation, etc. under the premise of complying with hardware resource constraints, thereby effectively improving the computing efficiency, and being suitable for efficient processing of various large-scale sparse tensor decomposition calculations on the GPU.
[0070] Figure 6 An example of a physical structure diagram of an electronic device is shown in FIG. Figure 6 As shown, the electronic device may include: a processor (processor) 610 , a communication interface (Communications Interface) 620 , a memory (memory) 630 and a communication bus 640 , wherein the processor 610 , the communication interface 620 , and the memory 630 communicate with each other through the communication bus 640 . The processor 610 can call the logic instructions in the memory 630 to execute an end-to-end MTTKRP acceleration method based on a GPU platform, the method comprising: extracting characteristic parameters of a sparse tensor in an input file, and inputting the extracted characteristic parameters into a parameter selection model to obtain an optimal startup parameter combination output by the parameter selection model, the optimal startup parameter combination comprising a predicted number of threads and a predicted number of threads; wherein the parameter selection model is trained based on historical tensors and the computing time and resource usage information of the matrix-tensor product MTTKRP under the configuration of the historical number of threads and the historical number of threads; determining the factor matrix of the sparse tensor based on the dimension of the sparse tensor in the input file and the preset tensor decomposition result; based on the optimal startup parameter combination, assigning threads to each factor matrix, and transmitting the value of the matrixed tensor to the graphics processing unit in a pipeline transmission manner, so that the graphics processing unit uses at least one parallel execution operation mechanism CUDA stream to concurrently execute the MTTKRP operation based on the corresponding received matrixed tensor; wherein the CUDA stream is created by the graphics processing unit based on the number of factor matrices, the size of the factor matrix, and the storage capacity of the graphics processing unit, and each CUDA stream corresponds to one thread.
[0071] In addition, the logic instructions in the above-mentioned memory 630 can be implemented in the form of a software functional unit and can be stored in a computer-readable storage medium when it is sold or used as an independent product. Based on such an understanding, the technical solution of the present invention, in essence, or the part that contributes to the prior art or the part of the technical solution, can be embodied in the form of a software product, and the computer software product is stored in a storage medium, including a number of instructions for a computer device (which can be a personal computer, a server, or a network device, etc.) to perform all or part of the steps of the method described in each embodiment of the present invention. The aforementioned storage medium includes: U disk, mobile hard disk, read-only memory (ROM, Read-Only Memory), random access memory (RAM, Random Access Memory), disk or optical disk, etc. Various media that can store program codes.
[0072] On the other hand, the present invention also provides a computer program product, which includes a computer program. The computer program can be stored on a non-transitory computer-readable storage medium. When the computer program is executed by a processor, the computer can execute the end-to-end MTTKRP acceleration method based on a GPU platform provided by the above methods. The method includes: extracting characteristic parameters of a sparse tensor in an input file, and inputting the extracted characteristic parameters into a parameter selection model to obtain an optimal startup parameter combination output by the parameter selection model, wherein the optimal startup parameter combination includes a predicted number of threads and a predicted number of threads; wherein the parameter selection model is based on historical tensors and based on historical numbers of threads and historical thread numbers. The calculation time and resource usage information of the matrix-tensor product MTTKRP under the configuration are trained; based on the dimension of the sparse tensor in the input file and the preset tensor decomposition result, the factor matrix of the sparse tensor is determined; based on the optimal startup parameter combination, threads are allocated to each factor matrix, and the value of the matrixed tensor is transmitted to the graphics processing unit in a pipeline transmission manner, so that the graphics processing unit uses at least one parallel execution operation mechanism CUDA stream to concurrently execute the MTTKRP operation based on the corresponding received matrixed tensor; wherein the CUDA stream is created by the graphics processing unit based on the number of factor matrices, the size of the factor matrix and the storage capacity of the graphics processing unit, and each CUDA stream corresponds to one thread.
[0073] On the other hand, the present invention also provides a non-transitory computer-readable storage medium having a computer program stored thereon, which is implemented when the computer program is executed by a processor to execute the end-to-end MTTKRP acceleration method based on a GPU platform provided by the above methods, the method comprising: extracting characteristic parameters of a sparse tensor in an input file, and inputting the extracted characteristic parameters into a parameter selection model to obtain an optimal startup parameter combination output by the parameter selection model, the optimal startup parameter combination comprising a predicted number of threads and a predicted number of threads; wherein the parameter selection model is based on a historical tensor and a matrix-tensor product MTTK based on a configuration of a historical number of threads and a historical number of threads. The MTTKRP operation is obtained by training the computing time and resource usage information of the RP; based on the dimension of the sparse tensor in the input file and the preset tensor decomposition result, the factor matrix of the sparse tensor is determined; based on the optimal startup parameter combination, threads are allocated to each factor matrix, and the value of the matrixed tensor is transmitted to the graphics processing unit in a pipeline transmission manner, so that the graphics processing unit can use at least one parallel execution operation mechanism CUDA stream to concurrently execute the MTTKRP operation based on the corresponding received matrixed tensor; wherein the CUDA stream is created by the graphics processing unit based on the number of factor matrices, the size of the factor matrix and the storage capacity of the graphics processing unit, and each CUDA stream corresponds to one thread.
[0074] The device embodiments described above are merely illustrative, wherein the units described as separate components may or may not be physically separated, and the components displayed as units may or may not be physical units, that is, they may be located in one place, or they may be distributed on multiple network units. Some or all of the modules may be selected according to actual needs to achieve the purpose of the scheme of this embodiment. Ordinary technicians in this field can understand and implement it without paying creative labor.
[0075] Through the description of the above implementation methods, those skilled in the art can clearly understand that each implementation method can be implemented by means of software plus a necessary general hardware platform, and of course, can also be implemented by hardware. Based on this understanding, the above technical solution is essentially or the part that contributes to the prior art can be embodied in the form of a software product, and the computer software product can be stored in a computer-readable storage medium, such as ROM / RAM, a disk, an optical disk, etc., including a number of instructions for a computer device (which can be a personal computer, a server, or a network device, etc.) to execute the methods described in each embodiment or some parts of the embodiments.
[0076] Finally, it should be noted that the above embodiments are only used to illustrate the technical solutions of the present invention, rather than to limit it. Although the present invention has been described in detail with reference to the aforementioned embodiments, those skilled in the art should understand that they can still modify the technical solutions described in the aforementioned embodiments, or make equivalent replacements for some of the technical features therein. However, these modifications or replacements do not deviate the essence of the corresponding technical solutions from the spirit and scope of the technical solutions of the embodiments of the present invention.
Claims
1. An end-to-end MTTKRP acceleration method based on a GPU platform, characterized in that: include: Extract characteristic parameters of the sparse tensor in the input file, and input the extracted characteristic parameters into the parameter selection model to obtain the optimal startup parameter combination output by the parameter selection model, wherein the optimal startup parameter combination includes the predicted number of threads and the predicted number of threads; wherein the parameter selection model is trained based on the historical tensor and the calculation time and resource usage information of the matrix-tensor product MTTKRP under the configuration of the historical number of threads and the historical number of threads; Determine a factor matrix of the sparse tensor based on the dimension of the sparse tensor in the input file and a preset tensor decomposition result; Based on the optimal startup parameter combination, threads are assigned to each of the factor matrices, and the values of the matrixed tensors are transmitted to the graphics processing unit in a pipeline transmission manner, so that the graphics processing unit uses at least one parallel execution operation mechanism CUDA stream to concurrently perform MTTKRP operations based on the corresponding received matrixed tensors; wherein the CUDA stream is created by the graphics processing unit based on the number of factor matrices, the size of the factor matrices and the storage capacity of the graphics processing unit, and each CUDA stream corresponds to one thread.
2. The end-to-end MTTKRP acceleration method based on a GPU platform according to claim 1, characterized in that: Before the extracted characteristic parameters are input into the parameter selection model, the method includes: Collect historical tensors and the computation time and resource usage information of MTTKRP under the configuration of historical number of threads and historical thread numbers; Extracting characteristic parameters from the historical tensor to obtain historical parameter features; wherein the historical parameter features include tensor size features and sparsity features; Standardizing the computing time and resource usage information of MTTKRP under the configuration of the number of historical threads and the number of historical threads; The model to be trained is trained using the historical parameter characteristics and the computing time and resource usage information of MTTKRP under the historical thread number and historical thread number configuration after normalization, and the parameters of the model to be trained are adjusted using an optimization algorithm until the loss function is minimized and the training is terminated.
3. The end-to-end MTTKRP acceleration method based on GPU platform according to claim 2, characterized in that: The model to be trained includes at least two of a decision tree model, a random forest model, a support vector machine model, an ensemble learning AdaBoost model, and an ensemble learning Bagging model; after training the model to be trained using the historical parameter features and the computing time and resource usage information of MTTKRP under the configuration of the historical thread number and the historical thread number after the normalization process, the method includes: For at least two trained models, determine how well each model fits the data based on the mean square error or mean absolute error; Evaluating the prediction cost of each of the models, wherein the prediction cost includes computing resource consumption and time cost; Based on the degree of fit of each model to the data and the prediction cost of each model, a parameter selection model for parameter prediction of the extracted feature parameters is selected from at least two trained models.
4. The end-to-end MTTKRP acceleration method based on a GPU platform according to claim 1, characterized in that: Determining a factor matrix of the sparse tensor based on the dimension of the sparse tensor in the input file and a preset tensor decomposition result includes: Determine the number and size of factor matrices based on the dimension of the sparse tensor and a preset tensor decomposition result; According to the size of the factor matrix, memory space is allocated for the factor matrix, and the factor matrix is randomly initialized.
5. The end-to-end MTTKRP acceleration method based on GPU platform according to claim 1, characterized in that: The method of concurrently executing the MTTKRP operation based on the corresponding received matrixed tensor by using at least one concurrent execution operation mechanism CUDA stream includes: Each of the CUDA streams concurrently performs an MTTKRP operation based on the corresponding received matrixed tensor to obtain a matrix-tensor product of a factor matrix of the corresponding tensor mode; Based on the matrix-tensor product of the factor matrices of each of the tensor modes, a corresponding first matrix is obtained; According to the current tensor mode and the corresponding first matrix, the second matrix is obtained; According to the first matrix and the pseudo-inverse of the corresponding second matrix, the factor matrix of the current tensor mode is updated, and the updated factor matrix is optimized by minimizing the reconstruction error to obtain the corresponding segmented matrix.
6. The end-to-end MTTKRP acceleration method based on GPU platform according to claim 5, characterized in that: After obtaining the corresponding segment matrix, the following steps are performed: According to the segmentation matrix, a reconstruction tensor is obtained; The parameter selection model is optimized according to the reconstructed tensor and the corresponding optimal startup parameter combination.
7. The end-to-end MTTKRP acceleration method based on GPU platform according to claim 1, characterized in that: Before transmitting the value of the matrixed tensor to the graphics processing unit in a pipeline transmission manner so that the graphics processing unit concurrently performs the MTTKRP operation based on the corresponding received matrixed tensor using at least one parallel execution operation mechanism CUDA stream, the method includes: Based on each dimension of the sparse tensor, determining a left boundary index and a right boundary index according to non-zero elements in the sparse tensor; Based on the left boundary index and the right boundary index, determine whether the number of non-zero elements between the two is less than 2, and if less than 2, do not sort; Otherwise, according to the non-zero elements in the sparse tensor, a middle element is selected as a reference, and the non-zero elements on the left and right parts of the middle element are recursively sorted by using open multi-processing task parallelization to obtain a sorted array corresponding to each dimension; The sorted arrays corresponding to the dimensions are transmitted to the graphics processing unit in a pipeline transmission manner.
8. The end-to-end MTTKRP acceleration method based on GPU platform according to claim 7, characterized in that: The method of concurrently executing the MTTKRP operation based on the corresponding received matrixed tensor by using at least one concurrent execution operation mechanism CUDA stream also includes: Based on the sorted arrays corresponding to the dimensions, the factor matrix is accessed, and the calculation results during the MTTKRP operation are stored in the result matrix, the values of the factor matrix whose access times exceed the preset threshold are stored in the first preset position, and the calculation results are stored in the shared memory.
9. An electronic device comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein: When the processor executes the computer program, the end-to-end MTTKRP acceleration method based on the GPU platform as described in any one of claims 1 to 8 is implemented.
10. A non-transitory computer-readable storage medium having a computer program stored thereon, characterized in that: When the computer program is executed by a processor, the end-to-end MTTKRP acceleration method based on a GPU platform as claimed in any one of claims 1 to 8 is implemented.
Citation Information
Cited By
GPU heterogeneous accelerator card performance modeling optimization method and system based on sparse matrix vector multiplication
CN120849129A