Data processing method and device, processor, electronic equipment and storage medium

By partitioning weight gradient tensors and optimizing cache usage through a 'ping-pong' strategy, the method addresses inefficiencies in backpropagation operations, enhancing computational efficiency in convolutional neural networks.

CN120317289AActive Publication Date: 2025-07-15SHANGHAI BIREN TECH CO LTD

Patent Information

Application Number
CN202510804121.X
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-06-17
Publication Date
2025-07-15
Estimated Expiration
2045-06-17

AI Technical Summary

Technical Problem

The backpropagation operation performance of existing convolutional neural networks is low, cache access efficiency is low, cache utilization is not high, and a large amount of invalid data occupies memory and computing resources.

Method used

By splitting the weight gradient tensor into multiple sub-tensters according to 1×n granularity, and multiplexing the activated tensor elements in shared memory for calculation, reducing cache access and repeated loading, and improving computing efficiency.

Benefits of technology

Improve the performance of backpropagation operations, reduce cache access overhead, improve the utilization rate of cache and hardware resources, reduce the participation of invalid data, and improve the computing intensity.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120317289A_ABST
    Figure CN120317289A_ABST
Patent Text Reader

Abstract

The invention discloses a data processing method and device, a processor, electronic equipment and a storage medium. The data processing method comprises the following steps: executing multiple first operations to obtain a plurality of weight gradient sub-tensors, wherein each weight gradient sub-tensor is a part divided by the weight gradient tensor according to 1 * n granularity; the first operation comprises the steps that a plurality of first elements of the input gradient tensor and a plurality of second elements of the activation tensor are loaded to a second cache from a first cache, the second elements are the elements corresponding to the target sub-tensor in the activation tensor, and the weight gradient tensor is obtained through the arrangement of the multiple weight gradient sub-tensors. Reading a plurality of first elements from the second cache to a tensor calculation module; and the tensor calculation module multiplexes the plurality of second elements to execute n times of second operations to obtain a target sub-tensor, wherein each second operation is used for obtaining a target element in the target sub-tensor. The method can reduce the access of the cache and improve the utilization rate of the cache.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] Embodiments of the present disclosure relate to a data processing method, a data processing apparatus, a processor, an electronic device, and a non-transitory computer-readable storage medium. Background Art

[0002] A Convolutional Neural Network (CNN) is a deep learning algorithm mainly applied to the field of computer vision in the field of deep learning, and has wide applications in fields such as image recognition, speech recognition, video recognition, and natural language processing. Summary of the Invention

[0003] At least one embodiment of the present disclosure provides a data processing method, which at least partially alleviates the technical problem of low performance of backpropagation operations, and realizes the technical effects of improving the performance of backpropagation operations, reducing cache access, and improving cache utilization.

[0004] At least one embodiment of the present disclosure provides a data processing method for performing an operation on an input gradient tensor and an activation tensor during backpropagation to obtain a weight gradient tensor. The method includes: performing a plurality of first operations to obtain a plurality of weight gradient sub-tensors, where the weight gradient tensor includes a height direction and a width direction, and each weight gradient sub-tensor is a part of the weight gradient tensor divided according to a 1×n granularity within a two-dimensional matrix formed by the height direction and the width direction, and n is an integer greater than 1; and arranging the plurality of weight gradient sub-tensors to obtain the weight gradient tensor, and each time the first operation is performed to obtain a target sub-tensor among the plurality of weight gradient sub-tensors. The first operation includes: loading a plurality of first elements of the input gradient tensor and a plurality of second elements of the activation tensor from a first cache to a second cache, where the plurality of second elements are a plurality of elements in the activation tensor corresponding to the target sub-tensor; reading the plurality of first elements from the second cache to a tensor calculation module; and the tensor calculation module reusing the plurality of second elements to perform n second operations to obtain the target sub-tensor, where each second operation is used to obtain a target element in the target sub-tensor, and the second operation includes: reading the plurality of second elements to obtain a plurality of third elements required for the second operation; and determining the target element based on the plurality of first elements and the plurality of third elements.

[0005] At least one embodiment of the present disclosure further provides a processor, including an instruction parsing unit and an execution unit. The instruction parsing unit is configured to receive and parse data processing instructions, where the data processing instructions are used to perform arithmetic operations on an input gradient tensor and an activation tensor during backpropagation to obtain a weight gradient tensor. After the instruction parsing unit parses the data processing instructions, the execution unit executes the data processing method provided in any embodiment of the present disclosure.

[0006] At least one embodiment of the present disclosure further provides a data processing device for performing arithmetic operations on an input gradient tensor and an activation tensor during backpropagation to obtain a weight gradient tensor. The device includes: an execution module configured to perform a plurality of first operations to obtain a plurality of weight gradient subtensors. The weight gradient tensor includes a height direction and a width direction, and each weight gradient subtensor is a part of the weight gradient tensor divided at a granularity of 1×n within a two-dimensional matrix formed by the height direction and the width direction of the weight gradient tensor, where n is an integer greater than 1; and arranging the plurality of weight gradient subtensors to obtain the weight gradient tensor. Each time the first operation is performed, a target subtensor among the plurality of weight gradient subtensors is obtained. The execution module includes: a loading module and a tensor calculation module. The loading module is configured to load a plurality of first elements of the input gradient tensor and a plurality of second elements of the activation tensor from a first cache to a second cache, where the plurality of second elements are a plurality of elements of the activation tensor corresponding to the target subtensor; the tensor calculation module is configured to read the plurality of first elements from the second cache to the tensor calculation module; and reuse the plurality of second elements to perform n second operations to obtain the target subtensor. Each time the second operation is used to obtain a target element in the target subtensor. The tensor calculation module includes: a reading unit configured to read the plurality of second elements to obtain a plurality of third elements required for the second operation, and a calculation unit configured to determine the target element based on the plurality of first elements and the plurality of third elements.

[0007] At least one embodiment of the present disclosure further provides an electronic device, including: a memory storing computer-executable instructions non-transiently; a processor configured to run the computer-executable instructions, where the computer-executable instructions, when run by the processor, implement the data processing method provided in any embodiment of the present disclosure.

[0008] At least one embodiment of the present disclosure further provides a non-transient computer-readable storage medium storing computer-executable instructions, and the computer-executable instructions, when executed by a processor, implement the data processing method provided in any embodiment of the present disclosure. Description of the Drawings

[0009] To more clearly illustrate the technical solutions of the embodiments of the present disclosure, the accompanying drawings of the embodiments will be briefly introduced below. Obviously, the accompanying drawings in the following description only relate to some embodiments of the present disclosure and do not limit the present disclosure.

[0010] Figure 1 Shows a schematic diagram of a convolution operation;

[0011] Figure 2 Shows a schematic diagram of implementing convolution using implicit GEMM;

[0012] Figure 3 Is a schematic structural diagram of a general-purpose graphics processing unit (GPGPU);

[0013] Figure 4A Shows a schematic flowchart of a data processing method provided by at least one embodiment of the present disclosure;

[0014] Figure 4B Is a schematic diagram of an activation tensor;

[0015] Figure 4C Is a schematic diagram of a weight gradient tensor;

[0016] Figure 4D Shows that in at least one embodiment provided by the present disclosure, Figure 4C The weight gradient tensor shown is divided into multiple weight gradient subtensors according to a 1×3 granularity;

[0017] Figure 5A Shows a schematic diagram of obtaining a target subtensor by performing a first operation provided by at least one embodiment of the present disclosure;

