A method, device and related equipment for implementing singular value decomposition operation
By building and deploying the singular value decomposition operator on the Asteng AI processor, using power iteration method and sub-functions for operations, the problem that the singular value decomposition operation on the Asteng AI processor cannot be directly executed, and efficient utilization of the Asteng processor is achieved.
Patent Information
- Application Number
- CN202111040096.0
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2021-09-06
- Publication Date
- 2025-08-08
- Estimated Expiration
- 2041-09-06
AI Technical Summary
In the prior art, singular value decomposition operations cannot be run directly on Astend AI processors, and the computing power of Astend AI processors cannot be fully utilized.
Singular value decomposition operator is constructed and deployed to Ascend AI processor, and singular value decomposition operation is realized through power iteration method, using vector normalization, matrix multiplication vector, vector multiplication matrix and vector orthogonalization subfunctions for data transfer and calculation.
It realizes singular value decomposition operations on Astend AI processor, makes full use of the computing power of Astend processor, and supports the direct execution of SVD operations on Astend AI processor.
Smart Images

Figure CN113885941B_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of singular value decomposition, and in particular to a method and apparatus for implementing a singular value decomposition operation and related equipment. Background Art
[0002] The development of AI technology often relies on processing massive amounts of data, which places extremely high demands on computing power. The Ascend AI processor is a high-computing processor designed specifically for these compute-intensive tasks. While the Ascend AI processor has achieved impressive results in AI task processing, support for its underlying operators remains limited.
[0003] The singular value decomposition (SVD) operation is a common matrix calculation process in mathematics. It can be used to accelerate matrix inversion calculations, and plays an important role in signal processing, image compression, tensor networks, second-order optimization, etc. In the existing technology, the corresponding SVD function can be run on multiple computing platforms such as x86, ARM and GPU to implement SVD operations. The problem with the existing technology is that there is currently no SVD operator that can run on the Ascend AI processor. For data that requires singular value decomposition operations, SVD operations cannot be performed directly based on the Ascend AI processor, which is not conducive to fully utilizing the computing power of the Ascend processor.
[0004] Therefore, the existing technology still needs to be improved and developed. Summary of the Invention
[0005] The main purpose of the present invention is to provide a method, apparatus, and related equipment for implementing singular value decomposition operations, aiming to address the problem in the prior art that singular value decomposition operators cannot run on Ascend AI processors. For data requiring singular value decomposition operations, singular value decomposition operations cannot be performed directly based on Ascend AI processors, which is not conducive to fully utilizing the computing power of Ascend AI processors.
[0006] In order to achieve the above object, the first aspect of the present invention provides a method for implementing a singular value decomposition operation, wherein the method comprises:
[0007] Constructing a singular value decomposition operator, wherein the singular value decomposition operator is used to move data in the target device and perform a singular value decomposition operation;
[0008] Deploy the singular value decomposition operator to the target device, where the target device is an Ascend AI processor.
[0009] Obtain the data to be processed, and perform a singular value decomposition operation on the data to be processed based on the deployed singular value decomposition operator.
[0010] Optionally, the above-mentioned construction of the singular value decomposition operator includes:
[0011] Based on the algorithm flow of singular value decomposition, a sub-function of the singular value decomposition operator is constructed, wherein the algorithm flow is the flow corresponding to the power iteration method.
[0012] Optionally, the sub-functions of the singular value decomposition operator include: a vector normalization sub-function, a matrix multiplication vector sub-function, a vector multiplication matrix sub-function and a vector orthogonalization sub-function.
[0013] Optionally, the vector normalization sub-function is used to: perform data transfer and calculation on the vector to be normalized in blocks, and obtain the normalized vector of the vector to be normalized and the modulus of the vector to be normalized.
[0014] Optionally, the matrix multiplication quantum function is used to: perform data transfer and calculation on matrices and vectors corresponding to the matrix multiplication quantum function in batches to obtain output vectors.
[0015] Optionally, the above-mentioned vector multiplication matrix sub-function is used to: perform data transfer and calculation on the vectors and matrices corresponding to the above-mentioned vector multiplication matrix sub-function in batches to obtain output vectors.
[0016] Optionally, the above-mentioned vector orthogonalization subfunction is used to: calculate and obtain an output vector based on the input vector and the normalized vector input into the above-mentioned vector orthogonalization subfunction, wherein the inner product of the above-mentioned input vector and the above-mentioned output vector is 0.
[0017] Optionally, the above singular value decomposition operator is constructed based on all the above sub-functions, including:
[0018] Based on the above vector normalization subfunction, matrix multiplication vector subfunction, vector multiplication matrix subfunction and vector orthogonalization subfunction, the above singular value decomposition operator is written through TIK.
[0019] Optionally, the acquiring of the data to be processed and performing a singular value decomposition operation on the data to be processed based on the deployed singular value decomposition operator include:
[0020] The data to be processed is obtained, and based on the power iteration method, a sub-function of the singular value decomposition operator is called to perform a singular value decomposition operation on the data to be processed.
[0021] A second aspect of the present invention provides a device for implementing a singular value decomposition operation, wherein the device comprises:
[0022] An operator construction module, used to construct a singular value decomposition operator, wherein the singular value decomposition operator is used to move data in the target device and perform a singular value decomposition operation;
[0023] An operator deployment module, configured to deploy the singular value decomposition operator to the target device, where the target device is an Ascend AI processor;
[0024] The operation module is used to obtain the data to be processed and perform a singular value decomposition operation on the above-mentioned data to be processed based on the deployed singular value decomposition operator.
[0025] Optionally, the operator construction module is specifically used to: construct a sub-function of the singular value decomposition operator based on the algorithm flow of singular value decomposition, wherein the algorithm flow is a flow corresponding to the power iteration method.
[0026] A third aspect of the present invention provides an intelligent terminal, which includes a memory, a processor, and a singular value decomposition operation implementation program stored in the memory and runnable on the processor. When the singular value decomposition operation implementation program is executed by the processor, it implements any step of the singular value decomposition operation implementation method.
[0027] A fourth aspect of the present invention provides a computer-readable storage medium, on which a singular value decomposition operation implementation program is stored. When the singular value decomposition operation implementation program is executed by a processor, the singular value decomposition operation implementation program implements any step of the singular value decomposition operation implementation method.
[0028] As can be seen from the above, in the solution of the present invention, a singular value decomposition operator is constructed, wherein the singular value decomposition operator is used to move data in the target device and perform singular value decomposition operations; the singular value decomposition operator is deployed in the target device, wherein the target device is an Ascend AI processor; the data to be processed is obtained, and a singular value decomposition operation is performed on the data to be processed based on the deployed singular value decomposition operator. Compared with the existing technology, the solution of the present invention constructs a singular value decomposition operator that can move data in the Ascend AI processor and perform singular value decomposition operations, and deploys the singular value decomposition operator in the Ascend AI processor, which is conducive to fully utilizing the computing power of the Ascend processor and directly performing SVD operations on the data to be processed based on the Ascend AI processor. BRIEF DESCRIPTION OF THE DRAWINGS
[0029] In order to more clearly illustrate the technical solutions in the embodiments of the present invention, 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 only some embodiments of the present invention. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying any creative work.
[0030] Figure 1 This is a schematic diagram of the Huawei Da Vinci AI Core architecture provided by an embodiment of the present invention;
[0031] Figure 2 Schematic diagram of SVD decomposition of a matrix provided by an embodiment of the present invention;
[0032] Figure 3 This is a flow chart of a method for implementing a singular value decomposition operation provided by an embodiment of the present invention;
[0033] Figure 4 This is a schematic diagram of the data handling process of the vector computing unit in the AI Core provided by an embodiment of the present invention;
[0034] Figure 5 is a schematic diagram of a matrix multiplication by a vector provided by an embodiment of the present invention;
[0035] Figure 6 is a schematic diagram of a vector multiplication matrix provided by an embodiment of the present invention;
[0036] Figure 7 This is a schematic structural diagram of a device for implementing a singular value decomposition operation provided by an embodiment of the present invention;
[0037] Figure 8 This is a block diagram of the internal structure principle of a smart terminal provided by an embodiment of the present invention. DETAILED DESCRIPTION
[0038] In the following description, specific details such as particular system structures and techniques are provided for purposes of illustration, not limitation, to facilitate a thorough understanding of the embodiments of the present invention. However, it will be apparent to those skilled in the art that the present invention may be practiced in other embodiments without these specific details. In other cases, detailed descriptions of well-known systems, devices, circuits, and methods are omitted so as not to obscure the description of the present invention with unnecessary detail.
[0039] It will be understood that when used in this specification and the appended claims, the term "comprising" indicates the presence of described features, integers, steps, operations, elements and / or components, but does not preclude the presence or addition of one or more other features, integers, steps, operations, elements, components and / or groups thereof.
[0040] It should also be understood that the terms used in the present specification are only for the purpose of describing particular embodiments and are not intended to limit the present invention. As used in the present specification and the appended claims, the singular forms "a", "an", and "the" are intended to include the plural forms unless the context clearly indicates otherwise.
[0041] As used in this specification and the appended claims, the term "if" can be interpreted as "when" or "upon" or "in response to determining" or "in response to detecting," depending on the context. Similarly, the phrase "if it is determined" or "if [described condition or event] is detected" can be interpreted as meaning "upon determination" or "in response to determining" or "upon detection of [described condition or event]" or "in response to detecting [described condition or event]," depending on the context.
[0042] The following is a clear and complete description of the technical solutions in the embodiments of the present invention, in conjunction with the accompanying drawings of the embodiments of the present invention. Obviously, the described embodiments are only part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without making creative efforts are within the scope of protection of the present invention.
[0043] In the following description, many specific details are set forth to facilitate a full understanding of the present invention. However, the present invention may also be implemented in other ways different from those described herein. Those skilled in the art may make similar generalizations without violating the connotation of the present invention. Therefore, the present invention is not limited to the specific embodiments disclosed below.
[0044] The development of AI technology often relies on the processing of massive amounts of data, which places very high demands on computing power. The Ascend AI processor is a high-computing processor launched to meet the characteristics of such computationally intensive tasks. The Ascend AI processor adopts the Da Vinci architecture, and its computing core is mainly composed of the AI Core. Figure 1 This is a schematic diagram of the Huawei Da Vinci AI Core architecture provided by an embodiment of the present invention. Figure 1As shown, the AI Core includes three basic computing units: the Cube Unit, the Vector Unit, and the Scalar Unit, corresponding to the three common computation types of matrices, vectors, and scalars. The Cube Unit is responsible for matrix multiplication. If the input data type is float16, each execution can perform the multiplication of two 16*16 matrices. If the input data type is int8, each execution performs the multiplication of two 16*32 and 32*16 matrices, that is, C = A*B. A, B, and C are stored in L0A, L0B, and L0C, respectively. The Vector Unit is responsible for vector calculations. Its computing power is lower than that of the Cube Unit, but it is more flexible. Commonly used data types are float16 and float32. It can process not only vectors, but also tensors of any dimension, as long as they are treated as one-dimensional vectors. The Scalar Unit mainly handles various types of scalar data operations and program flow control. These three computing units form three independent pipelines during the computation process, coordinating their execution under the unified system scheduling to maximize the AI Core's powerful computing power. Furthermore, a single Ascend AI chip includes multiple AI Cores, all of which share global memory (GM). Leveraging the parallel computing capabilities of multiple cores can significantly improve the performance of the Ascend AI processor.
[0045] CANN (Compute Architecture for Neural Networks) is a heterogeneous computing architecture launched by Huawei for AI scenarios. It provides a chip operator library and highly automated operator development tools. It connects the underlying hardware with the AI framework layer above, and through multi-level programming interfaces, enables users to fully utilize the computing power of Ascend AI processors. To meet diverse user needs, CANN provides custom operator development capabilities based on the TVM (Tensor Virtual Machine) framework. Neural network operators can be developed using the API and custom operator programming interface provided by the TBE (Tensor Boost Engine). Currently, the Ascend AI software stack offers two development methods: DSL (Domain-Specific Language) development, which pre-defines the scheduling of some common operations and encapsulates them into interfaces. Developers use these pre-defined interfaces to express the operator's computational logic, and then use the automatic scheduling mechanism to automatically generate target code to complete the operator writing. The second method is development using the TIK (Tensor Iterator Kernel) module, a Python-based dynamic programming framework that provides buffer management and automatic data synchronization. These two operator development methods provide users with different levels of abstraction. Generally speaking, the TIK development method is more difficult, but the operators developed tend to achieve higher performance.
[0046] While the Ascend AI processor has achieved impressive results in AI task processing, its underlying operator support remains limited, hindering the development of higher-level applications. For example, in scientific computing, the SVD operation is a common matrix calculation process in mathematics. It can be used to accelerate matrix inversions and approximate decomposition of large matrices, playing a crucial role in signal processing, image compression, tensor networks, and second-order optimization. Existing technologies support SVD operations by running corresponding SVD functions on multiple computing platforms, including x86, ARM, and GPUs. However, the current Ascend AI processor's foundational library, CANN, lacks a supporting API, significantly limiting its potential. Therefore, the existing technology lacks an SVD operator that can run on Ascend AI processors, making it impossible to perform SVD operations on Ascend AI processors and hindering the full utilization of their computing power.
[0047] Figure 2 This is a schematic diagram of SVD decomposition of a matrix provided by an embodiment of the present invention, such as Figure 2As shown, the SVD decomposition of a matrix refers to decomposing an arbitrary matrix A (M×N) into the product of three matrices, that is where S
[0051] is a diagonal matrix, and its diagonal elements are called the singular values of matrix A. When K = N, the above equation is strictly equal; when K < min(M, N), the matrix product on the right side is an approximate expression of the left matrix. Here, K, M, and N represent the dimensions of the matrix, and K represents that the matrix to be decomposed contains the first K largest singular values. SVD is a function in the well-known linear algebra computing library LAPACK, and it can already run on multiple computing platforms such as x86, arm, and GPU. Currently, there is no relevant implementation in the operator library provided by CANN, and the Ascend AI processor cannot support SVD matrix calculation. The fundamental reason is that the hardware and underlying instructions of the Ascend AI processor are different from those of general CPUs. For example, the BLAS math library that can be called on a CPU cannot run on GPU hardware. Therefore, when some applications based on the Ascend AI processor need to rely on the SVD operator, these applications cannot be built on the Ascend AI processor.
[0048] To solve the problems of the prior art, the present invention provides a method for implementing singular value decomposition operations. In an embodiment of the present invention, a singular value decomposition operator is constructed, where the singular value decomposition operator is used to move data in a target device and perform singular value decomposition operations; the singular value decomposition operator is deployed to the target device, where the target device is an Ascend AI processor; obtain data to be processed, and perform singular value decomposition operations on the data to be processed based on the deployed singular value decomposition operator. Compared with the prior art, in the solution of the present invention, a singular value decomposition operator that can move data in the Ascend AI processor and perform singular value decomposition operations is constructed, and the singular value decomposition operator is deployed to the Ascend AI processor, which is beneficial to making full use of the computing power of the Ascend processor and directly performing SVD operations on the data to be processed based on the Ascend AI processor.
[0049] As Figure 3 shown, an embodiment of the present invention provides a method for implementing singular value decomposition operations. Specifically, the method includes the following steps:
[0050] Step S100, construct a singular value decomposition operator, where the singular value decomposition operator is used to move data in a target device and perform singular value decomposition operations.
[0051] In this embodiment, the singular value decomposition operator is a function that can be compiled and run in a target device. The singular value decomposition operator is used to perform operations for singular value decomposition of a matrix.
[0052] Step S200: deploy the singular value decomposition operator to the target device, where the target device is an Ascend AI processor.
[0053] Specifically, the singular value decomposition operator is deployed on the target device and compiled and run, enabling the target device to call the singular value decomposition operator to transfer data and perform singular value decomposition operations. In this embodiment, the target device is an Ascend AI processor. In actual use, the target device can also be other processors or devices, and is not specifically limited here.
[0054] Step S300: Obtain data to be processed, and perform a singular value decomposition operation on the data to be processed based on the deployed singular value decomposition operator.
[0055] The data to be processed is data requiring singular value decomposition (SVD), such as a matrix. In one application scenario, the matrix requiring SVD can be input into the Ascend AI processor as a data stream. The data stream is partitioned by pre-setting or real-time inputting the number of rows and columns of the matrix to determine the corresponding matrix.
[0056] As can be seen from the above, in the implementation method of the singular value decomposition operation provided by the embodiment of the present invention, a singular value decomposition operator is constructed, wherein the singular value decomposition operator is used to move data in the target device and perform a singular value decomposition operation; the singular value decomposition operator is deployed in the target device, wherein the target device is an Ascend AI processor; the data to be processed is obtained, and a singular value decomposition operation is performed on the data to be processed based on the deployed singular value decomposition operator. Compared with the existing technology, the solution of the present invention constructs a singular value decomposition operator that can move data in the Ascend AI processor and perform a singular value decomposition operation, and deploys the singular value decomposition operator in the Ascend AI processor, which is conducive to fully utilizing the computing power of the Ascend processor and directly performing SVD operations on the data to be processed based on the Ascend AI processor.
[0057] Specifically, in this embodiment, the above-mentioned construction of the singular value decomposition operator (i.e., SVD operator) includes: constructing a sub-function of the above-mentioned singular value decomposition operator based on the algorithm flow of singular value decomposition, wherein the above-mentioned algorithm flow is the flow corresponding to the power iteration method.
[0058] To achieve a high-performance SVD operator, we used TIK to write the operator, employing the power iteration algorithm. The power iteration method is a mathematical algorithm for finding the eigenvalues of a matrix. The idea is that the eigenvector corresponding to the largest eigenvalue of a matrix contains the most information about the matrix. Specifically, a random vector is multiplied by the original matrix, the resulting vector is normalized, and then multiplied by the original matrix again. This process is repeated repeatedly, resulting in the resulting vector being the eigenvector corresponding to the largest eigenvalue of the matrix. Since the SVD decomposition process implemented using the power iteration method primarily consists of vector and matrix-vector operations, without matrix multiplication, the SVD operator can be implemented using a vector computation unit. In AI Core, a vector computation unit is divided into eight blocks, each 32 bytes in size. If the input data is float16 (2 bytes), a single vector computation unit call can simultaneously compute 128 data items. Multiple calls to the vector computation unit incur additional overhead, so AI Core allows multiple repeated calculations within a single call. Due to hardware limitations, the maximum number of repetitions is 255. Therefore, it can be considered that a call to the vector computing unit can simultaneously calculate a maximum of 255*128=32640 float16 data. In addition, the vector computing unit has its own cache Unified Buffer (UB), which is 256KB in size. When calculating, the vector computing unit will automatically read data from the UB and write it back, and the data needs to be 32B aligned in the cache. The data in the UB needs to be moved in from the GM. The GM space is very large, such as the Ascend910 training chip, which is 32GB in size. For a large tensor, the data needs to be moved from the GM to the UB in blocks, and then divided into blocks and placed in the vector computing unit for calculation. After the calculation, it is moved from the UB to the GM. The data transportation process is as follows: Figure 4 shown.
[0059] The operator implementation process is divided into two stages: the first stage analyzes the SVD algorithm flow and designs the modules with repeated calculations as SVD sub-functions. Specifically, it includes the following four sub-functions:
[0060] The implementation process of the singular value decomposition operator is divided into two stages. The first stage analyzes the SVD algorithm flow and designs the modules with repeated calculations as sub-functions of SVD.
[0061] Specifically, the subfunctions of the singular value decomposition operator include: a vector normalization subfunction, a matrix multiplication subfunction, a vector multiplication subfunction, and a vector orthogonalization subfunction. Decomposing the singular value decomposition operator into four subfunctions facilitates the separate design and deployment of each subfunction to implement the SVD operation.
[0062] In this embodiment, the vector normalization sub-function is used to: perform data transfer and calculation on the vector to be normalized in blocks, and obtain the normalized vector of the vector to be normalized and the modulus of the vector to be normalized.
[0063] Specifically, for the vector normalization sub-function, input a vector to be normalized V_in, return a normalized vector V_out and the modulus of the vector, and the sum of the squares of the elements of V_out is 1. The space size of UB is 256KB, of which 248KB can be used for the vector calculation unit, which can store 248*1024 / 2=126976 float16 data. For the SVD operator, the length of the vector to be used is much smaller than this value. Therefore, the vector can be stored completely in UB, which can save the process of batch moving data from GM to UB. The specific implementation steps of the above vector normalization sub-function are as follows:
[0064] (1) In order to reduce the number of data transfers and improve efficiency, the data V_in in UB is transferred to the vector calculation unit to participate in the calculation to the maximum extent. The maximum processing data volume of the vector calculation unit (the maximum number of data that the vector calculation unit can process at one time) is obtained, and based on the above maximum processing data volume, the data in UB is divided into blocks and sent to the vector calculation unit for calculation. Specifically, for float16 data, the vector calculation unit can fill 128 numbers at a time (if it is float32, the data volume is halved). Since the interface of the vector calculation unit can repeat the calculation up to 255 times in one call, the data in UB can be divided into blocks according to 255*128=32640 numbers (that is, the maximum processing data volume is 32640, and each block is divided into 32640 numbers) and sent to the vector calculation unit for calculation. Then, the built-in vec_mul function of TIK is called to calculate the dot product of the vector and the vector (the number of repetitions is 255), and then the built-in function vec_reduce_add is called to sum the above dot product results.
[0065] (2) For the remaining data that cannot be divided into blocks in step (1), calculate the number of times the vector function is called repeatedly (less than 255), divide the remaining number by 128 and round it up, and then call the vector calculation unit to calculate. Similarly, first call the vec_mul function to calculate the product of each element with itself, and then call the vec_reduce_add function to accumulate the sum.
[0066] (3) Finally, for the data left in step (2) that is not enough for the vector calculation unit to process at one time (less than 128 float16 data), only one vector calculation function needs to be called. It should be noted that when calling vec_reduce_add, an appropriate mask must be set to avoid adding irrelevant data to the vector square sum to ensure the correctness of the result.
[0067] (4) Sum the reduction results from the three steps above to obtain the sum of the squares of all elements of the input vector V_in. Then, use the scalar_sqrt interface function of the scalar calculation unit to obtain the vector norm (the vector's modulus, i.e., the sum of the squares of all elements and then the square root), and take the reciprocal to obtain inv_norm. Finally, call the vector scalar product function vec_muls, repeat the above steps (1) to (3), and again multiply the input vectors by inv_norm in blocks to obtain the output vector V_out.
[0068] Here, step (1) calculates the maximum number of vector unit calls (255 repetitions), step (2) calculates the number of vector unit repetitions required (less than 255), and step (3) calculates the remaining data in step (2) that can be processed in one pass. Because the buffer is too small, the amount of data that the vector unit can process at one time is also limited. Therefore, the data can only be sent to the vector unit in batches to be processed.
[0069] Vec_mul and vec_reduce_add are the low-level function interfaces built into TIK. vec_mul performs dot multiplication of two vectors to a new vector, and vec_reduce_add sums all the elements in a vector.
[0070] It should be noted that in the calculation process of the sub-functions or operators described below, the data also needs to be moved in blocks before calculation, but this will not be described in detail.
[0071] In this embodiment, the matrix multiplication quantum function is used to perform data transfer and calculation on matrices and vectors corresponding to the matrix multiplication quantum function in batches to obtain output vectors.
[0072] The matrices and vectors corresponding to the matrix multiplication quantum function are the matrices and vectors that are input to the matrix multiplication quantum function and need to be processed. Specifically, for the matrix multiplication quantum function, the input is the matrix A(M, N) and the vector V_in(N), and the output is the vector V_out(M). Since the space occupied by vectors in SVD is relatively small, it can be considered that both the input and output vectors are stored in UB. However, the input matrix may be large, so there are two cases: the matrix is stored in UB and stored in GM, which are respectively suitable for calculating the SVD decomposition of small-scale matrices and large-scale matrices. It is only necessary to move the data according to the needs during the calculation process. Among them, M and N represent the dimensions of the corresponding matrix. Figure 5 Schematic diagram of a matrix multiplication vector provided by an embodiment of the present invention, such as Figure 5 As shown, each time a row of the matrix is taken out and the inner product is performed with the vector, an element of the output vector is obtained. The specific implementation steps of the above matrix multiplication quantum function are as follows:
[0073] (1) Matrix preprocessing: When matrices are stored in UB, it is necessary to pay attention to the 32-byte alignment restriction. The number of columns N must be compensated to 32-byte alignment (usually padded with 0), assuming that it is padded with N_ex. Among them, N is the number of columns of the original matrix, and N_ex is the number of columns expanded after byte alignment. When the data is float16 data, N_ex is 32-byte aligned and is a multiple of 16; when the data is float32 data, N_ex is a multiple of 8. Specifically, for float16 data, one byte is 8 bits, and 32 bytes is 8*32=256 bits, which is exactly 256 / 16=16 float16 type (16-bit) data. When the matrix is stored in GM, there is no such restriction.
[0074] (2) Through TIK's for_range loop (assuming the loop variable is i, the for_range loop means looping when i is within a certain range), for_range can identify scalar data (that is, the data stored in the scalar computing unit in the Ascend AI processor), and take out one row of matrix A for calculation each time. Consider matrix A as a one-dimensional vector. When the matrix is in UB, the starting displacement of the i-th row is offset = i * N_ex. When the matrix is in GM, the displacement of the matrix is offset = i * N. For the case where the matrix is stored in GM, it is necessary to call the TIK built-in function data_move to copy the data of the i-th row to UB. Let the vector taken out for the next calculation be V_tmp.
[0075] (3) Calculate the inner product of vector V_tmp and V_in for each row of matrix A. Call vec_mul to calculate the product of the corresponding elements of the vector, and then call the vec_reduce_add function to accumulate the above products. When calling these two functions, you still need to use the repeat parameter to reuse the function multiple times. In addition, when calling the reduction function vec_reduce_add, pay attention to the processing of the data tail. When the remaining data is not enough to fill the number of data processed by a vector calculation unit, use the mask parameter to ensure that the accumulated result is correct.
[0076] The repeat parameter limits the number of times the vector compute unit is called repeatedly and can be set and adjusted based on actual needs. Since each call to the vector compute unit incurs a certain amount of time overhead, the Ascend processor provides the ability to repeat the calculation multiple times with a single call. "repeat" is a parameter in the vector compute unit function interface; simply pass this parameter into the function interface (with an upper limit of 255). For example, if there are 255*128+256+20 data items to be processed, the vector compute unit should first be fed the maximum number of data items it can process (i.e., the maximum number of repetitions, 255, multiplied by the number of data items that can be filled in a single time, 128). For the remaining 256 data items, the repeat parameter should be set to 2 (since 128 data items can be processed at a time). Finally, for the remaining 20 data items, the repeat parameter should be set to 1. However, since 20 data items are not enough to fill a vector compute unit, the mask parameter should be set to 20 to indicate to the vector compute unit that only the first 20 data items need to be calculated. The overall goal is to minimize the number of data transfers by setting the repeat parameter, as each data transfer is time-consuming. The mask parameter is used to limit the number of elements that need to be considered in the calculation result of the vector calculation unit.
[0077] (4) Repeat steps (2) to (3) M times, and store the result of each calculation in V_out[i]. Here, i represents the i-th loop. The initial value of i can be set to 1, and it increases by 1 with each loop until all rows of matrix A are calculated.
[0078] In this embodiment, the above-mentioned vector-matrix multiplication sub-function is used to: perform data transfer and calculation on the vectors and matrices corresponding to the above-mentioned vector-matrix multiplication sub-function in batches to obtain output vectors.
[0079] Among them, the vector and matrix corresponding to the above-mentioned vector multiplication matrix sub-function are the vector and matrix that are input into the above-mentioned vector multiplication matrix sub-function and need to be processed. Specifically, for the above-mentioned vector multiplication matrix sub-function, the input is the vector V_in(M) and the matrix A(M, N), and the output is V_out(N). Similar to the matrix multiplication vector operator, here it is also divided into whether the matrix is stored in UB or GM, which will not be repeated. It should be noted that, considering that the matrix is stored linearly by row, it is most efficient to obtain the matrix elements according to each row, so the calculation method of vector multiplication matrix is different from that of matrix multiplication vector. Figure 6 is a schematic diagram of a vector multiplication matrix provided by an embodiment of the present invention, such as Figure 6 As shown, all elements of each row of the matrix are multiplied by the corresponding elements of the vector (such as v1, v2, v3, etc.) to obtain a new vector, and then all the new vectors are accumulated to obtain the output vector V_out. The specific implementation steps of the above vector-matrix multiplication subfunction are as follows:
[0080] (1) Set up N loops, with the loop variable i. Each time, take the i-th element of V_in and call the vec_muls function to multiply it by the i-th row vector of matrix A. Where N is the number of columns in matrix A, and the initial value of i is 1.
[0081] (2) Call the TIK built-in function vec_add to accumulate and sum the products of the row vectors of the above matrix A; the problem of data tail does not need to be considered here.
[0082] (3) Repeat steps (1) and (2) N times to obtain the output V_out.
[0083] It should be noted that the Vec_add function is a built-in function interface in TIK. It is used to sum two vectors, and the result is still a vector. The Vec_reduce_add function is used to sum all the elements in a vector, and the result is a number or a scalar.
[0084] In this embodiment, the vector orthogonalizer function is used to calculate and obtain an output vector based on the input vector and the normalized vector input into the vector orthogonalizer function, wherein the inner product of the input vector and the output vector is 0.
[0085] Specifically, for the vector orthogonalization subfunction, the input vector V1_in and the normalized vector V2_in are used, and the output vector V_out is required to have the inner product of the vectors V1_in and V_out be 0. The specific implementation steps of the above vector orthogonalization subfunction are as follows:
[0086] (1) Call the TIK built-in function vec_mul to calculate the product of V1_in and V2_in to obtain the temporary vector V_tmp.
[0087] (2) Call the TIK built-in function vec_reduce_add to accumulate the value of V_tmp to obtain sum_tmp. Pay attention to the processing of the data tail. The data tail refers to the data that cannot fill the entire vector calculation unit after the original whole block of data is divided into blocks. You can refer to the description of steps (2) and (3) in the vector normalization subfunction to process the tail data.
[0088] (3) Call the TIK built-in function vec_muls to multiply the vector V1_in by sum_tmp (equivalent to the inner product of V1_in and V2_in).
[0089] (4) Call the TIK built-in function vec_sub and subtract the result of (3) from V2_in to obtain V_out.
[0090] Specifically, in this embodiment, the singular value decomposition operator is constructed based on all the above sub-functions, including: based on the vector normalization sub-function, the matrix multiplication sub-function, the vector multiplication matrix sub-function, and the vector orthogonalization sub-function, and the singular value decomposition operator is written through TIK. Thus, an efficient singular value decomposition operator is obtained.
[0091] Furthermore, the above-mentioned acquisition of the data to be processed and the performance of the singular value decomposition operation on the above-mentioned data to be processed based on the deployed singular value decomposition operator include: acquiring the data to be processed and, based on the power iteration method, calling the sub-function of the above-mentioned singular value decomposition operator to perform the singular value decomposition operation on the above-mentioned data to be processed.
[0092] In this embodiment, the singular value decomposition operation is performed specifically through the following steps:
[0093] Define the maximum number of iterations max_iter for calculating each singular value, and the numerical precision constant eps;
[0094] Define temporary variables L(M) and L′(M) for the left eigenvector and temporary variables R(N) and R′(N) for the right eigenvector;
[0095] Define the singular value vector S(K), the left and right eigenvector matrices are U(K, M) and V(K, N) respectively;
[0096] Define diff as the modulus of the difference between the left eigenvectors of two iterations, and define norm as the normalization factor of the vector during the iteration.
[0097] Input the matrix A(M, N) to be decomposed and the parameter K, where K represents the first K largest singular values to be taken during the decomposition process, that is, the number of singular values to be calculated;
[0098] Take the value of ind from 0, 1, ..., K-1 in sequence each time;
[0099] Randomly initialize the left eigenvector L and reset diff to 1.0;
[0100] Start the singular value iteration step, the number of iterations iter each time from 0, 1, 2, ..., max_iter-1, max_iter value:
[0101] If iter = max_iter, exit the current loop and proceed to the next step; otherwise, execute the following steps:
[0102] Call the vector-matrix multiplication operator with the matrix A and vector L as input to obtain the vector R′;
[0103] Call the vector normalization operator with input R′ and return R′ and the normalization factor norm;
[0104] If the normalization factor norm is less than the precision eps, exit the current loop;
[0105] Call the vector orthogonalization operator so that R′ is orthogonal to the first ind rows of the right characteristic matrix V. Each time the input is R′ and a row of the right characteristic matrix V, the output is R′;
[0106] Call the vector normalization operator with input R′ and return R′ and the normalization factor norm;
[0107] Call the matrix-vector multiplication operator with the input matrix A and vector R′ and the output L′;
[0108] Call the vector normalization operator with input L′ and output L′ and normalization factor norm;
[0109] Use s to store norm;
[0110] When the normalization factor norm is less than the precision eps, exit the current loop and proceed to the next step, otherwise, proceed to the above loop;
[0111] Call the vector orthogonalization operator to make L′ orthogonal to the first ind rows of the left characteristic matrix U. Each time the input is L′ and a row of the left characteristic matrix V, the output is L′;
[0112] Call the vector normalization operator, the output is L′, and return L′ and the normalization factor norm;
[0113] Calculate the modulo diff of the difference between L and L′;
[0114] Replace L′ and R′ with the values of L and R respectively;
[0115] If the value of s is greater than the precision eps:
[0116] Store s into S[ind];
[0117] Store the left eigenvector L in the ind-th row of the left eigenmatrix U;
[0118] Store the right eigenvector R in the ind-th row of the right eigenmatrix V;
[0119] Returns the singular value vector S, the left eigenvector U, and the right eigenvector V.
[0120] Here, max_iter represents the maximum number of iterations for each singular value calculated using the power iteration method, and eps represents the numerical precision. If the precision reaches eps before the specified precision is reached, the iteration terminates and the calculation of the next singular value begins. If the number of iterations exceeds max_iter but the specified precision eps is not reached, the iteration of the current singular value is terminated and the calculation of the next singular value begins. K is a customizable value whose value should be less than or equal to min(M, N). L(M) and L′(M) are both vectors of length M; similarly, R(N) and R′(N) are both vectors of length N. They both represent the eigenvectors of the matrix. Diff is the magnitude of the difference between the two iterations of the left eigenvector of the matrix, and norm is the magnitude of the eigenvector. In the power iteration method of SVD, this is exactly the singular value of the matrix to be decomposed. s is the variable that stores the singular values of the matrix. L represents the left eigenvector of the matrix and can be randomly initialized. However, TIK does not provide a random function interface. In the actual calculation process, it is replaced by a normalized vector of all 1s. Normalizing R′(N) modifies the value of R′(N) in place. In the SVD decomposition, K specifies the first K largest singular values to be calculated. ind takes values from 0 to K-1, representing the index of the largest singular value, the index of the second largest singular value, and so on.
[0121] In this way, the Ascend AI processor provides an SVD decomposition solution for matrices of any size, and can flexibly decide to perform SVD decomposition on only the first K largest singular values of the matrix by specifying K, providing necessary support for related applications that rely on the SVD operator on the Ascend AI processor.
[0122] It should be noted that the above SVD operator can be specifically applied to the following scenarios, for example: Matrix inversion: For the SVD decomposition of matrix A A = USV, the inverse of matrix A can be expressed as A -1 =US -1Since S is a diagonal matrix, its inverse is the reciprocal of all diagonal elements. Matrix inversion is widely used in matrix computations. Matrix approximation: When performing SVD decomposition on matrix A, the singular values are arranged from largest to smallest on the diagonal elements of matrix S. Their magnitudes reflect the proportion of the corresponding eigenvectors in the entire matrix. Therefore, the K largest singular values before decomposition can be selected to approximate the original matrix. Tensor network computation: SVD decomposition is a common computational procedure in tensor networks. By truncating the singular values of high-dimensional tensors, SVD can significantly reduce computational effort while maintaining high accuracy, accelerating tensor network computations. Other specific applications include solving homogeneous linear equations, total least squares methods, separable models, signal processing, image processing, quantum information, and recommender systems. This effectively leverages the computing power of the Ascend AI processor and improves data processing speed. In the singular value decomposition operation implementation method of this embodiment, based on the characteristics of the Ascend AI processor, TIK is used to implement a high-performance SVD operator, which includes 4 basic sub-functions. Based on the characteristics of the vector computing unit, the data handling, memory access and calculation process of the 4 sub-functions are finely controlled to maximize the computing power of the AI Core while ensuring the accuracy of the calculation results. This embodiment also illustrates the performance of the above-mentioned singular value decomposition operation implementation method based on specific test results. The specific test results are shown in the following table:
[0123]
[0124] Specifically, the singular value decomposition operation implementation method provided by the embodiment of the present invention can obtain very high precision under the given data type. For example, using the float16 data type, the calculated singular value can reach 2 significant digits. If higher precision is required, it can be conveniently changed to the float32 data type. And as shown in the above table, compared with the method written in C++ or numpy, the SVD operator written using TIK provided by the embodiment of the present invention has better performance and lower decomposition time, and as the size of the matrix to be decomposed increases, the advantage of decomposition time is more obvious. For example, when the input matrix is 128×256, the performance of the SVD written by TIK is more than 20 times that of the C++ version (running on an aarch64 CPU).
[0125] like Figure 7 As shown, corresponding to the above-mentioned singular value decomposition operation implementation method, an embodiment of the present invention further provides a singular value decomposition operation implementation device, and the above-mentioned singular value decomposition operation implementation device includes:
[0126] The operator construction module 410 is used to construct a singular value decomposition operator, wherein the singular value decomposition operator is used to transport data in the target device and perform a singular value decomposition operation.
[0127] In this embodiment, the singular value decomposition operator is a function that can be compiled and run in the target device. The singular value decomposition operator is used to perform a singular value decomposition operation on a matrix.
[0128] The operator deployment module 420 is used to deploy the above-mentioned singular value decomposition operator to the above-mentioned target device, wherein the above-mentioned target device is an Ascend AI processor.
[0129] Specifically, the singular value decomposition operator is deployed on the target device and compiled and run, enabling the target device to call the singular value decomposition operator to transfer data and perform singular value decomposition operations. In this embodiment, the target device is an Ascend AI processor. In actual use, the target device can also be other processors or devices, and is not specifically limited here.
[0130] The operation module 430 is used to obtain the data to be processed and perform a singular value decomposition operation on the data to be processed based on the deployed singular value decomposition operator.
[0131] The data to be processed is data requiring singular value decomposition (SVD), such as a matrix. In one application scenario, the matrix requiring SVD can be input into the Ascend AI processor as a data stream. The data stream is partitioned by pre-setting or real-time inputting the number of rows and columns of the matrix to determine the corresponding matrix.
[0132] As can be seen from the above, the singular value decomposition operation implementation device provided by the embodiment of the present invention can be used to: construct a singular value decomposition operator, wherein the singular value decomposition operator is used to move data in the target device and perform a singular value decomposition operation; deploy the singular value decomposition operator to the target device, wherein the target device is an Ascend AI processor; obtain data to be processed, and perform a singular value decomposition operation on the data to be processed based on the deployed singular value decomposition operator. Compared with the existing technology, the solution of the present invention constructs a singular value decomposition operator that can move data in the Ascend AI processor and perform a singular value decomposition operation, and deploys the singular value decomposition operator to the Ascend AI processor, which is conducive to fully utilizing the computing power of the Ascend processor and directly performing SVD operations on the data to be processed based on the Ascend AI processor.
[0133] Specifically, the operator construction module 410 is used to construct a sub-function of the singular value decomposition operator based on the algorithm flow of singular value decomposition, wherein the algorithm flow is a flow corresponding to the power iteration method.
[0134] It should be noted that the specific functions corresponding to the above-mentioned singular value decomposition operation implementation device and its specific modules can be set and adjusted with reference to the above-mentioned singular value decomposition operation implementation method, and will not be repeated here.
[0135] Based on the above embodiment, the present invention also provides an intelligent terminal, whose principle block diagram can be shown as follows: Figure 8 As shown. The above-mentioned intelligent terminal includes a processor, a memory, a network interface and a display screen connected through a system bus. Among them, the processor of the intelligent terminal is used to provide computing and control capabilities. The memory of the intelligent terminal includes a non-volatile storage medium and an internal memory. The non-volatile storage medium stores an operating system and a singular value decomposition operation implementation program. The internal memory provides an environment for the operation of the operating system and the singular value decomposition operation implementation program in the non-volatile storage medium. The network interface of the intelligent terminal is used to communicate with an external terminal through a network connection. When the singular value decomposition operation implementation program is executed by the processor, the steps of any one of the above-mentioned singular value decomposition operation implementation methods are implemented. The display screen of the intelligent terminal can be a liquid crystal display screen or an electronic ink display screen.
[0136] Those skilled in the art will understand that Figure 8 The principle block diagram shown in the figure is only a block diagram of a partial structure related to the solution of the present invention and does not constitute a limitation on the smart terminal to which the solution of the present invention is applied. The specific smart terminal may include more or fewer components than shown in the figure, or combine certain components, or have a different component arrangement.
[0137] In one embodiment, a smart terminal is provided. The smart terminal includes a memory, a processor, and a singular value decomposition operation implementation program stored in the memory and executable on the processor. When the singular value decomposition operation implementation program is executed by the processor, the following operation instructions are performed:
[0138] Constructing a singular value decomposition operator, wherein the singular value decomposition operator is used to move data in the target device and perform a singular value decomposition operation;
[0139] Deploy the singular value decomposition operator to the target device, where the target device is an Ascend AI processor.
[0140] Obtain the data to be processed, and perform a singular value decomposition operation on the data to be processed based on the deployed singular value decomposition operator.
[0141] An embodiment of the present invention also provides a computer-readable storage medium, on which a singular value decomposition operation implementation program is stored. When the singular value decomposition operation implementation program is executed by a processor, the steps of any singular value decomposition operation implementation method provided in the embodiment of the present invention are implemented.
[0142] Optionally, the above-mentioned intelligent terminal and computer-readable storage medium may also store a singular value decomposition operation implementation program to implement the steps of the above-mentioned singular value decomposition operation implementation method.
[0143] It should be understood that the sequence numbers of the steps in the above embodiments do not imply a specific order of execution; the order of execution of each process should be determined by its function and internal logic, and should not constitute any limitation on the implementation process of the embodiments of the present invention.
[0144] Those skilled in the art can clearly understand that, for the convenience and brevity of description, only the division of the above-mentioned functional units and modules is used as an example for illustration. In actual applications, the above-mentioned functions can be distributed and completed by different functional units and modules as needed, that is, the internal structure of the above-mentioned device can be divided into different functional units or modules to complete all or part of the functions described above. The functional units and modules in the embodiment can be integrated into one processing unit, or each unit can exist physically alone, or two or more units can be integrated into one unit. The above-mentioned integrated unit can be implemented in the form of hardware or in the form of software functional units. In addition, the specific names of the functional units and modules are only for the convenience of distinguishing each other, and are not used to limit the scope of protection of the present invention. The specific working process of the units and modules in the above-mentioned system can refer to the corresponding process in the aforementioned method embodiment, and will not be repeated here.
[0145] In the above embodiments, the description of each embodiment has its own focus. For parts that are not described or recorded in detail in a certain embodiment, reference can be made to the relevant description of other embodiments.
[0146] Those skilled in the art will appreciate that the units and algorithm steps of each example described in conjunction with the embodiments disclosed herein can be implemented in electronic hardware, or a combination of computer software and electronic hardware. Whether these functions are performed in hardware or software depends on the specific application and design constraints of the technical solution. Professionals and technicians can use different methods to implement the described functions for each specific application, but such implementation should not be considered beyond the scope of the present invention.
[0147] In the embodiments provided by the present invention, it should be understood that the disclosed apparatus / terminal device and method can be implemented in other ways. For example, the apparatus / terminal device embodiments described above are merely illustrative. For example, the division of the modules or units described above is merely a logical functional division. In actual implementation, other division methods may be used. For example, multiple units or components may be combined or integrated into another system, or some features may be ignored or not implemented.
[0148] If the above-mentioned integrated module / unit is implemented in the form of a software functional unit and sold or used as an independent product, it can be stored in a computer-readable storage medium. Based on this understanding, the present invention implements all or part of the process in the above-mentioned embodiment method, and can also be completed by instructing the relevant hardware through a computer program. The above-mentioned computer program can be stored in a computer-readable storage medium. When the computer program is executed by the processor, it can implement the steps of the above-mentioned various method embodiments. Among them, the above-mentioned computer program includes computer program code, and the above-mentioned computer program code can be in source code form, object code form, executable file or some intermediate form. The above-mentioned computer-readable medium may include: any entity or device capable of carrying the above-mentioned computer program code, recording medium, USB flash drive, mobile hard disk, magnetic disk, optical disk, computer memory, read-only memory (ROM), random access memory (RAM), electric carrier signal, telecommunication signal and software distribution medium. It should be noted that the content contained in the above-mentioned computer-readable storage medium can be appropriately increased or decreased according to the requirements of legislation and patent practice in the jurisdiction.
[0149] The embodiments described above are only used to illustrate the technical solutions of the present invention, rather than to limit the same. Although the present invention has been described in detail with reference to the aforementioned embodiments, it should be understood by those skilled in the art that the technical solutions described in the aforementioned embodiments may still be modified, or some of the technical features thereof may be replaced by equivalents. However, these modifications or replacements do not deviate from the spirit and scope of the technical solutions of the embodiments of the present invention, and should all be included in the scope of protection of the present invention.
Claims
1. A method for implementing singular value decomposition operation, characterized in that: The method comprises: Constructing a singular value decomposition operator, wherein the singular value decomposition operator is used to move data in the target device and perform a singular value decomposition operation; Deploying the singular value decomposition operator to the target device, wherein the target device is an Ascend AI processor; Acquire data to be processed, and perform a singular value decomposition operation on the data to be processed based on the deployed singular value decomposition operator; The constructing of the singular value decomposition operator includes: constructing a sub-function of the singular value decomposition operator based on a singular value decomposition algorithm flow, wherein the algorithm flow is a flow corresponding to the power iteration method; the sub-functions of the singular value decomposition operator include: a vector normalization sub-function, a matrix multiplication vector sub-function, a vector multiplication matrix sub-function, and a vector orthogonalization sub-function; the vector normalization sub-function is used to: perform data handling and calculation on blocks of a vector to be normalized, and obtain a normalized vector of the vector to be normalized and a modulus of the vector to be normalized; Based on the vector normalization subfunction, the matrix multiplication vector subfunction, the vector multiplication matrix subfunction and the vector orthogonalization subfunction, the singular value decomposition operator is written through TIK.
2. The singular value decomposition operation implementation method according to claim 1, characterized in that: The matrix multiplication quantum function is used to: perform data transfer and calculation on the matrix and vector corresponding to the matrix multiplication quantum function in batches to obtain output vectors.
3. The singular value decomposition operation implementation method according to claim 1, characterized in that: The vector-matrix multiplication sub-function is used to: perform data transfer and calculation on the vectors and matrices corresponding to the vector-matrix multiplication sub-function in batches to obtain output vectors.
4. The singular value decomposition operation implementation method according to claim 1, characterized in that: The vector orthogonalizer function is used to calculate and obtain an output vector based on an input vector and a normalized vector input into the vector orthogonalizer function, wherein an inner product of the input vector and the output vector is 0.
5. The singular value decomposition operation implementation method according to claim 1, characterized in that: The step of obtaining the data to be processed and performing a singular value decomposition operation on the data to be processed based on the deployed singular value decomposition operator includes: The data to be processed is obtained, and based on the power iteration method, a sub-function of the singular value decomposition operator is called to perform a singular value decomposition operation on the data to be processed.
6. A device for implementing singular value decomposition operation, characterized in that: The device comprises: An operator construction module, used to construct a singular value decomposition operator, wherein the singular value decomposition operator is used to move data in the target device and perform a singular value decomposition operation; An operator deployment module, configured to deploy the singular value decomposition operator to the target device, wherein the target device is an Ascend AI processor; An operation module, configured to obtain data to be processed and perform a singular value decomposition operation on the data to be processed based on a deployed singular value decomposition operator; The operator construction module is specifically used to: construct a sub-function of the singular value decomposition operator based on the singular value decomposition algorithm process, wherein the algorithm process is a process corresponding to the power iteration method; the sub-functions of the singular value decomposition operator include: a vector normalization sub-function, a matrix multiplication vector sub-function, a vector multiplication matrix sub-function and a vector orthogonalization sub-function; the vector normalization sub-function is used to: perform data handling and calculation on the blocks of the vector to be normalized, and obtain the normalized vector of the vector to be normalized and the modulus of the vector to be normalized; Based on the vector normalization subfunction, the matrix multiplication vector subfunction, the vector multiplication matrix subfunction and the vector orthogonalization subfunction, the singular value decomposition operator is written through TIK.
7. An intelligent terminal, characterized in that: The intelligent terminal includes a memory, a processor, and a singular value decomposition operation implementation program stored in the memory and runnable on the processor. When the singular value decomposition operation implementation program is executed by the processor, the steps of the singular value decomposition operation implementation method as described in any one of claims 1 to 5 are implemented.
8. A computer-readable storage medium, characterized in that The computer-readable storage medium stores a singular value decomposition operation implementation program, which, when executed by a processor, implements the steps of the singular value decomposition operation implementation method according to any one of claims 1 to 5.
Citation Information
Patent Citations
Operator fusion method, system and device and storage medium
CN113065639A