[0018] Figure 5B Shows a schematic diagram of an input gradient subtensor obtained by dividing an input gradient tensor according to an [m,n'] granularity;

[0019] Figure 5C Shows a schematic diagram of multiple second elements in an activation tensor provided by at least one embodiment of the present disclosure;

[0020] Figure 5D Shows a schematic diagram of loading multiple first elements and multiple second elements from a global cache to a shared memory provided by at least one embodiment of the present disclosure;

[0021] Figure 6 Shows a flowchart of a method for determining the starting positions of multiple second elements provided by at least one embodiment of the present disclosure;

[0022] Figure 7Shows a schematic diagram of loading and activating multiple second elements in a tensor provided by at least one embodiment of the present disclosure;

[0023] Figure 8 Shows a flowchart of a method for reading multiple second elements to obtain multiple third elements required for a second operation provided by at least one embodiment of the present disclosure;

[0024] Figure 9A Shows a schematic diagram of a mask provided by at least one embodiment of the present disclosure;

[0025] Figure 9B Shows a schematic diagram of another mask provided by at least one embodiment of the present disclosure;

[0026] Figure 10 Is a schematic diagram of the ping-pong strategy provided by an embodiment of the present disclosure;

[0027] Figure 11 Is a schematic block diagram of a data processing device provided by at least one embodiment of the present disclosure;

[0028] Figure 12 Is a schematic structural diagram of a processor provided by at least one embodiment of the present disclosure;

[0029] Figure 13 Is a schematic block diagram of an electronic device provided by an embodiment of the present disclosure; and

[0030] Figure 14 Is a schematic diagram of a non-transitory computer-readable storage medium provided by at least one embodiment of the present disclosure. Detailed implementation manners

[0031] To make the objectives, technical solutions, and advantages of the embodiments of the present disclosure clearer, the technical solutions of the embodiments of the present disclosure will be clearly and completely described below with reference to the accompanying drawings of the embodiments of the present disclosure. Apparently, the described embodiments are some, but not all, of the embodiments of the present disclosure. All other embodiments obtained by those of ordinary skill in the art based on the described embodiments of the present disclosure without creative efforts shall fall within the scope of protection of the present disclosure.

[0032] Unless otherwise defined, the technical terms or scientific terms used in this disclosure shall have the ordinary meanings as understood by those of ordinary skill in the art to which this disclosure pertains. The terms "first", "second" and similar words used in this disclosure do not denote any order, quantity or importance, but are only used to distinguish different components. Similarly, words such as "a", "an" or "the" do not denote a quantity limitation, but mean that there is at least one. Words such as "comprising" or "including" mean that the elements or objects appearing before this word cover the elements or objects listed after this word and their equivalents, without excluding other elements or objects. Words such as "connected" or "coupled" are not limited to physical or mechanical connections, but may include electrical connections, whether direct or indirect. Words such as "upper", "lower", "left" and "right" are only used to indicate relative positional relationships. When the absolute position of the object being described changes, the relative positional relationship may also change accordingly.

[0033] The following describes this disclosure through several specific embodiments. To keep the following description of the embodiments of this disclosure clear and concise, detailed descriptions of known functions and known components are omitted. When any component of the embodiments of this disclosure appears in more than one drawing, the component is denoted by the same or similar reference numerals in each drawing.

[0034] Convolutional Neural Networks (CNNs) are a class of feedforward neural networks with convolutional computations and deep structures, and are one of the representative algorithms of deep learning. In a CNN, a convolutional kernel (or filter) is designed to perform a sliding window operation on an input tensor (such as an image) to compute the local features of the tensor. Specifically, the convolutional kernel slides on the input tensor with a certain stride and performs operations of local connection and weight sharing at each position. At each position, the convolutional kernel multiplies and sums the corresponding local regions (i.e., windows) of the input tensor element by element (and in some cases, an offset term is also added), thereby obtaining a single point on the output tensor (feature map). As the convolutional kernel slides on the input tensor, the entire output tensor of the image is computed. In the application scenario of image recognition, the input tensor here can be the pixels of the image. In the application scenario of speech recognition, the input tensor here can be audio data. In the application scenario of video recognition, the input tensor here can be video data. In the application scenario of natural language processing, the input tensor here can be natural language text.

[0035] In the CNN of a deep learning framework, edge padding is usually performed according to different requirements. For example, to make the size of the output tensor the same as that of the input tensor, the center of the convolutional kernel is usually aligned with the first point of the input tensor to determine the starting position of the convolutional kernel, and then the corresponding edge padding bits are filled.

[0036] Figure 1 Fig. shows a schematic diagram of a convolution operation.

[0037] As Figure 1 shown, for example, the shaded part filled with slashes is the input tensor, and the size of the convolutional kernel J is 3×3. To make the size of the output tensor the same as that of the input tensor, the four edges of the input tensor are edge-padded, so that the center E’0 of the convolutional kernel J is aligned with the first point E0 of the input tensor. Since the size of the convolutional kernel J is 3×3, the padding parameter is (1,1) (that is, 1 pixel size is padded around the input tensor, Figure 1 the white dotted square in). This can align the center E’0 of the convolutional kernel J with the first point E0 of the input tensor. For example, fill Figure 1 the area of the white dotted square in with 0.

[0038] The CNN of the deep learning framework is not limited to Figure 1 the way shown. For example, the sliding step of the convolutional kernel J can be arbitrary and is not limited to 1.

[0039] The convolution operation formula can be expressed as Output = Conv(Weight, Activation), where Activation represents the activation tensor (also known as the "input tensor" described above), and its tensor shape can be expressed as [N, H, W, C]. The N dimension is used to represent the number of batches, the W dimension is used to represent the width of the activation tensor, the H dimension is used to represent the height of the activation tensor, and the C dimension is used to represent the number of input channels. Weight represents the convolutional kernel tensor, and its tensor shape can be expressed as [R, S, K, C]. The R dimension is used to represent the height of the convolutional kernel, the S dimension is used to represent the width of the convolutional kernel, the C dimension is used to represent the number of input channels, and the K dimension is used to represent the number of output channels. Output represents the output tensor, and its tensor shape can be expressed as [N, P, Q, K]. The P dimension is used to represent the height of the output tensor, the Q dimension is used to represent the width of the output tensor, and the K dimension is used to represent the number of output channels. That is, when performing the convolution operation Conv(Weight, Activation), the edges of the activation tensor are usually padded so that the size of the output data after convolution is usually the same as the size of the input data. After edge padding, in a convolutional neural network, convolution can be equivalently transformed into matrix-vector multiplication, which can improve the efficiency of convolution calculation. Currently, convolution operations are usually implemented using the Implicit GEMM (Generalized Matrix-Matrix Multiply) algorithm. The Implicit GEMM algorithm formulates the convolution operation as a generalized matrix-matrix multiplication (GEMM). During the convolution process, the activation tensor is acted upon by a sliding filter (or convolutional kernel) to produce the output tensor. The Implicit GEMM algorithm avoids explicitly converting the activation tensor and the convolutional kernel into matrix form during the calculation process through coordinate mapping, thus saving storage space.

[0040] Figure 2 Figure shows a schematic diagram of implementing convolution using implicit GEMM. As Figure 2 shown, the response convolution operation is to perform a sliding window dot product calculation of K convolutional kernels of size C×R×S on N input tensors of size C×H×W, resulting in an output of N output tensors of size K×P×Q. The Implicit GEMM algorithm regards the convolutional kernel as a two-dimensional matrix of K×(C×R×S), and the input tensor is transformed into a two-dimensional matrix of (C×R×S)×(N×H×W) according to the position where the convolutional kernel sliding window slides, and then the two matrices are multiplied using matrix multiplication to obtain the output data. In this way, during the conversion process, the input data changes from [N, H, W, C] to [NHW, RSC], and the data volume expands by R×S times.

[0041] To enable the convolutional neural network to have powerful performance, the training process of the convolutional neural network is crucial. The trained convolutional neural network can be effectively applied to application fields such as image processing and machine translation. The training of the convolutional neural network usually includes two stages: forward propagation and backpropagation. In the forward propagation stage, the input tensor passes through network layers such as convolutional layers, pooling layers, and fully connected layers in sequence. Through layer-by-layer linear transformations (such as convolutional operations and matrix multiplications) and non-linear activations (such as ReLU and Sigmoid functions), the output result of the network is finally generated. This output result is compared with the true label, and the training error is calculated through a loss function (such as cross-entropy loss and mean squared error loss), providing an optimization goal for backpropagation. Backpropagation is the core mechanism for optimizing network parameters. The core idea of backpropagation is to use the chain rule. Starting from the loss function, the gradients of the parameters (mainly weights and biases) of each layer with respect to the loss function are calculated layer by layer in the reverse direction. Then, according to optimization algorithms such as gradient descent, the parameters are updated to minimize the loss function. The calculation of the gradient of the weights with respect to the loss function (also known as the "weight gradient") is a key link in backpropagation, and its accuracy directly affects the efficiency and performance of network training. The weight gradient is the partial derivative of the loss function with respect to the weight parameters of each layer in the network, which reflects the degree of influence of the change in the weight parameters on the loss function. The following describes the calculation method of the weight gradient. Assume the following basic symbol definitions in the convolutional neural network: the activation tensor Activation of the l-th layer (i.e., the output tensor of the (l - 1)-th layer); the weight W (l) represents the weight matrix of the l-th layer; the bias b (l) represents the bias vector of the l-th layer, and the loss function L is, for example, mean squared error or cross-entropy, etc.

[0042] First, perform forward propagation to obtain the output tensor z of the l-th layer (l) = W (l) Activation + b (l) .

[0043] Then, calculate the gradient tensor Gradient of the l-th layer. This gradient tensor Gradient is the gradient of the loss function L with respect to the output tensor z (l) . This gradient is usually a matrix of the same size as the output tensor. For example, the size of this gradient tensor Gradient is [N, P, Q, K].

[0044] Finally, perform a cross-correlation operation on the gradient tensor Gradient and the activation tensor Activation to obtain the weight gradient . That is:

[0045]

[0046] The essence of the cross-correlation operation is to perform a weighted sum through a sliding window with a local region of the activation tensor. The cross-correlation operation is similar to the above convolution operation. The cross-correlation operation between the gradient tensor Gradient and the activation tensor Activation can, for example, be regarded as convolving the gradient tensor Gradient with the transpose of the activation tensor Activation. Thus, it can also be implemented using the implicit GEMM algorithm. The gradient tensor Gradient is regarded as a two-dimensional matrix of K×(N×P×Q), and the Activation is transformed into a two-dimensional matrix of (N×P×Q)×(R×S×C) according to the position where the gradient tensor Gradient slides the window. Then, the two matrices are multiplied to obtain the output data. In this way, during the conversion process, the input data changes from [N, H, W, C] to [NPQ, RSC], and the data volume expands by R×S times.

[0047] On the one hand, since the activation tensor changes from [N, H, W, C] to [NPQ, RSC], the data volume expands by R×S times (usually P = H, Q = W). Most of this expansion in data volume occurs at the global cache or the secondary cache, and the operator performance is easily limited by the memory access bandwidth of the secondary cache or the global cache. On the other hand, the method of padding 0 at the edges occupies a large amount of on-chip memory space, and most of it is invalid data, with only a small part being the valid data actually participating in the calculation. And most of the operations are multiplications by 0, wasting a large amount of computing power. These two points result in low performance of the existing backpropagation operations.

[0048] Artificial intelligence processors play an important role in convolutional calculations, especially in fields such as deep learning, computer vision, and image processing. Artificial intelligence processors can include any one of a Graphics Processing Unit (GPU), a Tensor Processing Unit (TPU), a Neural network Processing Unit (NPU), a Deep learning Processing Unit (DPU), an Accelerated Processing Unit (APU), and a General-Purpose computing on Graphics Processing Unit (GPGPU).

[0049] The description of the embodiments in this document uses a GPGPU as an example for illustration, but the embodiments of the present disclosure are not limited thereto.

[0050] Figure 3 It is a schematic structural diagram of a general-purpose graphics processing unit (GPGPU).

[0051] As Figure 3 shown, the general-purpose graphics processing unit is actually an array of programmable multi-processors. For example, the programmable multi-processor can be a Streaming Processor Cluster (SPC for short), such as including Figure 3 the shown Streaming Processor Cluster 1, …, Streaming Processor Cluster M, where M is a positive integer greater than 1. In the general-purpose graphics processing unit, 1 streaming processor cluster processes one computing task, or multiple streaming processor clusters process one computing task. Data sharing is performed between multiple streaming processor clusters through a global cache or global memory.

[0052] As Figure 3 shown, taking Streaming Processor Cluster 1 as an example, 1 streaming processor cluster includes multiple computing units, such as Figure 3 the computing unit 1, computing unit 2, …, computing unit N in , where N is a positive integer. Each computing unit (Compute Unit, CU for short) is used to perform arithmetic and logical operations, such as accumulation, reduction, conventional addition, subtraction, multiplication, division, etc. A computing unit includes multiple cores (also called computing cores or calculation cores), and each core includes an arithmetic logic unit (ALU), a floating-point computing unit, etc. The core is used to perform specific computing tasks. In addition, the computing unit also includes registers (such as Figure 3 the register bank in ) and shared memory, which are used to hierarchically store the source data and destination data related to the computing task. The shared memory in one computing unit is used to share data between the cores of the computing unit.

[0053] In parallel computing, computing tasks are generally executed by multiple threads. These threads are divided into multiple thread blocks before execution in the general-purpose graphics processing unit (or called parallel computing processor), and then the multiple thread blocks are distributed to each computing unit via a thread block distribution module ( Figure 3 not shown in ). All threads in one thread block must be assigned to the same computing unit for execution. At the same time, the thread block will be split into the smallest execution thread bundles (or simply called thread bundles, warps), and each thread bundle contains a fixed number (or less than this fixed number) of threads. For example, 32 threads. Multiple thread blocks can be executed in the same computing unit, or in different computing units.

[0054] In each computing unit, a warp scheduling / distribution module ( Figure 3 not shown in FIG. Figure 3 ) schedules and distributes warps so that multiple computing cores in the computing unit run the warps. According to the number of computing cores in the computing unit, multiple warps in a thread block can be executed simultaneously or time-division multiplexed. Multiple threads in each warp execute the same instruction. Memory execution instructions are issued to the shared memory in the computing unit or further issued to the middle-level cache or global cache or global memory for read / write operations and the like.

[0055] The defect problems existing in the above solutions of the prior art are also the results obtained by the inventors through practice and creative labor. The process of discovering the above problems and the solutions proposed by at least one embodiment of this disclosure for the above problems are all creative contributions made by the inventors during the invention process.

[0056] At least one embodiment of the present disclosure provides a data processing method for performing arithmetic operations on an input gradient tensor and an activation tensor during the backpropagation process to obtain a weight gradient tensor. The method includes: performing a plurality of first operations to obtain a plurality of weight gradient sub-tensors. The weight gradient tensor includes a height direction and a width direction. Each weight gradient sub-tensor is a part of the weight gradient tensor divided in a two-dimensional matrix in the height direction and the width direction according to a 1×n granularity, where n is an integer greater than 1; and arranging the plurality of weight gradient sub-tensors to obtain the weight gradient tensor. Each time the first operation is performed, a target sub-tensor among the plurality of weight gradient sub-tensors is obtained. The first operation includes: loading a plurality of first elements of the input gradient tensor and a plurality of second elements of the activation tensor from a first cache to a second cache. The plurality of second elements are a plurality of elements in the activation tensor corresponding to the target sub-tensor; reading the plurality of first elements from the second cache to a tensor calculation module; and the tensor calculation module reusing the plurality of second elements to perform n second operations to obtain the target sub-tensor. Each second operation is used to obtain a target element in the target sub-tensor. The second operation includes: obtaining a plurality of third elements required for the second operation from the plurality of second elements; and determining the target element based on the plurality of first elements and the plurality of third elements.

[0057] In the data processing method provided by at least one embodiment of the present disclosure, the weight gradient tensor is split into multiple weight gradient sub-tensors according to a 1×n granularity. Multiple first elements of the input gradient tensor and multiple second elements of the corresponding activation tensor are loaded from the first cache to the second cache. When performing the cross-correlation operation, the multiple first elements and the corresponding multiple second elements are read from the second cache to the tensor calculation module. Thus, during specific execution, the multiple second elements can be reused, improving the calculation intensity, reducing the memory access overhead of the first cache, reducing and avoiding the repeated loading of the activation tensor, and having no invalid data participating in the loading and operation. The second cache is fully used for storing valid data, and all computing power is used for the operation of valid data, improving the utilization rates of the first cache, the second cache, and the hardware computing unit.

[0058] Figure 4A FIG. shows a schematic flowchart of the data processing method provided by at least one embodiment of the present disclosure.

[0059] The data processing method provided by at least one embodiment of the present disclosure is used to perform an operation on the input gradient tensor and the activation tensor during the backpropagation process to obtain the weight gradient tensor. The input gradient tensor is, for example, the gradient tensor Gradient described above. During backpropagation, this gradient tensor Gradient is used as the input of the l-th layer, so it is called the input gradient tensor.

[0060] For example, the activation tensor is represented as [N, H, W, C], where N represents the number of batches, W represents the width, H represents the height, and C represents the number of input channels. The weight gradient tensor is represented as [R, S, K, C], and the structure of the weight gradient tensor is the same as the structure of the convolution kernel used during forward propagation. R represents the height of the weight gradient tensor and the convolution kernel, S represents the width of the weight gradient tensor and the convolution kernel, K represents the number of output channels, and C represents the number of input channels.

[0061] For example, in one example, the size and shape of the input gradient tensor Gradient is [N, P, Q, K] = [2, 9, 14, 256], where P and Q represent the height and width of the input gradient tensor Gradient, and K represents the number of output channels; the size and shape of the activation tensor Activation is [N, H, W, C] = [2, 9, 14, 512], where H and W respectively represent the height and width of the activation tensor, and C represents the number of input channels. The size and shape of the weight gradient tensor Weight is [R, S, K, C] = [3, 3, 256, 512], where R and S respectively represent the height and width of the weight gradient tensor. The stride size stride = (1, 1), which respectively represents the sliding stride of the convolutional kernel in the height dimension and width dimension during forward propagation, and the dilation coefficient dilation = (1, 1), which respectively represents the dilation coefficient of the convolutional kernel in the height and width dimensions; the padding size padding = (1, 1), which respectively represents the padding size of the input tensor in the height dimension and width dimension. In the following text, unless otherwise specified, the parameters in this embodiment are used as examples to illustrate the embodiments of the present disclosure.

[0062] Figure 4B It is a schematic diagram of an activation tensor.

[0063] As Figure 4B shown, the activation tensor shows one batch, but the actual input gradient tensors for performing cross-correlation operations may have multiple batches. The dimension of multiple batches is the N dimension, and the structure of each batch is the same as that of Figure 4B shown.

[0064] As Figure 4B shown, one batch includes 9×14×8 elements, H = 9, W = 14, C = 8, Figure 4B and 1 small cube located in one batch in

[0065] For example, in Figure 4B shows the H dimension, W dimension, and C dimension. Assuming that the element pointed by the arrow is the origin, C, W, and H respectively represent the three coordinate axes. row is the coordinate value in the height H direction (also the column direction), col is the coordinate value in the width W direction (also the row direction), and c is the coordinate value in the channel C direction (also the depth direction). The coordinates of the element pointed by the arrow in the input data are: c = 0, row = 0, and col = 0. The channel, width, and height values in the coordinates of other elements increase along the arrow direction.

[0066] It should be noted thatFigure 4B This is just an example of the activation tensor, and it does not mean that in actual operations, the structure of the activation tensor is as Figure 4B shown. In practice, H, W, and C can be any integers. For example, C = 512 or C = 256.

[0067] The structure of the input gradient tensor [N, P, Q, K] is similar to that of the activation tensor. For example, P = H = 9, Q = W = 14, and K can be equal to C or not equal to C. For example, K = 256 and C = 512.

[0068] Figure 4C This is a schematic diagram of a weight gradient tensor.

[0069] As Figure 4C shown, in the backpropagation operation of a convolutional neural network, the weight gradient tensor shows one batch. Similarly, but the weight gradient tensor actually performing cross - correlation operations may have multiple batches, and the dimension of multiple batches is the K dimension. The structure of each batch is the same as Figure 4C shown. The structure of this weight gradient tensor is the same as the structure of the convolutional kernel during forward propagation.

[0070] As Figure 4C shown, one batch includes 3×3×8 elements, R = 3, S = 3, C = 8. For the two - dimensional matrix formed by the R dimension and the S dimension, it is 3×3. Figure 4C One small cube located in one batch in

[0071] For example, in Figure 4C shows the R dimension, S dimension, and C dimension. Similarly, assuming the element pointed by the arrow is the origin, R, S, and C respectively represent three coordinate axes, row is the coordinate value in the height S direction, col is the coordinate value in the height R direction, c is the coordinate value in the input channel C direction, and the coordinates of the element pointed by the arrow in the input data are: c = 0, row = 0, and col = 0. The channel, width, and height values in the coordinates of other elements increase along the arrow direction.

[0072] As Figure 4A shown, this data processing method includes steps S10 and S20.

[0073] Step S10: Perform the first operation multiple times to obtain multiple weight gradient sub - tensors. The weight gradient tensor includes a height direction and a width direction. Each weight gradient sub - tensor is a part divided from the two - dimensional matrix formed by the height direction and the width direction of the gradient tensor at a granularity of 1×n, where n is an integer greater than 1.

[0074] Step S20: Arrange multiple weight gradient sub-tensors to obtain a weight gradient tensor.

[0075] For step S10, the structure of the weight gradient tensor is the same as the structure of the convolutional kernel during forward propagation. Therefore, the structure of the weight gradient tensor can be obtained during backpropagation. For example, the structure of the weight gradient tensor is as shown in Figure 4C . During backpropagation, the two-dimensional matrix formed by the weight gradient tensor in the height direction ( Figure 4C R direction in Figure 4C ) and the width direction ( Figure 4C S direction in

[0076] Figure 4D is divided into multiple weight gradient sub-tensors according to the 1×n granularity. For example, n can be the number of pixels of the weight gradient tensor in the S direction, or less than the number of pixels S in the S direction, and the number of pixels S in the width direction is an integer multiple of a. If a is the number of pixels of the weight gradient tensor in the width direction, the activation tensor can be reused to the greatest extent. For example, in the weight gradient tensor shown in Figure 4C , in the S direction, the weight gradient tensor has 3 pixels. Then, the two-dimensional matrix formed by the weight gradient tensor in the R direction and the S direction can be divided according to the 1×3 granularity. It should be noted that in this disclosure, the same identifier is used to mark a certain direction and the size of the tensor in that direction. For example, S represents both the S direction and the size of the tensor in the S direction is S.

[0077] As shown in Figure 4D , the two-dimensional matrix formed by the weight gradient tensor in the R direction and the S direction in Figure 4C is divided according to the 1×3 granularity to obtain 3 weight gradient sub-tensors, namely weight gradient sub-tensor 401, weight gradient sub-tensor 402, and weight gradient sub-tensor 403, and their sizes are all [1, 3, 8].

[0078] In some other examples, for example, in the S direction, the weight gradient tensor has 9 pixels, then a can be equal to 3. That is, it is sliced according to the granularity of 1 in the R direction and sliced according to the granularity of 3 in the S direction, and the S direction is sliced into 3 parts.

[0079] Each time the first operation is executed to obtain a weight gradient sub-tensor. For example, weight gradient sub-tensor 401, weight gradient sub-tensor 402, and weight gradient sub-tensor 403 are obtained through 3 first operations respectively.

[0080] For step S20, for example, how the weight gradient tensor is divided, then according to the corresponding operations for the division, multiple weight gradient sub-tensors are combined into one weight gradient tensor. For example, if the weight gradient tensor is divided as 1×S, where S represents the size in the width direction (i.e., sliced in the height direction with a granularity of 1 pixel in the height direction), then multiple weight gradient sub-tensors are arranged in sequence in the height direction to obtain the weight gradient tensor. For example, after obtaining the weight gradient sub-tensor 401, the weight gradient sub-tensor 402, and the weight gradient sub-tensor 403, the weight gradient sub-tensor 401, the weight gradient sub-tensor 402, and the weight gradient sub-tensor 403 are arranged in sequence in the R direction to obtain Figure 4C the weight gradient tensor shown.

[0081] Again, for example, if the weight gradient tensor is divided as 1×n, where n < S and S represents the size in the width direction (i.e., sliced with a granularity of 1 pixel in the height direction and sliced with a granularity of n pixels in the width direction), then multiple weight gradient sub-tensors are arranged in sequence in the width direction and the height direction.

[0082] In some embodiments of the present disclosure, n is the size of the weight gradient tensor in the width direction. According to the division method of 1×n granularity, multiple weight gradient sub-tensors are arranged to obtain the weight gradient tensor, including: arranging n weight gradient sub-tensors in sequence in the height direction to obtain an n×n weight gradient tensor.

[0083] Each time the first operation is executed, a target sub-tensor among multiple weight gradient sub-tensors is obtained.

[0084] Figure 5A shows a schematic diagram of obtaining a target sub-tensor by executing the first operation provided by at least one embodiment of the present disclosure.

[0085] As Figure 5A shown, the first operation includes steps S501 to S503.

[0086] Step S501: Load multiple first elements of the input gradient tensor and multiple second elements of the activation tensor from the first cache to the second cache, where the multiple second elements are multiple elements in the activation tensor corresponding to the target sub-tensor.

[0087] Step S502: Read the multiple first elements from the second cache to the tensor calculation module.

[0088] Step S503: The tensor calculation module reuses the multiple second elements to execute the second operation n times to obtain the target sub-tensor, and each second operation is used to obtain a target element in the target sub-tensor.

[0089] For step S501, the first cache is, for example, Figure 3The global cache or memory shown. For example, if the data processing method is applied to a GPU, then the first cache may be the video memory of the GPU. The second cache is, for example, Figure 3 The shared memory shown. In the following, the first cache is taken as the global cache and the second cache is taken as the shared memory as an example to illustrate the embodiments of the present disclosure.

[0090] For example, when performing a cross-correlation or convolution operation, if the sizes of the input gradient tensor and the activation tensor are large, a large image can be divided into multiple small blocks, and each small block is called a "tile". Each tile contains a part of the elements of a certain tensor (the elements can also be called data), and these elements can be processed in independent processing units. In step S501, the multiple first elements of the input gradient tensor may refer to a tile.

[0091] For example, the input gradient tensor can be represented as [K, NPQ]. For example, here NPQ means that the input gradient tensor [N, P, Q, K] is unfolded into one dimension in the batch dimension, height dimension, and width dimension, that is, the input gradient tensor is unfolded in the order of width dimension, height dimension, and finally batch dimension, and the unfolded output tensor can be represented as K×NPQ (pixel), and NPQ (pixel) means that it is unfolded into one dimension in the P dimension, Q dimension, and N dimension. The multiple first elements of the input gradient tensor are one of the multiple input gradient sub-tensors obtained by dividing the input gradient tensor in the PQ plane according to the division granularity [m, n']. That is, each input gradient sub-tensor includes the multiple first elements. Each input gradient sub-tensor is regarded as a "tile". The specific values of m and n' can be determined according to actual needs. For example, they can be determined according to the tile size supported by the processor, the processing speed of the processor, load balancing, data type, etc. For example, in one example, m = 32 and n' = 64. Of course, the present disclosure is not limited thereto.

[0092] Figure 5B Shows a schematic diagram of an input gradient sub-tensor obtained by dividing the input gradient tensor according to the [m, n'] granularity.

[0093] As Figure 5B Shown, the shaded part is the input gradient sub-tensor obtained by dividing the input gradient tensor according to [1, 64]. Among them, m = 1 is only shown for convenient reading. In actual applications, m usually can be equal to 32, 64, etc. If m = 32, then there are 32 rows in the K direction, and each row includes Figure 5B The 64 elements shown.

[0094] In step S501, multiple second elements in the activation tensor are activated for operation with a tile of the input gradient tensor (i.e., the input gradient sub-tensor) to obtain the elements required for the n target elements included in the target sub-tensor.

[0095] Figure 5C FIG. shows a schematic diagram of activating multiple second elements in an activation tensor provided by at least one embodiment of the present disclosure.

[0096] As Figure 5C shown, 66 elements shown in the shaded part are taken as multiple second elements, and these 66 elements are subjected to a second operation described below with the 64 elements shown in Figure 5B to obtain, for example, the weight gradient sub-tensor 401 shown in Figure 4D The weight gradient sub-tensor 401 is an example of the target sub-tensor.

[0097] In step S501, for example, a tensor memory access instruction (TMA) is used to load multiple first elements of the input gradient tensor and multiple second elements of the activation tensor from the global cache into the shared memory. The TMA instruction is a hardware-accelerated asynchronous data transfer unit designed specifically for efficient processing of tensor data access. It enables parallel data loading and computing through hardware-level optimizations, significantly enhancing the efficiency of deep learning and high-performance computing.

[0098] For example, the TMA instruction is used to load multiple first elements in the input gradient tensor from the video memory of the GPGPU into the shared memory, and load multiple second elements of the activation tensor corresponding to the input gradient sub-tensor from the video memory of the GPGPU into the shared memory.

[0099] Step S501 includes: loading multiple elements in the input gradient tensor from the first cache to the second cache as multiple first elements according to the first shape size; determining the second shape size of the multiple second elements based on the first shape size of at least part of the tensor and n; determining the starting position of the multiple second elements; and loading multiple elements in the activation tensor from the first cache to the second cache as the multiple second elements according to the second shape size and the starting position.

[0100] For example, the input gradient tensor is represented as [N, P, Q, K], where P represents the height, Q represents the width, N represents the number of batches, and K represents the number of output channels. The first shape size is [K1, D], where K1 represents the size of the multiple first elements (i.e., the input gradient sub-tensor) in the output channel dimension, D represents the size of the multiple first elements in the first channel dimension, the first channel dimension is obtained by unfolding the input gradient tensor in the height dimension, width dimension, and batch number dimension into one dimension, and K1 is less than or equal to K.

[0101] For example, the input gradient tensor Gradiernt is represented as [N, P, Q, K] = [2, 9, 14, 256]. The input gradient tensor Gradiernt is unfolded into one dimension in the height dimension, width dimension, and batch number dimension, and this dimension serves as the first channel dimension, while the output channel K serves as another dimension. That is, the input gradient tensor Gradiernt can be represented as a matrix containing the first channel dimension and the output channel dimension. For example, the first channel dimension serves as the columns of the matrix, and the output channel dimension serves as the rows of the matrix. This matrix is represented as Gradiernt[256, 252]. It can be understood that the input gradient tensor is arranged in the order of NPQ, and K output channels are arranged in sequence. For example, first arrange the PQ pixels of one output channel in the first batch, then arrange the PQ pixels of this output channel in the second batch; then arrange the PQ pixels of another output channel in the first batch, and then arrange the PQ pixels of this other output channel in the second batch; and so on until the pixels of the K-th channel in the second batch.

[0102] The first shape size of multiple first elements is [K1, D] for example, that is, the matrix Gradiernt [256, 252] is divided into multiple input gradient sub-tensors with [K1, D] as the granularity. For example, K1 = 32 and D = 64. When loading multiple first elements from the global cache, they are loaded according to the granularity of K1 = 32 and D = 64. For example, if P = 9 and Q = 14, then each time the TMA instruction is executed, 32 channels in the input gradient tensor are loaded from the global cache. Each channel includes 4 rows (4×14 = 56) plus 8 pixels (a total of 64 pixels) in the PQ plane. For example, each channel includes Figure 5B the 64 elements shown in the shaded part. K1 can be any integer less than or equal to K, and K1 can be determined according to the processing speed of the processor, load balancing, data type, etc.

[0103] The activation tensor is represented as [N, H, W, C], where W represents the width, H represents the height, and C represents the number of input channels. The second shape size is [D + n - 1, C1], where D + n - 1 represents the size of the activation tensor in the second channel dimension. The second channel dimension is obtained by unfolding the activation tensor into one dimension in the height dimension, width dimension, and batch number dimension. C1 represents the size of the activation tensor in the number of input channels dimension, and C1 is less than or equal to C. Similar to the above input gradient tensor, the activation tensor can be unfolded into one dimension in the height dimension, width dimension, and batch number dimension to obtain the second channel dimension. The method of obtaining the second channel dimension by unfolding the activation tensor is similar to the above input gradient tensor and will not be elaborated here.

[0104] For example, if D = 64 and n = 3, then the second shape dimension is [66, C1], where C1 can be any integer less than or equal to C, and C1 can be determined according to the processing speed of the processor, load balancing, data type, etc. For example, each time a TMA instruction is executed, C1 (e.g., 64, 128, etc.) channels in the activation tensor are loaded from memory, and each channel includes 4 rows (4×14 = 56) plus 10 pixels (a total of 66 pixels) in the HW plane. For example, each channel includes Figure 5C the 66 elements shown in the shaded part of

[0105] Determine the starting positions of the multiple second elements corresponding to the weight gradient subtensor 401, and continuously load D + n - 1 elements in the second channel dimension of the activation tensor starting from this starting position. It should be noted that since each element in the weight gradient subtensor 401 needs to be obtained through a cross-correlation operation, D + n - 1 elements need to be loaded for each input channel number dimension to obtain all elements in the weight gradient subtensor 401. For the method of determining the starting positions of the multiple second elements, please refer to the description below Figure 6 below.

[0106] Figure 5D FIG. shows a schematic diagram of loading multiple first elements and multiple second elements from a global cache to a shared memory according to at least one embodiment of the present disclosure.

[0107] As Figure 5D shown, in the shared memory, the input gradient tensor is stored in the form of input gradient subtensors such as A00, A01, A02, etc., and the activation tensor is stored in the form of data blocks such as B00, B01, B02, etc.

[0108] In the process of loading multiple first elements from the global cache to the shared memory, the input gradient tensor is regarded as a matrix [K, NPQ]. In the output channel dimension of the matrix [K, NPQ], for example, it includes 256 rows (K0 - K255), and in the first channel dimension, it includes 252 columns (P0 - P251). It is divided into multiple input gradient subtensors according to the [32, 64] granularity. For example, each TMA instruction is used to load the input gradient tensor with the [32, 64] granularity from the global cache to the shared memory. As Figure 5D shown, the input gradient tensor is divided into input gradient subtensors such as A00, A01, A02, etc. The input gradient subtensors such as A00, A01, A02, etc. are sequentially loaded into the shared memory.

[0109] During the process of loading multiple second elements from the global cache into the shared memory, the activation tensor is regarded as a matrix [NHW, C]. In the second channel dimension of the matrix [NHW, C], for example, it includes 252 rows (H0 - H251), and in the direction of the input channel dimension, it includes 512 columns (R0 - R511). The multiple second elements, for example, include the elements included in the activation tensor with a size of [66, 128]. For example, each TMA instruction is used to load multiple second elements with a size of [66, 128] from the global cache into the shared memory. As Figure 5D shown, the activation tensor is divided into data blocks such as B00, B01, B02, etc., and each TMA instruction is used to load one data block. It should be noted that if the activation tensor is loaded according to the size of [66, 128], the serial numbers of the data block B00 in the second channel dimension are H0 - H65, the serial numbers of the data block B01 in the second channel dimension are H64 - H129, and the serial numbers of the data block B02 in the second channel dimension are H128 - H193.

[0110] For example, use the TMA instruction to load the input gradient sub-tensor A00 into the shared cache, then use the TMA instruction to load the data block B00 into the shared cache, and then perform steps S502 and S503 on the input gradient sub-tensor A00 and the data block B00. Similarly, use the TMA instruction to load the input gradient sub-tensor A01 into the shared memory, then use the TMA instruction to load the data block B01 into the shared memory, and then perform steps S502 and S503 on A01 and B01. And so on, until steps S502 and S503 are performed on multiple tiles of the input gradient tensor.

[0111] It should be noted that in some other embodiments of the present disclosure, if the tile size supported by the processor is greater than or equal to the size of the input gradient tensor, then the input gradient tensor may not be divided according to the division granularity. That is, all elements in the input gradient tensor can be loaded into the shared cache at the same time, and at this time, the multiple first elements are all elements in the input gradient tensor.

[0112] For step S502, read multiple first elements from the second cache into the tensor calculation module. For example, read A00 from the second cache into the tensor calculation module.

[0113] For step S503, since the weight gradient tensor is divided into multiple weight gradient sub-tensors according to the 1×n granularity, each weight gradient sub-tensor includes 1×n elements in the two-dimensional matrix composed of height and width. When calculating the n elements in the weight gradient sub-tensor, the tensor calculation module performs n second operations on multiple second elements in the shared cache, that is, the n second operations reuse multiple second elements in the shared cache.

[0114] The second operation includes: reading a plurality of second elements to obtain a plurality of third elements required for the second operation; and determining a target element based on the plurality of first elements and the plurality of third elements.

[0115] In some embodiments of the present disclosure, the plurality of first elements are elements in one of multiple input gradient sub-tensors obtained by dividing an input gradient tensor according to a division granularity, and the plurality of first elements and the plurality of third elements correspond one by one. Determining the target element based on the plurality of first elements and the plurality of third elements includes: calculating the sum of products of corresponding elements between the plurality of first elements and the plurality of third elements; and adding the sums of products corresponding to the multiple input gradient sub-tensors to obtain the target element.

[0116] For example, in Figure 5D the example of, after loading the input gradient sub-tensor A00 and the data block B00 into the shared cache, use the TMA instruction to load the input gradient sub-tensor A00 from the shared cache into the tensor calculation module, and use the TMA instruction to load, from the shared cache, a plurality of third elements corresponding to the sequence numbers H0 to H63 in the second channel dimension of the data block B00. After both the input gradient sub-tensor A00 and the plurality of third elements are loaded into the tensor calculation module, the tensor calculation module performs a dot product on the corresponding elements between the plurality of first elements and the plurality of third elements, and calculates the sum of the products of the dot product, and this sum of products is a part of W00. Then, load a plurality of third elements corresponding to the sequence numbers H1 to H64 in the second channel dimension of the data block B00 from the shared cache, and then calculate the sum of the products of the input gradient sub-tensor A00 and the plurality of third elements corresponding to H1 to H64, and this sum of products is a part of W01. Then load a plurality of third elements corresponding to the sequence numbers H2 to H65 in the second channel dimension of the data block B00 from the shared cache, and then calculate the sum of the products of the input gradient sub-tensor A00 and the plurality of third elements corresponding to H2 to H65, and this sum of products is a part of W02.

[0117] After that, perform similar first and second operations on the input gradient sub-tensor A01 and the data block B01 according to the steps of the first and second operations of the input gradient sub-tensor A00 and the data block B00 as described above.

[0118] In some embodiments of the present disclosure, since the input gradient tensor is divided into multiple input gradient sub-tensors, the sum of the products corresponding to the multiple input gradient sub-tensors is added to obtain the target element. For example, the sum of the products obtained from multiple tiles is accumulated again to obtain the target element. For example, calculating A00*B00 + A01*B01 + …, the outputs of the accumulated results are the target element W00, the target element W01, and the target element W02, and the data in B00, B01, … used when calculating the target element W00, the target element W01, and the target element W02 are different. For example, the elements numbered 0-63 in B00, B01, … are used to calculate W00; the elements numbered 1-64 in B00, B01, … are used to calculate W01; the elements numbered 2-65 in B00, B01, … are used to calculate W02. It should be noted that "*" represents the sum of the products of the corresponding elements, for example, obtained according to Figure 5D the sum of the products of the corresponding elements described. Similarly, by calculating A00*B10 + A01*B11 + …, the outputs of the accumulated results are the target elements W10, W11, and W12.

[0119] In some other embodiments of the present disclosure, in an embodiment where the input gradient tensor is not divided according to the division granularity, for example, the size of another input gradient tensor is the same as Figure 5D the input gradient sub-tensor A00 in, then the size of the loaded activation tensor is, for example, Figure 5D the data block B00 in is loaded to the global memory, and then the second operation is performed on the data block B00 three times to obtain A00*B00, and the value of A00*B00 is the target element W00 in the weight gradient sub-tensor.

[0120] Figure 6 The flowchart shows a method for determining the starting positions of multiple second elements provided by at least one embodiment of the present disclosure.

[0121] As Figure 6 shown, the method includes steps S601 to S603.

[0122] Step S601: Obtain the padding parameters of the activation tensor.

[0123] Step S602: Determine the minimum indexes of the weight gradient sub-tensor in the height direction and the width direction.

[0124] Step S603: Based on the minimum indexes and the padding parameters, determine the starting positions.

[0125] For step S601, the padding parameters refer to, for example, the padding size, and the padding size can be the same as the padding size of the input tensor during forward propagation. The padding size is, for example, 1 row of pixels for each of the front, back, left, and right, as Figure 1As shown, the padding parameters are (1, 1).

[0126] For step S602, for example, the first element in the weight gradient sub-tensor is the minimum index among the indices in the height direction and the width direction. For example, in the Figure 4D example of, the first element of the weight gradient sub-tensor 401 is W00, and the indices of the element W00 in the height direction and the width direction are (0, 0); the first element of the weight gradient sub-tensor 402 is W10, and the indices of the element W10 in the height direction and the width direction are (1, 0); the first element of the weight gradient sub-tensor 403 is W20, and the indices of the element W20 in the height direction and the width direction are (2, 0).

[0127] For step S603, for example, the representation of the weight gradient tensor is [R, S, K, C], where R represents the height, S represents the width, the index is [R1, S1, K2, C2], K2 is the output channel where the first element is located, and the padding parameters are (f, g). Step S603 includes: determining that the starting coordinates of a plurality of second elements are [N1, R1 - f, S1 - g, C2], where N1, f, g, R1, S1, and C2 are all integers greater than or equal to 0, N1 is the batch where the element corresponding to the minimum index is located (for example, the above-mentioned first element), and C2 is the input channel where the element corresponding to the minimum index is located; and transforming the starting coordinates into the valid range of the activation tensor.

[0128] For example, the padding parameters are (1, 1), the minimum indices in the height direction and the width direction are [0, 0]. For any input channel dimension and output channel dimension, the coordinates of the target element with the minimum index are denoted as [0, 0, K2, C2]. Then the starting coordinates of a plurality of second elements are [N1, -1, -1, C2]. N1 is any batch, and C2 is any channel, that is, for the element with the index 00 in each channel in each batch (for example, Figure 4C the element W00 in), the starting coordinates of a plurality of second elements in the activation tensor required to calculate the element W00 in the height direction and the width direction are [-1, -1]. Similarly, for the element with the index (1, 0) in each channel in each batch, the starting coordinates of a plurality of second elements in the activation tensor required to calculate W10 in the height direction and the width direction are [0, -1]. According to [N1, R1 - f, S1 - g, C2], the starting coordinates of the second elements in the activation tensor corresponding to the elements with the indices (0, 0), (1, 0), and (2, 0) in each channel in each batch can be calculated respectively, and will not be elaborated one by one.

[0129] Since it is considered that when converting to matrix multiplication and addition operations during cross-correlation operations or convolutions, it is necessary to pad the four sides of the activation tensor, the starting coordinates of multiple second elements are obtained by subtracting the padding parameter from the index. If Figure 4B a coordinate system is established for the activation tensor in the manner shown, then there are cases where the starting coordinates calculated in the above manner are not within the range of the activation tensor. For example, elements with negative H or negative W are not within the range of the activation tensor. For example, for the element W00, the starting coordinates of multiple second elements in the activation tensor in the height and width directions are [-1, -1], where H = -1 and W = -1 for [-1, -1], which is not within the range of the activation tensor. Therefore, it is necessary to perform coordinate transformation to transform it into the range of the activation tensor.

[0130] For example, transforming the starting coordinates into the valid range of the activation tensor includes: in the order of the width dimension and the height dimension, successively converting the coordinate values of the starting coordinates in the width dimension and the height dimension into coordinate values greater than or equal to 0.

[0131] For example, determine whether S1 - g is less than 0; in response to S1 - g < 0, transform the starting coordinates [N1, R1 - f, S1 - g, C2] into [N1, R1 - f - t1, S1 - g + t1×W, C2] such that S1 - g + t1×W >= 0, where t1 = ceiling(|S1 - g| / W); and in response to R1 - f - t1 < 0, further transform [N1, R1 - f - 1, S1 - g + t1×W, C2] into [N1 - t2, R1 - f - t1 + t2×H, S1 - g + t1×W, C2] such that R1 - f - t1 + t2×H >= 0, where t2 = ceiling(|R1 - f - t1| / H).

[0132] Again, for example, in response to S1 - g >= 0, determine whether R1 - f is less than 0. In response to S1 - g >= 0 and R1 - f < 0, the starting coordinates [N1, R1 - f, S1 - g, C2] are transformed into [N1 - t3, R1 - f + t3×H, S1 - g, C2] such that R1 - f + t3×H >= 0, where t3 = ceiling(|R1 - f| / H).

[0133] For example, execute in the following order.

[0134] Step S1: Determine whether S1 - g is less than 0.

[0135] Step S2: If S1 - g < 0, transform the starting coordinates [N1, R1 - f, S1 - g, C2] into [N1, R1 - f - t1, S1 - g + t1×W, C2] such that S1 - g + t1×W >= 0, where t1 is the ceiling of |S1 - g| / W. If S1 - g > 0, then jump to Step S5 for execution.

[0136] Step S3: Determine whether R1 - f - t1 is less than 0.

[0137] Step S4: If R1 - f - t1 < 0, then further transform [N1, R1 - f - t1, S1 - g + t1×W, C2] into [N1 - t2, R1 - f - t1 + t2×H, S1 - g + t1×W, C2] such that R1 - f – t1 + t2×H >= 0, where t2 is the ceiling of |R1 - f - t1| / H. The starting position is [N1 - t2, R1 - f - t1 + t2×H, S1 - g + t1×W, C2].

[0138] If R1 - f - t1 >= 0, the starting position is [N1, R1 - f - t1, S1 - g + t1×W, C2].

[0139] Step S5: Determine whether R1 - f is less than 0.

[0140] Step S6: If R1 - f < 0, transform the starting coordinates [N1, R1 - f, S1 - g, C2] into [N1 - t3, R1 - f + t3×H, S1 - g, C2] such that R1 - f + t3×H >= 0, where t3 is the ceiling of |R1 - f| / H, and the starting position is [N1 - t3, R1 - f + t3×H, S1 - g, C2].

[0141] If R1 - f >= 0, the starting position is [N1, R1 - f, S1 - g, C2]. After determining the second shape size and the starting position, start loading multiple elements in the activation tensor of the second shape size as multiple second elements into the shared memory from the starting position.

[0142] In the above - mentioned embodiment of loading multiple second elements into the shared memory, no invalid data participates in the loading and operation. All of the shared memory is used for storing valid data, and all of the computing power is used for operating on valid data, improving the utilization rate of the shared memory and the hardware operation unit.

[0143] Figure 7 Shows a schematic diagram of loading multiple second elements in the activation tensor provided by at least one embodiment of the present disclosure.

[0144] As Figure 7As shown, for ease of understanding, Figure 7 only the last part of the elements in batch1 and batch0 are shown. The activation tensor can also include more batches. Figure 7 The activation tensor shown is planar, showing the NHW dimensions. However, in the depth direction, each box actually has C elements at each position. Figure 7 In p(i, j, q), i represents the batch number, j represents the coordinate in the height H direction, and q represents the coordinate in the width W direction. For example, p(0, 8, 0) represents the element in the 8th row and 0th column of batch 0; p(1, 0, 0) represents the element in the 0th row and 0th column of batch 1. Each box includes C elements in the depth direction. For example, Figure 7 each box shown in it can be called a sequence unit, and each sequence unit includes C elements in the depth direction (C direction).

[0145] For example, if we want to calculate Figure 4D the weight gradient sub-tensor 401 in batch1, then the element W00 corresponding to the minimum index of the weight gradient sub-tensor 401 has the starting coordinates Z of [-1, -1] in the height and width directions. This starting coordinate is the offset relative to the coordinate where the height coordinate is 0 and the width coordinate is 0 in the activation tensor. For example, [-1, -1] is Figure 7 1 pixel up in the height direction and 1 pixel left in the width direction relative to p(1, 0, 0) in it. Then the starting coordinate is converted to the range of the activation tensor. The starting coordinate Z[1, -1, -1, C2] is first transformed to [1, -2, 13, C2], and then [1, -2, 13, C2] is transformed to [0, 7, 13, C2]. That is, the starting coordinate Z is transformed to p(0, 7, 13). 66 elements are loaded sequentially from p(0, 7, 13) as multiple second elements into the shared memory. C2 is the coordinate value of the input channel dimension. If the granularity supported by the processor in the input channel is C1, then in the input channel dimension, C1 input channel dimensions are loaded starting from the coordinate value C2. That is, for the activation tensor, a data block with a shape size of [66, C1] is loaded from the starting position p(0, 7, 13) to the tensor calculation module. For example, p(0, 7, 13), p(0, 8, 0), p(0, 8, 1), …, p(1, 3, 8) are loaded sequentially to the tensor calculation module.

[0146] For example, if we want to calculate Figure 4DFor the weight gradient sub-tensor 402 shown, the starting coordinates of the element W10 corresponding to the minimum index of the weight gradient sub-tensor 402 in the height and width directions are [0, -1], and this starting coordinate is the offset relative to the coordinate with height coordinate 0 and width coordinate 0 in the activation tensor. For example, [0, 1] is the left shift of p(1, 0, 0) by 1 pixel in the width direction relative to Figure 7 After that, the starting coordinate [0, -1] is converted to the range of the activation tensor. The starting coordinate [1, 0, -1, C2] is transformed into [0, 8, 13, C2]. For one depth, 66 elements are sequentially loaded from p(0, 8, 13) as multiple second elements into the shared memory. For example, p(0, 8, 13), p(1, 0, 0), …, p(1, 4, 9) are sequentially loaded into the tensor calculation module.

[0147] For example, Figure 4D The calculation method of the starting position of the weight gradient sub-tensor 403 shown in is similar to that of the weight gradient sub-tensor 401 and the weight gradient sub-tensor 402, and will not be elaborated here.

[0148] Figure 8 The figure shows a flowchart of a method for reading multiple second elements to obtain multiple third elements required for a second operation provided by at least one embodiment of the present disclosure.

[0149] As Figure 8 shown, the method includes steps S801 to S802.

[0150] Step S801: Determine the positions of multiple third elements among multiple second elements. The shape and size of the multiple third elements are [D, C1], where D is the size in the second channel dimension.

[0151] Step S802: Obtain multiple third elements based on the data block with a shape and size of [D, C1] at the positions among the multiple second elements.

[0152] In some embodiments of the present disclosure, determining the positions of a plurality of third elements in a plurality of second elements includes: determining the starting points of the plurality of third elements according to the indices of the target element in the height direction and the width direction of the weight gradient tensor, and loading data blocks from the starting points in the plurality of second elements with a shape size of [D, C1]. The method for determining the starting points of the plurality of third elements according to the indices of the target element in the height direction and the width direction of the weight gradient tensor is similar to the method for determining the starting position of the first element in the weight gradient sub-tensor described above. For example, if the index of the starting point is [R1, S1, K2, C2], and the padding parameters are (f, g), then the starting coordinates of the starting point in the activation tensor are [N1, R1 - f, S1 - g, C2], and then coordinate transformation is performed. For example, it is determined whether S1 - g is less than 0; in response to S1 - g < 0, the starting coordinates [N1, R1 - f, S1 - g, C2] are transformed into [N1, R1 - f - t1, S1 - g + t1×W, C2] such that S1 - g + t1×W >= 0, where t1 = ceiling(|S1 - g| / W), and in response to R1 - f - t1 < 0, [N1, R1 - f - t1, S1 - g + t1×W, C2] is further transformed into [N1 - t2, R1 - f - t1 + t2×H, S1 - g + t1×W, C2] such that R1 - f - t1 + t2×H >= 0, where t2 = ceiling(|R1 - f - t1| / H); in response to S1 - g >= 0, it is determined whether R1 - f is less than 0; in response to S1 - g >= 0 and R1 - f < 0, the starting coordinates [N1, R1 - f, S1 - g, C2] are transformed into [N1 - t3, R1 - f + t3×H, S1 - g, C2] such that R1 - f + t3×H >= 0, where t3 = ceiling(|R1 - f| / H).

[0153] For example, in Figure 7 the example of Figure 4C if it is required to calculate the element W01 with an index of (0, 1) shown in batch 1, then the starting coordinates in the height direction and the width direction are [-1, 0], and this starting coordinate is the offset relative to the coordinate with a height coordinate of 0 and a width coordinate of 0 in the activation tensor. For example, [-1, 0] is an upward offset of 1 pixel in the height direction relative to p(1, 0, 0) in Figure 7 . After that, the starting coordinates [-1, 0] are converted to within the range of the activation tensor. The starting coordinates [1, -1, 0, C2] are transformed into [0, 8, 0, C2]. For 1 depth, 64 elements are sequentially loaded from p(0, 8, 0) to the tensor calculation module. For example, p(0, 8, 0), p(0, 8, 1), …, p(1, 3, 7) are sequentially loaded to the tensor calculation module.

[0154] For example, to calculate the element W02 with index (0, 2) shown in Figure 4C batch1, the starting coordinates in the height and width directions are [-1, 1]. For 1 depth, the starting coordinates [1, -1, 1] are transformed into [0, 8, 1]. 64 elements are sequentially loaded from p(0, 8, 1) as multiple third elements to the tensor calculation module. For example, p(0, 8, 0), p(0, 8, 1), …, p(1, 3, 8) are sequentially loaded to the tensor calculation module.

[0155] In another embodiment of the present disclosure, a data block with a shape size of [D, C1] can also be loaded to the tensor calculation module according to the starting position and the sliding step of the first element of the weight gradient sub-tensor. For example, if the sliding step is 1, starting from the starting position, every time the second operation is executed, it slides one 1-pixel size to the right to obtain a data block with a shape size of [D, C1] and load it to the tensor calculation module.

[0156] In some embodiments of the present disclosure, obtaining multiple third elements based on a data block with a shape size of [D, C1] at a position among multiple second elements includes: determining a padding position for padding in the data block according to the index minimum value and the padding parameter; and masking the elements at the padding position to obtain multiple third elements.

[0157] During the process of the tensor calculation module reading multiple second elements, according to the index information and the padding parameter, the element value at the padding position is modified to the default value and then loaded to the tensor calculation module, and the padding position is indicated by the index and the padding parameter. For example, the padding position refers to the offset of the position that needs to be masked relative to the index of the target element. For example, offset = index - padding parameter. For example, for Figure 4C the element W00, offset = (0, 0) - (1, 1) = (-1, -1), so the padding position is the first column on the left and the first row above the data block. For example, for Figure 4C the element W01, offset = (0, 1) - (1, 1) = (-1, 0), so the padding position is the first column on the left in the data block. If the offset = (0, 1), the padding position is the last column on the right in the data block. If the offset = (1, 0), the padding position is the last row below the data block.

[0158] Accordingly, the data at the padding positions of the original convolution is processed into default values (e.g., default 0) through a masking operation (mask), and then loaded into the tensor calculation module as multiple third elements. That is, the data block with the elements at multiple padding positions in the data block set to the default value 0 is used as multiple third elements. Accordingly, the padding process can be simulated during the loading process, and the activation tensor can still be loaded through the automatic loading process and the padding process is automatically simulated, accelerating the loading process.

[0159] Figure 9A FIG. shows a schematic diagram of a mask provided by at least one embodiment of the present disclosure.

[0160] As Figure 9A shown, the multiple second elements in the shared memory range from P0 to P65. Figure 9A The activation tensor shown is planar, and only the NHW dimensions are shown.

[0161] When obtaining multiple third elements for the element W00 from the shared memory, a data block DA1 is loaded from P0 to P63 in the shared memory. The two-dimensional matrix formed by the data block DA1 in the height and width directions has a total of 64 elements. And due to the offset = (-1, -1), the first row and the first column of the data block DA1 are masked to obtain multiple third elements corresponding to W00. The multiple third elements corresponding to the element W00 are loaded into the tensor calculation module. The coordinates of P0 are, for example, Figure 7 P(0, 7, 13) in Figure 7 and the coordinates of P63 are, for example,

[0162] P(1, 3, 6) in Figure 7 When obtaining multiple third elements for the element W01 from the shared memory, a data block DA2 is loaded from P1 to P64 in the shared memory. The two-dimensional matrix formed by the data block DA2 in the height and width directions has a total of 64 elements. And due to the offset = (-1, 0), the first row of the data block DA2 is masked to obtain multiple third elements corresponding to the element W01. The multiple third elements corresponding to the element W01 are loaded into the tensor calculation module. The coordinates of P1 are, for example, Figure 7 P(0, 8, 0) in

[0163] When obtaining multiple third elements for obtaining element W02 from the shared memory, data block DA3 is loaded from P2 to P65 in the shared memory, and 64 elements are obtained in the two-dimensional matrix formed by data block DA3 in the height and width directions. And since the offset = (-1, 1), the first row and the last column of data block DA3 are masked to obtain multiple third elements corresponding to W02. The multiple third elements corresponding to element W02 are loaded into the tensor calculation module. The coordinates of P2 are, for example, Figure 7 P(0, 8, 1) in Figure 7 and the coordinates of P65 are, for example,

[0164] It should be noted that although Figure 9A is shown in the form of a two-dimensional matrix, each box includes C elements in the depth direction. Each box can be called a sequence unit, and each sequence unit includes C elements in the depth direction (C direction). Therefore, loading from P0(0, 7, 13) to P63(1, 3, 6) in the shared memory is essentially loading 64 sub-sequence units, and the size of the sub-sequence units in the depth direction can be determined according to the capabilities of the processor. The sub-sequence units can have C elements or less than C elements. The index of the target element is essentially also the index of each element in the sequence unit, that is, the indices of the elements in the same sequence unit are the same. For example, the index (0, 0) of element W00 is the common index of the C elements in the sequence unit where element W00 is located.

[0165] In Figure 9A the shaded part is the padding position that needs to be masked.

[0166] From Figure 9A the calculation process, it can be found that in this embodiment, after splitting the solution granularity of the weight gradient tensor into 1x3, multiple second elements of the activation tensor required to solve the 1x3 weight gradient tensor are shared in the shared memory. Compared with ImplicitGemm, the memory access requests to the global cache or the secondary cache can be reduced to 1 / 3.

[0167] Figure 9B shows a schematic diagram of another mask provided by at least one embodiment of the present disclosure.

[0168] As Figure 9B shown, the elements in the shared memory are from P'0 to P'65.

[0169] When obtaining multiple third elements corresponding to element W10 from the shared memory, data block DA'1 is loaded from P'0 to P'63 in the shared memory. There are 64 elements in the two-dimensional matrix formed by data block DA'1 in the height and width directions. And due to the offset = (0, -1), the first column of data block DA'1 is masked to obtain multiple third elements corresponding to W10. The multiple third elements corresponding to element W10 are loaded into the tensor calculation module. The coordinates of P'0 are, for example, Figure 7 P(0, 8, 13) in Figure 7 and the coordinates of P'63 are, for example,

[0170] P(1, 4, 6) in Figure 7 When obtaining multiple third elements corresponding to element W11 from the shared memory, data block DA'2 is loaded from P'1 to P'64 in the shared memory. There are 64 elements in the two-dimensional matrix formed by data block DA'2 in the height and width directions. And due to the offset = (0, 0), data block DA'2 does not need to be masked, and data block DA'2 is the multiple third elements corresponding to element W11. The multiple third elements corresponding to element W11 are loaded into the tensor calculation module. The coordinates of P1 are, for example, Figure 7 P(1, 0, 0) in Figure 7 and the coordinates of P64 are, for example,

[0171] P(1, 4, 7) in Figure 7 When obtaining multiple third elements corresponding to element W12 from the shared memory, data block DA'3 is loaded from P'2 to P'65 in the shared memory. There are 64 elements in the two-dimensional matrix formed by data block DA'3 in the height and width directions. And due to the offset = (0, 1), the last column of data block DA'3 is masked to obtain multiple third elements corresponding to W12. The multiple third elements corresponding to element W12 are loaded into the tensor calculation module. The coordinates of P'2 are, for example, Figure 7 P(1, 0, 1) in Figure 7 and the coordinates of P65 are, for example,

[0172] P(1, 4, 8) in In some embodiments of the present disclosure, a producer warpgroup is used to load multiple first elements of the input gradient tensor and multiple second elements of the activation tensor from the first cache into the second cache; and a consumer warpgroup is used to read multiple first elements from the second cache into the tensor calculation module, and the tensor calculation module multiplexes multiple second elements to perform n times of second operations to obtain a target subtensor.

[0173] The producer warpgroup is mainly used for data loading. The consumer warpgroup is mainly used for data calculation.

[0174] For example, the consumer warp includes a first warp and a second warp. The first warp and the second warp use the tensor calculation module with a ping-pong strategy, and the first warp and the second warp are used to obtain different weight gradient sub-tensors. For example, the first warp is used to obtain Figure 4D the weight gradient sub-tensor 401 in Figure 4D and the second warp is used to obtain

[0175] the weight gradient sub-tensor 402 in Figure 5D . For example, first, the producer warp uses the TMA instruction to copy the input gradient tensor from the global cache to the shared memory; at the same time, the TMA instruction is used to copy the required data of the activation tensor from the global cache to the shared memory according to the 1x3 granularity of the weight gradient tensor; then in the consumer warp, the first warp, the calculation tensor module sequentially reads data such as Figure 5D (A00, B00), (A01, B01), etc. in, calculates A00*B00 + A01*B01 + …, accumulates the result into the accumulator, and after the accumulation is completed, the result is copied to the shared memory. The second warp is similar. Finally, the result is written into the global cache using the TMA instruction.

[0176] It should be noted that the main operations of the consumer warp include calling the tensor calculation module to perform backpropagation weight update calculation, and then using the vector calculation module to perform operations such as storing the backpropagation weight update result from the register to the shared memory and accumulation (referred to as "computing process"). In order to fully parallelize the computing resources of the tensor calculation module and the vector calculation module, in some embodiments of the present disclosure, two consumer warps are started, and through synchronization operations, the two consumer warps use the tensor calculation module with a ping-pong strategy. That is, from a certain point in time, the first warp and the second warp respectively call the tensor calculation module and the vector calculation module to perform backpropagation weight update calculation and computing process, and make full use of the powerful computing power of the tensor calculation module to hide the time-consuming of the vector calculation module.

[0177] The data processing method further includes: calling the vector calculation module to perform further computing process on the weight gradient sub-tensor; during the execution of the first operation by the first warp, the second warp performs the computing process; during the execution of the first operation by the second warp, the first warp performs the computing process.

[0178] From a certain point in time, the first warp and the second warp respectively call the vector calculation module and the tensor calculation module to perform cross-correlation calculation and further computing process, and make full use of the powerful computing power of the tensor calculation module to hide the time-consuming of the vector calculation unit.

[0179] Figure 10 It is a schematic diagram of the process of the ping-pong strategy provided by an embodiment of the present disclosure.

[0180] Figure 10 A producer thread bundle and two consumer thread bundles are shown. The two consumer thread bundles are consumer thread bundle 1 and consumer thread bundle 2 respectively. Consumer thread bundle 1 is an example of the first thread bundle, and consumer thread bundle 2 is an example of the second thread bundle. The backpropagation weight update calculation includes Figure 5A the described steps S502 and S503. The producer thread bundle is used to execute Figure 5A step S501 in. The backpropagation weight update calculation needs to use a tensor calculation module to obtain the target sub-tensor [1,n]. The calculation process is to further process the target sub-tensor [1,n], such as operations of storing in a register, biasing, adding, etc. that are not matrix multiply-accumulate operations. The calculation process needs to use a vector calculation unit to perform related operations.

[0181] To fully parallelize the computing resources of the tensor calculation unit and the vector calculation unit, two consumer thread bundles are started. Through synchronization operations, the two consumer thread bundles use the tensor calculation unit and the vector calculation unit in a ping-pong strategy.

[0182] For example, as Figure 10 shown, in response to the TMA instruction of the producer thread bundle, after loading multiple first elements of the input gradient tensor and multiple second elements of the activation tensor required to obtain a target sub-tensor (for example, the weight gradient sub-tensor 401) into the second cache, thread bundle 1 uses the tensor calculation module to perform the backpropagation weight update calculation. Then, the producer thread bundle continues to execute the TMA instruction for thread bundle 2. After loading multiple first elements of the input gradient tensor and multiple second elements of the activation tensor required to obtain another target sub-tensor (for example, the weight gradient sub-tensor 402) into the second cache, thread bundle 2 uses the tensor calculation module to perform the backpropagation weight update calculation. When thread bundle 2 is performing the backpropagation weight update calculation, thread bundle 1 performs the calculation process. This process continues in the same way. At a certain point in time, thread bundle 1 and thread 2 each call the tensor calculation module and the vector calculation module to perform the backpropagation weight update calculation and the calculation process. Thus, the powerful computing power of the tensor calculation unit can be used to hide the time-consuming of the vector calculation unit, reduce the time consumption, and improve the calculation efficiency.

[0183] The GPGPU can be divided into multiple computing units. Using the idea of block division, the weight gradient tensor is evenly divided into (TileM,TileN) granularity for each CU as a computing task. For example, it is divided with TileM = 32 and TileN = 64 as the granularity. Each CU is used to obtain the elements [32,64] in the weight gradient tensor. In repetition Figure 9A and 9BAfter multiple times, after all pixels are accumulated, each CU obtains an output of size (1x3, TileM, TileN) = (1x3, 32, 64). At this time, each CU has completed the backpropagation weight update calculation. Then, the vector calculation module is called to complete the corresponding calculation process, and the result is written into the shared memory. After completion, each CU obtains a result of size (1x3, TileM, TileN). Here, in the last step, the TMA instruction is used to copy the calculation result from the shared memory to the global memory.

[0184] In the data processing method provided by at least one embodiment of the present disclosure, the weight gradient tensor is split according to a 1×n granularity, and the activation tensor can be reused n times in the shared memory, which improves the computational intensity, reduces the memory access overhead of the global memory, the secondary cache, and the memory, and reduces and avoids the repeated loading of the activation tensor. Moreover, two second warps are used to parallelly call the tensor calculation module and the vector calculation module using the ping-pong strategy, which fully utilizes the parallel computing resources of the tensor calculation module and the vector calculation module, and uses the powerful computing power of the tensor calculation module to hide the time-consuming of the vector calculation module, improves the computing efficiency, reduces the computing time, and improves the operator performance.

[0185] The embodiments of the present disclosure are applicable to the calculation of 1D, 2D, and 3D weight gradient tensors, can be used for any feature map size, the S dimension in the convolution kernel is an integer multiple of 1x3, the other dimensions are of any size, any stride, and any padding for backpropagation weight update.

[0186] In some embodiments of the present disclosure, the programming model of the persistent kernel can be used to make the task division reasonable and the hardware load balanced. The persistent kernel is a GPU programming model that allows a thread block to continue executing new tasks after completing the current workload instead of being destroyed and restarted. This model significantly improves the utilization rate of GPU resources and the performance of the application program by reducing the creation and destruction overhead of thread blocks.

[0187] At least one embodiment of the present disclosure further provides a data processing device. Figure 11 It is a schematic block diagram of a data processing device provided by at least one embodiment of the present disclosure.

[0188] The data processing device is used to perform arithmetic operations on the input gradient tensor and the activation tensor during the backpropagation process to obtain the weight gradient tensor.

[0189] As Figure 11 shown, the data processing device 100 includes an execution module 110.

[0190] The execution module 110 is configured to perform a first operation multiple times to obtain multiple weight gradient sub-tensors. The weight gradient tensor includes a height direction and a width direction. Each weight gradient sub-tensor is a part of the weight gradient tensor divided according to a 1×n granularity within a two-dimensional matrix formed by the height direction and the width direction, where n is an integer greater than 1; and arrange the multiple weight gradient sub-tensors to obtain a weight gradient tensor.

[0191] For example, the execution module 110 includes code and programs stored in a memory. The execution module 110 is implemented as a central processing unit (CPU) or other forms of processing units with data processing capabilities and / or instruction execution capabilities. The processing unit can be a general-purpose processor and can also be a single-chip microcomputer, a microprocessor, a digital signal processor, a dedicated image processing chip, or a field programmable logic array, etc. The execution module 110 executes the code and programs to implement some or all of the functions of the execution module 110 as described above. For example, the execution module 110 can be a circuit board or a combination of multiple circuit boards for implementing the functions as described above. In the embodiments of the present application, the circuit board or the combination of multiple circuit boards may include: (1) one or more processors; (2) one or more non-temporary memories connected to the processors; and (3) firmware stored in the memory that can be executed by the processors.

[0192] For example, the execution module can be implemented as Figure 3 the computing unit shown in the figure. Different computing units perform different first operations on different data blocks to obtain different sub-output tensors.

[0193] For example, the execution module includes a loading module 1101 and a tensor calculation module 1102.

[0194] The loading module 1101 is configured to load multiple first elements of the input gradient tensor and multiple second elements of the activation tensor from a first cache to a second cache, where the multiple second elements are multiple elements in the activation tensor corresponding to the target sub-tensor.

[0195] The tensor calculation module 1102 is configured to read the multiple first elements from the second cache to the tensor calculation module; and reuse the multiple second elements to perform n second operations to obtain the target sub-tensor, where each second operation is used to obtain a target element in the target sub-tensor.

[0196] For example, the tensor calculation module 1102 can be a computing core dedicated to tensor operations such as a TensorCore to accelerate machine learning training and inference tasks.

[0197] The tensor calculation module 1102 includes: a reading unit 1112 and a calculation unit 1122. The reading unit 1112 is configured to: read the plurality of second elements to obtain a plurality of third elements required for the second operation, and the calculation unit 1122 is configured to: determine the target element based on the plurality of first elements and the plurality of third elements.

[0198] It should be noted that the execution module 110 can be used to implement Figure 4A the steps S10 and S20 shown; thus, for a specific description of the functions that the execution module 110 can implement, reference can be made to the relevant descriptions of steps S10 and S20 in the embodiments of the foregoing data processing method. In addition, the data processing device 100 can achieve technical effects similar to those of the foregoing data processing method, which will not be elaborated herein.

[0199] It should be noted that in at least one embodiment of the present disclosure, the data processing device 100 may include more or fewer circuits or units, and the connection relationships between the respective circuits or units are not limited and may be determined according to actual needs. The specific composition manners of the respective circuits or units are not limited and may be composed of analog devices according to circuit principles, or may be composed of digital chips, or may be composed in other applicable manners.

[0200] For example, the data processing device 100 may be implemented in a manner combining hardware, software, or hardware and software, and the present disclosure does not make specific limitations thereto.

[0201] The data processing method provided in at least one embodiment of the present disclosure can achieve technical effects similar to those of the foregoing data processing method, which will not be elaborated herein.

[0202] The data processing method and data processing device provided in at least one embodiment of the present disclosure can be applied to different systems or devices, such as applied to Figure 13 the electronic device 300 shown. The electronic device 300 may be a terminal, such as a mobile phone terminal, a tablet computer, a laptop computer, an AR device, a VR device, a vehicle-mounted terminal, etc., or may also be a server, etc. The data processing method provided in at least one embodiment of the present disclosure can be applied to scenarios involving convolution operations such as CPU, High Performance Computing (HPC), and Artificial Intelligence (AI) in the electronic device 300, such as a tensor calculation unit. Of course, the present disclosure is not limited thereto, and any scenario, device, device, etc. involving backpropagation calculation can adopt the data processing method or data processing device provided in at least one embodiment of the present disclosure.

[0203] In some embodiments, the data processing device provided by at least one embodiment of the present disclosure may be a chip. For example, the chip is a System-on-a-Chip (SoC). The system-on-a-chip includes a processor, and the processor may be a single-core processor or a multi-core processor, a memory, and an I / O interface, etc. After the processor loads the data and application programs in the memory, it processes the data, such as performing computational processing for backpropagation calculation.

[0204] It should be noted that for the activation tensor of the data processing method or data processing device provided by at least one embodiment of the present disclosure, its specific physical meaning may be different according to different application scenarios. For example, the data processing method provided by at least one embodiment of the present disclosure can be applied in fields such as speech processing, image processing, text processing, and video processing.

[0205] For example, in the field of speech processing, the activation tensor can be input and output parameters involved in convolution operations in tasks such as feature extraction, speech enhancement, and speech recognition.

[0206] For example, in the field of image processing, the activation tensor can be input and output parameters involved in convolution operations in tasks such as image recognition, feature extraction, image segmentation, object detection, image classification, and scene reconstruction.

[0207] For example, in the field of text processing, the activation tensor can be input and output parameters involved in convolution operations in tasks such as text classification, sentiment analysis, and text generation.

[0208] For example, in the field of video processing, the activation tensor can be the relevant parameters in the image processing field as described above, or input and output parameters involved in convolution operations that are unique to the video processing field, such as an optical flow operator (used to estimate the motion between video frames) and an object tracking operator (used to track specific objects in a video).

[0209] Of course, the present disclosure is not limited to this. For other application scenarios or fields, as long as convolution operations are required, the data processing method described in at least one embodiment of the present disclosure can be applied, and details are not elaborated here one by one.

[0210] Figure 12 It is a schematic structural diagram of the processor provided by at least one embodiment of the present disclosure. As Figure 12 shown, the processor 200 includes an instruction parsing unit 201, an execution unit 202, a first cache 203, and a second cache 204.

[0211] For example, the instruction parsing unit 201 is used to receive and parse data processing instructions.

[0212] For example, the data processing instruction is used to perform arithmetic operations on the input gradient tensor and the activation tensor during the backpropagation process to obtain the weight gradient tensor.

[0213] For example, the data processing instruction is used to load the input gradient tensor and the activation tensor from the first cache 203 into the second cache 204 during the backpropagation process.

[0214] For example, the first cache 203 includes a global cache, and the second cache 204 may include shared memory. For example, the processor 200 may adopt the foregoing Figure 3 graphics processor or general graphics processor architecture shown.

[0215] For example, after the instruction parsing unit parses the data processing instruction, the execution unit 202 executes the data processing instruction.

[0216] For example, after the processor receives the data processing instruction, it parses the data processing instruction, such as decoding the data processing instruction, generates microinstructions and sends the microinstructions to the instruction distribution unit; the instruction distribution unit sends them to the corresponding scheduling queue according to the microinstruction category; the scheduler in the processor will select appropriate microinstructions from the scheduling queue for execution according to factors such as the priority and dependency of the microinstructions; in response to the microinstructions, after all or the required input data (such as the activation tensor and the convolution kernel tensor) is ready, the execution unit reads the data and performs the relevant operations of the data processing instruction.

[0217] For example, the execution unit may include the hardware involved in executing the data processing instruction, such as a multiplier, a register, a queue, an ALU (Arithmetic Logic Unit), etc.

[0218] For example, when the execution unit 202 executes the data processing instruction, it includes loading a plurality of first elements of the input gradient tensor and a plurality of second elements of the activation tensor from the first cache into the second cache, where the plurality of second elements are a plurality of elements in the activation tensor corresponding to the target sub-tensor; reading the plurality of first elements from the second cache to the tensor calculation module; and the tensor calculation module multiplexing the plurality of second elements to perform n second operations to obtain the target sub-tensor, and each second operation is used to obtain the target element in the target sub-tensor.

[0219] When the upper-layer software based on the processor (such as AI applications, HPC applications, and scientific computing applications, etc.) can send data processing instructions for convolution operations to the processor (such as a CPU or a GPU) through a unified encapsulated function library, the data processing instruction may carry input parameters such as a storage address; when the processor receives the data processing instruction, the instruction parsing unit 201 parses the data processing instruction, obtains the input parameters, loads the data indicated by the storage address from the memory into the register, and caches it in the cache component.

[0220] For example, the execution unit includes computing units, and different computing units are configured to execute different first operations.

[0221] Regarding the specific process of using the execution unit 202 to execute data processing instructions, reference may be made to relevant contents such as steps S10 - S20 in the data processing method described above, and repeated parts will not be elaborated here.

[0222] The processor provided by at least one embodiment of the present disclosure can achieve technical effects similar to those of the foregoing data processing method, and repeated parts will not be elaborated here.

[0223] Figure 13 It is a schematic block diagram of an electronic device provided by an embodiment of the present disclosure. As Figure 13 shown, the electronic device 300 is, for example, suitable for implementing the data processing method provided by the embodiments of the present disclosure. It should be noted that Figure 13 the components of the electronic device 300 shown are exemplary rather than restrictive. According to actual application needs, the electronic device 300 may also have other components.

[0224] As Figure 13 shown, the electronic device 300 may include a processing device (such as a central processing unit, a graphics processing unit, etc.) 301, which can execute various appropriate actions and processes according to non - transient computer - executable instructions stored in the memory to implement various functions.

[0225] For example, when the computer - executable instructions are run by the processing device 301, one or more steps in the data processing method according to any of the foregoing embodiments can be executed. It should be noted that for a detailed description of the processing process of the data processing method, reference can be made to the relevant descriptions in the embodiments of the foregoing data processing method.

[0226] For example, the memory may include any combination of one or more computer program products. The computer program products may include various forms of computer - readable storage media, such as volatile memory and / or non - volatile memory. Volatile memory may, for example, include random access memory (RAM) 303 and / or cache memory, etc. For example, computer - executable instructions can be loaded from the storage device 308 into the random access memory (RAM) 303 to run the computer - executable instructions. Non - volatile memory may, for example, include read - only memory (ROM) 302, hard disk, erasable programmable read - only memory (EPROM), portable compact disc read - only memory (CD - ROM), USB memory, flash memory, etc. Various application programs and various data can also be stored in the computer - readable storage media, such as style images, and various data used and / or generated by the application programs, etc.

[0227] For example, the processing device 301, the ROM 302, and the RAM 303 are connected to each other via a bus 304. The input / output (I / O) interface 305 is also connected to the bus 304.

[0228] Typically, the following devices can be connected to the I / O interface 305: an input device 306 including, for example, a touch screen, a touchpad, a keyboard, a mouse, a camera, a microphone, an accelerometer, a gyroscope, etc.; an output device 307 including, for example, a liquid crystal display (LCD), a speaker, a vibrator, etc.; a storage device 308 including, for example, a magnetic tape, a hard disk, a flash memory, etc.; and a communication device 309. The communication device 309 can allow the electronic device 300 to communicate with other electronic devices wirelessly or wiredly to exchange data. Although Figure 13 the electronic device 300 with various devices is shown, it should be understood that it is not required to implement or have all the shown devices, and the electronic device 300 can alternatively implement or have more or fewer devices. For example, the processing device 301 can control other components in the electronic device 300 to perform desired functions. The processing device 301 can be a central processing unit (CPU), a tensor processing unit (TPU), a graphics processing unit GPU, or other devices with data processing capabilities and / or program execution capabilities. The central processing unit (CPU) can be of the X86, ARM, RISC-V architecture, etc. The GPU can be directly integrated into the SOC, directly integrated onto the motherboard, or built into the north bridge chip of the motherboard.

[0229] Figure 14 Schematic diagram of a non-transitory computer-readable storage medium provided by at least one embodiment of the present disclosure. For example, as Figure 14 shown, the storage medium 400 can be a non-transitory computer-readable storage medium, and one or more computer-executable instructions 401 can be non-temporarily stored on the storage medium 400. For example, when the computer-executable instructions 401 are executed by a processor, one or more steps of the data processing method described above can be executed.

[0230] For example, the storage medium 400 can be applied to the electronic device 300. For example, the storage medium 400 can include the storage device 308 in the electronic device 300.

[0231] For example, the storage device may include any combination of one or more computer program products, and the computer program products may include various forms of computer-readable storage media, such as volatile memory and / or non-volatile memory. Volatile memory may include, for example, random access memory (RAM) and / or cache memory. Non-volatile memory may include, for example, read-only memory (ROM), hard disk, erasable programmable read-only memory (EPROM), portable compact disc read-only memory (CD-ROM), USB memory, flash memory, etc. One or more computer-executable instructions may be stored on the computer-readable storage media, and the processor may run the computer-executable instructions to implement various functions of the processor. Various application programs and various data may also be stored in the storage media.

[0232] For example, the storage medium may include a memory card of a smart phone, a cache component of a tablet computer, a hard disk of a personal computer, random access memory (RAM), read-only memory (ROM), erasable programmable read-only memory (EPROM), portable compact disc read-only memory (CD-ROM), flash memory, or any combination of the above storage media, and may also be other applicable storage media.

[0233] The flowcharts and block diagrams in the accompanying drawings illustrate the possible architectures, functions, and operations of systems, methods, and computer program products according to various embodiments of the present disclosure. In this regard, each block in the flowchart or block diagram may represent a module, a program segment, or a part of code that contains one or more executable instructions for implementing the specified logical function. It should also be noted that in some alternative implementations, the functions marked in the blocks may occur in a different order than marked in the accompanying drawings. For example, two consecutive blocks shown may actually be executed substantially in parallel, and they may sometimes be executed in the reverse order, depending on the functions involved. It should also be noted that each block in the block diagram and / or flowchart, and the combination of blocks in the block diagram and / or flowchart, may be implemented by a dedicated hardware-based system for performing the specified functions or operations, or may be implemented by a combination of dedicated hardware and computer instructions.

[0234] The units described in the embodiments of the present disclosure may be implemented in software or in hardware. Among them, the name of the unit does not constitute a limitation to the unit itself in some cases.

[0235] The functions described above in this document can be performed, at least in part, by one or more hardware logic components. For example, without limitation, exemplary types of hardware logic components that can be used include: Field Programmable Gate Arrays (FPGAs), Application Specific Integrated Circuits (ASICs), Application Specific Standard Products (ASSPs), Systems on Chip (SOCs), Complex Programmable Logic Devices (CPLDs), and so on.

[0236] The above description is only a preferred embodiment of the present disclosure and an explanation of the technical principles applied. Those skilled in the art should understand that the scope of disclosure involved in the present disclosure is not limited to the technical solutions formed by the specific combination of the above technical features. At the same time, it should also cover other technical solutions formed by any combination of the above technical features or their equivalent features without departing from the above disclosure concept. For example, the technical solutions formed by mutually replacing the above features with the technical features (but not limited to) having similar functions disclosed in the present disclosure.

[0237] In addition, although the operations are depicted in a specific order, this should not be construed as requiring that the operations be performed in the specific order shown or in a sequential order. In certain environments, multitasking and parallel processing may be advantageous. Similarly, although several specific implementation details are included in the above discussion, these should not be construed as limiting the scope of the present disclosure. Certain features described in the context of separate embodiments can also be implemented combinatorially in a single embodiment. Conversely, the various features described in the context of a single embodiment can also be implemented separately or in any suitable sub-combination in multiple embodiments.

[0238] Although the subject matter has been described in language specific to structural features and / or methodological logical acts, it should be understood that the subject matter defined in the appended claims is not necessarily limited to the specific features or acts described above. On the contrary, the specific features and acts described above are merely example forms for implementing the claims.

[0239] Regarding the present disclosure, the following points also need to be noted:

[0240] (1) The drawings of the embodiments of the present disclosure only relate to the structures involved in the embodiments of the present disclosure. Other structures can refer to the general design.

[0241] (2) Without conflict, the embodiments of the present disclosure and the features in the embodiments can be combined with each other to obtain new embodiments.

[0242] The above is only the specific implementation manner of the present disclosure, but the protection scope of the present disclosure is not limited thereto. The protection scope of the present disclosure should be subject to the protection scope of the claims.

Claims

1. A data processing method for performing an operation on an input gradient tensor and an activation tensor during backpropagation to obtain a weight gradient tensor, the method comprising: Performing a first operation multiple times to obtain multiple weight gradient subtensors, wherein the weight gradient tensor includes a height direction and a width direction, and each weight gradient subtensor is a part of the weight gradient tensor divided according to a 1×n granularity within a two-dimensional matrix formed by the height direction and the width direction, and n is an integer greater than 1; and Arranging the multiple weight gradient subtensors to obtain the weight gradient tensor, wherein each time the first operation is performed to obtain a target subtensor among the multiple weight gradient subtensors, the first operation includes: Loading multiple first elements of the input gradient tensor and multiple second elements of the activation tensor from a first cache to a second cache, wherein the multiple second elements are multiple elements in the activation tensor corresponding to the target subtensor; Reading the multiple first elements from the second cache to a tensor calculation module; and The tensor calculation module reusing the multiple second elements to perform n second operations to obtain the target subtensor, wherein each second operation is used to obtain a target element in the target subtensor, The second operation includes: Reading the multiple second elements to obtain multiple third elements required for the second operation; and Determining the target element based on the multiple first elements and the multiple third elements.

2. The method according to claim 1, wherein The multiple first elements are elements in one of multiple input gradient subtensors obtained by dividing the input gradient tensor according to a division granularity, and the multiple first elements and the multiple third elements correspond one by one, Determining the target element based on the multiple first elements and the multiple third elements includes: Calculating the sum of products of corresponding elements between the multiple first elements and the multiple third elements; and Adding the multiple sums of products corresponding to the multiple input gradient subtensors to obtain the target element.

3. The method according to claim 1, wherein, Loading the multiple first elements of the input gradient tensor and the multiple second elements of the activation tensor from the first cache to the second cache includes: Loading multiple elements in the input gradient tensor from the first cache to the second cache as the multiple first elements according to a first shape size; Determining a second shape size of the multiple second elements based on the first shape size and n; Determining a starting position of the multiple second elements; and Loading multiple elements in the activation tensor from the first cache to the second cache as the multiple second elements based on the second shape size and the starting position.

4. The method according to claim 3, wherein, The input gradient tensor is represented as [N, P, Q, K], where P represents height, Q represents width, N represents the number of batches, and K represents the number of output channels. The first shape dimension is [K1, D], where K1 represents the dimension of the multiple first elements in the output channel number dimension, and D represents the dimension of the multiple first elements in the first channel dimension. The first channel dimension is obtained by unfolding the input gradient tensor in the height dimension, width dimension, and batch number dimension into one dimension. K1 is less than or equal to K. The activation tensor is represented as [N, H, W, C], where W represents width, H represents height, and C represents the number of input channels. The second shape dimension is [D + n - 1, C1], where D + n - 1 represents the dimension of the multiple second elements in the second channel dimension. The second channel dimension is obtained by unfolding the activation tensor in the height dimension, width dimension, and batch number dimension into one dimension. C1 represents the dimension of the activation tensor in the input channel number dimension. C1 is less than or equal to C.

5. The method according to claim 4, wherein Reading the multiple second elements to obtain the multiple third elements required for the second operation includes: Determining the positions of the multiple third elements among the multiple second elements, where the shape dimension of the multiple third elements is [D, C1], and D is the dimension in the second channel dimension; and Obtaining the multiple third elements based on the data block with the shape dimension [D, C1] at the positions among the multiple second elements.

6. The method according to claim 5, wherein, Determining the starting position of the multiple second elements includes: Obtaining the padding parameters of the activation tensor; Determining the minimum index values of the weight gradient sub-tensor in the height direction and the width direction; and Determining the starting position based on the minimum index value and the padding parameters.

7. The method according to claim 6, wherein The weight gradient tensor is represented as [R, S, K, C], where R represents height and S represents width. The index is [R1, S1, K2, C2], and the padding parameter is (f, g). K2 is less than K, and C2 is less than C. Determining the starting position based on the minimum index value and the padding parameters includes: Determining that the starting coordinates of the multiple second elements are [N1, R1 - f, S1 - g, C2], where N1 is the batch where the element corresponding to the minimum index value is located, C2 is the input channel where the element corresponding to the minimum index value is located, and N1, f, g, R1, S1, and C2 are all integers greater than or equal to 0; and Transforming the starting coordinates into the valid range of the activation tensor to obtain the starting position.

8. The method according to claim 7, wherein Transforming the starting coordinates into the valid range of the activation tensor to obtain the starting position includes: In the order of the width dimension and the height dimension, sequentially converting the coordinate value of the starting coordinates in the width dimension and the coordinate value in the height dimension into coordinate values greater than or equal to 0.

9. The method according to claim 8, wherein, In the order of the width dimension and the height dimension, sequentially converting the coordinate value of the starting coordinates in the width dimension and the coordinate value in the height dimension into coordinate values greater than or equal to 0 includes: Judging whether S1 - g is less than 0; In response to S1-g < 0, transform the starting coordinates [N1, R1-f, S1-g, C2] into [N1, R1-f-t1, S1-g+t1×W, C2] such that S1-g+t1×W >= 0, where t1 is the ceiling of |S1-g| / W, and in response to R1-f-t1 < 0, further transform [N1, R1-f-t1, S1-g+t1×W, C2] into [N1-t2, R1-f-t1+t2×H, S1-g+t1×W, C2] such that R1-f-t1+t2×H >= 0, where t2 is the ceiling of |R1-f-t1| / H; In response to S1-g >= 0, determine whether R1-f is less than 0; In response to S1-g >= 0 and R1-f < 0, transform the starting coordinates [N1, R1-f, S1-g, C2] into [N1-t3, R1-f+t3×H, S1-g, C2] such that R1-f+t3×H >= 0, where t3 is the ceiling of |R1-f| / H.

10. The method according to claim 7 or 8, wherein Based on the data block with the shape and size of [D, C1] at the position among the multiple second elements, obtain the multiple third elements, including: Determine the filling positions for filling in the data block according to the index minimum value and the filling parameter; and Mask the elements at the filling positions to obtain the multiple third elements.

11. The method according to claim 1, wherein Use a producer warp to load the multiple first elements of the input gradient tensor and the multiple second elements of the activation tensor from the first cache to the second cache; and Use a consumer warp to read the multiple first elements from the second cache to the tensor calculation module, and the tensor calculation module multiplexes the multiple second elements to perform the second operation n times to obtain the target sub-tensor.

12. The method according to claim 11, wherein, The consumer warp includes a first warp and a second warp, and the first warp and the second warp use the tensor calculation module in a ping-pong strategy, wherein the first warp and the second warp are used to obtain different weight gradient sub-tensors.

13. The method according to claim 12, further comprising: Call a vector calculation module to perform further calculation processing on the weight gradient sub-tensor; Wherein, during the execution of the first operation by the first warp, the second warp executes the calculation processing; during the execution of the first operation by the second warp, the first warp executes the calculation processing.

14. The method according to any one of claims 1-7, wherein, Use a tensor memory access instruction to load the multiple first elements of the input gradient tensor and the multiple second elements of the activation tensor from the first cache to the second cache.

15. The method according to any one of claims 1-7, wherein, n is the size of the weight gradient tensor in the width direction, and according to the division method with a granularity of 1×n, arrange the multiple weight gradient sub-tensors to obtain the weight gradient tensor, including: Arrange n weight gradient sub-tensors in the height direction order to obtain the n×n weight gradient tensor.

16. A processor, comprising an instruction parsing unit and an execution unit, wherein, the instruction parsing unit is configured to receive and parse data processing instructions, wherein the data processing instructions are used to perform arithmetic operations on an input gradient tensor and an activation tensor during backpropagation to obtain a weight gradient tensor, after the instruction parsing unit parses the data processing instructions, the execution unit executes the data processing method according to any one of claims 1-15.

17. An electronic device, comprising: a memory that non-transitorily stores computer-executable instructions; a processor configured to run the computer-executable instructions, wherein when the computer-executable instructions are run by the processor, the data processing method according to any one of claims 1-15 is implemented.

18. A non-transitory computer-readable storage medium, wherein, The non-transitory computer-readable storage medium stores computer-executable instructions, and when the computer-executable instructions are executed by a processor, the data processing method according to any one of claims 1-15 is implemented.

Citation Information

Patent Citations

  • Image processing method and device, electronic equipment and storage medium

    CN114463553A

  • Data processing method and device, processor, electronic equipment and storage medium

    CN118503600A

  • Magnetic gradient tensor field detection data error identification and labeling method

    CN118606786A

  • Data processing method and device, processor, electronic equipment and storage medium

    CN119089948A

  • Data processing method and device, processor, electronic equipment and storage medium

    CN119312003A

Cited By

  • Data processing method, data processing device, electronic equipment and storage medium

    CN120744191A

  • Data scheduling method suitable for neural network accelerator and electronic equipment

    CN120994408A

  • Data processing method and device, processor, electronic equipment and storage medium

    CN121071276A

  • Data processing method and device, processor, electronic device, and storage medium

    CN121071276B

  • Data processor, method, electronic device and storage medium

    CN121209965A