Tensor folding method and device, storage medium and program product

By folding large tensors into multiple batches of sub-tensors and performing memory handling, the memory handling problem under the chip dimension size limit is solved, the model performance tuning effect is improved, and resource consumption is reduced.

CN118761899APending Publication Date: 2024-10-11SHANGHAI BIREN TECH CO LTD
View PDF 0 Cites 1 Cited by

Patent Information

Application Number
CN202411040041.3
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-07-30
Publication Date
2024-10-11

AI Technical Summary

Technical Problem

The existing technology is difficult to perform memory transfer operations on large tensors that exceed the dimensional size limit of artificial intelligence chips, which affects the performance tuning effect of Vincent graph models.

Method used

By obtaining multiple candidate folding methods, select the target folding method in which the folded sub-tensor contains the smallest filling area, fold the tensor to be processed into multiple batches of target sub-tensors, and perform memory transfer operations to achieve large-scale processing Efficient handling of tensors.

Benefits of technology

It improves the effect of model performance tuning, reduces the consumption of computing resources by artificial intelligence chips, reduces resource consumption, and improves chip performance.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN118761899A_ABST
    Figure CN118761899A_ABST
Patent Text Reader

Abstract

The embodiment of the invention provides a tensor folding method and device, a storage medium and a program product, and relates to the technical field of artificial intelligence, and the method comprises the steps: taking the minimum filling region contained in a folded sub-tensor as a reference, and selecting a target folding mode matched with a to-be-processed tensor from a plurality of candidate folding modes. According to the method, the tensor to be processed is filled to obtain the target filling tensor, and the target filling tensor is folded into multiple batches of target sub-tensors for calculation according to the target folding mode, so that the memory carrying operation can be carried out for the large tensor exceeding the dimension size limitation, the performance optimization of the text graph model is realized, and the calculation efficiency of the text graph model is improved. Therefore, the model performance optimization effect is improved. And secondly, a target folding mode is selected by taking the minimum filling area contained in the folded sub-tensor as a reference, so that when multiple batches of folded target sub-tensors are calculated, calculation resources additionally distributed for the filling area are greatly reduced, and the resource consumption of an artificial intelligence chip is reduced.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The embodiments of the present application relate to the field of artificial intelligence technology, and in particular to a tensor folding method, device, storage medium, and program product. Background Art

[0002] Artificial intelligence models usually refer to neural network models that are trained for inference and prediction, such as image inference models, speech inference models, etc. The operations of artificial intelligence models can be implemented by operators in the computation graph. Operators refer to various operations performed on tensors at each layer in the artificial intelligence model. Tensors are the basic data structure for operator operations. They can be scalars or one-dimensional or multi-dimensional arrays. Different tensors can have different data types and shapes.

[0003] In the performance tuning scenarios of artificial intelligence models such as the Vincent graph model, there are often a large number of memory transfer operations for tensors. As demand increases, the shapes of tensors are becoming more diverse. In some scenarios, the shape of tensors exceeds the size limit of each dimension of the tensor set by the artificial intelligence chip. For such large tensors that exceed the size limit of the dimension, it is difficult for related technologies to directly perform memory transfer operations to achieve performance tuning of the Vincent graph model, which affects the effect of model performance tuning. Summary of the invention

[0004] The embodiments of the present application provide a tensor folding method, device, storage medium and program product for folding a large tensor into multiple batches of sub-tensors, thereby solving the problem that large tensors are difficult to use for model performance tuning because they exceed the dimensional size limit.

[0005] On the one hand, an embodiment of the present application provides a tensor folding method, including:

[0006] Obtain multiple candidate folding methods, each candidate folding method including: the size of the folded sub-tensor;

[0007] Based on the minimum padding area contained in the folded sub-tensor, a target folding method matching the tensor to be processed is selected from the multiple candidate folding methods;

[0008] The tensor to be processed is filled to obtain a target filled tensor, and the target filled tensor is folded into multiple batches of target sub-tensors according to the target folding method.

[0009] On the one hand, an embodiment of the present application provides a tensor folding device, comprising:

[0010] An acquisition module is used to acquire multiple candidate folding methods, each candidate folding method includes: the size of the folded sub-tensor;

[0011] A selection module, configured to select a target folding method matching the tensor to be processed from the plurality of candidate folding methods based on the minimum padding area contained in the folded sub-tensor;

[0012] A folding module is used to fill the tensor to be processed to obtain a target filled tensor, and fold the target filled tensor into multiple batches of target sub-tensors according to the target folding method.

[0013] Optionally, a memory handling module is also included;

[0014] The memory transfer module is specifically used for:

[0015] For the target sub-tensors of the multiple batches, the following memory transfer operations are performed respectively:

[0016] Performing memory address mapping on a target sub-tensor to obtain a target memory address of the target sub-tensor;

[0017] The one target sub-tensor is saved according to the target memory address.

[0018] Optionally, the memory transfer module is specifically used for:

[0019] According to the corresponding positions of the target sub-tensors of the multiple batches in the target filling tensor, the target sub-tensors of the multiple batches are traversed in sequence to perform the following memory transfer operations.

[0020] Optionally, the target sub-tensors of the multiple batches respectively correspond to positions in the target filling tensor, and are represented by row position indices and column position indices of the target sub-tensors of the multiple batches respectively in the target filling tensor.

[0021] Optionally, the memory transfer module is further used for:

[0022] Performing memory address mapping on a target sub-tensor, before obtaining a target memory address of the target sub-tensor, restoring an input memory address of the target sub-tensor to an original memory address corresponding to the target sub-tensor in the target filling tensor;

[0023] The memory transfer module is specifically used for:

[0024] Memory address mapping is performed on an original memory address of the one target sub-tensor to obtain a target memory address of the one target sub-tensor.

[0025] Optionally, the memory transfer module is specifically used for:

[0026] Obtain the row position index and column position index of the one target sub-tensor in the target filling tensor;

[0027] Based on the input memory address of the target sub-tensor, the row position index and the column position index, obtain the original memory address corresponding to the target sub-tensor in the target filling tensor.

[0028] Optionally, the input memory address includes: a row input address and a column input address; the original memory address includes: a row original address and a column original address;

[0029] The memory transfer module is specifically used for:

[0030] Determining the row original address based on the row input address, the row position index, and the width of each target sub-tensor;

[0031] The column original address is determined based on the column input address, the column position index, and the height of each target sub-tensor.

[0032] Optionally, the sum of the height of the tensor to be processed and the filling height of the tensor to be processed is equal to the product of the height of each target sub-tensor and the number of target sub-tensors folded in the column dimension;

[0033] The sum of the width of the tensor to be processed and the padding width of the tensor to be processed is equal to the product of the width of each target sub-tensor and the number of target sub-tensors folded in the row dimension.

[0034] On the one hand, an embodiment of the present application provides a computer device, including a memory, an artificial intelligence chip, and a computer program stored in the memory and executable on the artificial intelligence chip, wherein the artificial intelligence chip implements the steps of the above-mentioned tensor folding method when executing the program.

[0035] On the one hand, an embodiment of the present application provides a computer-readable storage medium, which stores a computer program that can be executed by a computer device. When the program is run on the computer device, the computer device executes the steps of the above-mentioned tensor folding method.

[0036] On the one hand, an embodiment of the present application provides a computer program product, which includes a computer program stored on a computer-readable storage medium, and the computer program includes program instructions. When the program instructions are executed by a computer device, the computer device performs the steps of the above-mentioned tensor folding method.

[0037] In the embodiment of the present application, the target folding method that matches the tensor to be processed is selected from multiple candidate folding methods based on the minimum padding area contained in the folded sub-tensor. Then, according to the target folding method, the tensor to be processed is folded into multiple batches of target sub-tensors. Therefore, for large tensors that exceed the dimension size limit, memory transfer operations can also be performed to achieve performance tuning of the Wensheng graph model, thereby improving the effect of model performance tuning. Secondly, the target folding method is selected based on the minimum padding area contained in the folded sub-tensor. Therefore, when calculating the target sub-tensors of multiple batches after folding, the computing resources additionally allocated for the padding area can be greatly reduced, thereby reducing the resource consumption of the artificial intelligence chip and improving the chip performance. BRIEF DESCRIPTION OF THE DRAWINGS

[0038] In order to more clearly illustrate the technical solutions in the embodiments of the present invention, the drawings required for use in the description of the embodiments will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present invention. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying creative labor.

[0039] Figure 1 A schematic diagram of the structure of an artificial intelligence chip provided in an embodiment of the present application;

[0040] Figure 2 A schematic diagram of a flow chart of a tensor folding method provided in an embodiment of the present application;

[0041] Figure 3 A schematic diagram of a tensor to be processed provided in an embodiment of the present application;

[0042] Figure 4 A schematic diagram of a candidate folding method provided in an embodiment of the present application;

[0043] Figure 5 A schematic diagram of a flow chart of a folding mode selection method provided in an embodiment of the present application;

[0044] Figure 6 A schematic diagram of a flow chart of a folding mode selection method provided in an embodiment of the present application;

[0045] Figure 7 A schematic diagram of a memory address of a target filling tensor provided in an embodiment of the present application;

[0046] Figure 8 A schematic diagram of an input memory address of a target subtensor provided in an embodiment of the present application;

[0047] Fig. 9 A schematic diagram of an input memory address of a target subtensor provided in an embodiment of the present application;

[0048] Fig.10 A schematic diagram of the structure of a tensor folding device provided in an embodiment of the present application;

[0049] Fig.11 A schematic diagram of the structure of a computer device provided in an embodiment of the present application. DETAILED DESCRIPTION

[0050] In order to make the purpose, technical solution and beneficial effects of the present invention more clearly understood, the present invention is further described in detail below in conjunction with the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are only used to explain the present invention and are not intended to limit the present invention.

[0051] refer to Figure 1 , which is a structural diagram of an artificial intelligence chip applicable to an embodiment of the present application. The artificial intelligence chip 100 includes at least: a video memory 101, an on-chip cache 102 and multiple computing units 103.

[0052] The video memory 101 may be a high bandwidth memory (HBM) or other types of memory. The on-chip cache 102 is a temporary memory, which has a smaller capacity than the video memory 101 but has a faster data reading and writing speed than the video memory 101.

[0053] The computing unit 103 may be used to execute various types of operators, including but not limited to: a memory transfer operator, a convolution operator, an attention mechanism operator, and a matrix multiplication operator.

[0054] Different computing units 103 may exchange data through the video memory 101 or through the on-chip cache 102 .

[0055] In addition to the above-mentioned structure, the artificial intelligence chip 100 in the present application may also include other structures, which are not specifically limited in the present application.

[0056] The artificial intelligence chip 100 may be: a graphics processing unit (GPU), a general-purpose graphics processing unit (GPGPU), a domain specific architecture (DSA), etc.

[0057] In the performance tuning scenarios of artificial intelligence models such as text and graph models, there are often a large number of memory transfer operations on tensors, such as layout switching, reshaping, permutation, and reshaping + permutation. As the demand increases, the shapes of tensors are becoming more diverse.

[0058] In some scenarios, the shape of a tensor exceeds the size limit of each dimension of the tensor set by the AI ​​chip. For such large tensors that exceed the size limit, related technologies directly perform memory transfer operations to achieve performance tuning of the text graph model, which affects the effect of model performance tuning.

[0059] In view of this, the present application provides a process of a tensor folding method, such as Figure 2 As shown, the process of the method is executed by an artificial intelligence chip and includes the following steps:

[0060] Step 201, obtaining multiple candidate folding methods, each candidate folding method includes: the size of the folded sub-tensor.

[0061] Specifically, the AI ​​chip sets an upper limit on the size of the input tensor in each dimension. For input tensors that exceed the upper limit in at least one dimension, the AI ​​chip cannot directly perform calculations. Instead, the input tensor needs to be folded before being input into the AI ​​chip for calculation.

[0062] For example, the upper limit value of the row dimension (also called W dimension) is set to 1024, and the upper limit value of the column dimension (also called H dimension) is set to 1024.

[0063] When the size of the input tensor is 512*1024, the input tensor does not exceed the upper limit in both row and column dimensions. Therefore, the artificial intelligence chip can perform calculations directly.

[0064] When the size of the input tensor is: 1024*2048, the input tensor does not exceed the upper limit in the row dimension, but the input tensor exceeds the upper limit in the column dimension. Therefore, the artificial intelligence chip cannot perform calculations directly. The input tensor needs to be folded and then input into the artificial intelligence chip for calculation.

[0065] In practical applications, multiple candidate folding methods can be pre-set for different application scenarios or chip types, and the candidate folding methods at least include: the size of the folded sub-tensor. The sizes of the multiple sub-tensors obtained after folding are the same, that is, the widths of the multiple sub-tensors after folding are the same, and the heights of the multiple sub-tensors after folding are the same.

[0066] For example, a candidate folding method specifies that the size of the folded sub-tensor is 512*512, that is, the width and height of each folded sub-tensor are both 512.

[0067] It should be noted that the size of the folded sub-tensors included in the candidate folding methods can be set according to actual conditions, and support real-time adjustment according to actual conditions.

[0068] Step 202 , based on the minimum padding area contained in the folded sub-tensor, select a target folding method that matches the tensor to be processed from multiple candidate folding methods.

[0069] Specifically, since each candidate folding method limits the size of the folded sub-tensor, and the shapes of the tensors to be processed that need to perform tensor folding are diverse, in the actual folding process, there will be a situation where the size of the tensor to be processed is not an integer multiple of the size of the sub-tensor. Specifically including: Case 1, the height of the tensor to be processed is not an integer multiple of the height of the sub-tensor, and the width of the tensor to be processed is an integer multiple of the width of the sub-tensor; Case 2, the height of the tensor to be processed is an integer multiple of the height of the sub-tensor, and the width of the tensor to be processed is not an integer multiple of the width of the sub-tensor; Case 3, the height of the tensor to be processed is not an integer multiple of the height of the sub-tensor, and the width of the tensor to be processed is not an integer multiple of the width of the sub-tensor.

[0070] For example, see Figure 3 , set the upper limit size of the input tensor set by the artificial intelligence chip to: 1024*1024, set the size of the tensor to be processed to: 2600*1024, and the size of the folded sub-tensor limited by the candidate folding method to: 1024*1024.

[0071] It can be seen that the tensor to be processed exceeds the upper limit in the row dimension, and the tensor to be processed does not exceed the upper limit in the column dimension. Therefore, the tensor to be processed needs to be folded in the row dimension.

[0072] Since the width of the tensor to be processed is not an integer multiple of the width of the sub-tensor specified by the candidate folding method, if the tensor to be processed is folded into two sub-tensors (i.e., sub-tensor 0 and sub-tensor 1) according to the candidate folding method, and the two sub-tensors are input into the artificial intelligence chip for calculation, a part of the tensor to be processed with a remaining area of ​​552*1024 in size will not be calculated, which will cause data loss.

[0073] However, the size of the remaining area in the tensor to be processed is smaller than the size of a sub-tensor, so a complete sub-tensor cannot be folded out.

[0074] In order to ensure the integrity of the folded sub-tensors and ensure that the tensor to be processed does not lose data during the folding process, the present application first fills the tensor to be processed to obtain a filled tensor, wherein the size of the filled tensor is an integer multiple of the size of the sub-tensor, and then folds the filled tensor.

[0075] For example, see Figure 4 , set the upper limit size of the input tensor set by the artificial intelligence chip to: 1024*1024, set the size of the tensor to be processed to: 2600*1024, and the size of the folded sub-tensor limited by the candidate folding method to: 1024*1024.

[0076] When the tensor to be processed is folded in the row dimension, since the width of the tensor to be processed is not an integer multiple of the width of the sub-tensor defined by the candidate folding method, the tensor to be processed is padded in the row dimension to obtain a padded tensor, and the size of the padded tensor is: 3072*1024. At this time, the width of the tensor to be padded is an integer multiple of the width of the sub-tensor defined by the candidate folding method.

[0077] Then, the padding tensor is folded into three sub-tensors according to the candidate folding method, namely sub-tensor 0, sub-tensor 1, and sub-tensor 2, where sub-tensor 2 contains the padding area.

[0078] Depend on Figure 4 It can be seen that after the tensor to be processed is folded into multiple sub-tensors, some of the sub-tensors contain padding areas, which have nothing to do with the actual business. After these sub-tensors are input into the artificial intelligence chip, the artificial intelligence chip will not only allocate relevant computing resources to calculate the data of the tensor to be processed contained in the sub-tensor, but also allocate additional relevant computing resources to calculate the padding areas contained in the sub-tensor. The larger the padding area contained in the sub-tensor, the more additional computing resources the artificial intelligence chip consumes.

[0079] In view of this, for each candidate folding method, the present application predetermines that among the multiple sub-tensors obtained by folding the tensor to be processed using the candidate folding method, at least one sub-tensor contains a padding area, and then calculates the total size of the padding areas contained in these sub-tensors. Based on the minimum total size of the padding area, a target folding method that matches the tensor to be processed is selected from multiple candidate folding methods.

[0080] For example, see Figure 5 , set the upper limit size of the input tensor set by the artificial intelligence chip to: 1024*1024, set the size of the tensor to be processed to: 2600*1024. It can be seen that the tensor to be processed exceeds the upper limit value in the row dimension, and the tensor to be processed does not exceed the upper limit value in the column dimension. Therefore, it is necessary to fold the tensor to be processed in the row dimension.

[0081] The size of the sub-tensor in candidate folding method 1 is: 1024*1024, the size of the sub-tensor in candidate folding method 2 is: 512*1024, and the size of the sub-tensor in candidate folding method 3 is: 256*1024.

[0082] If the tensor to be processed is folded according to candidate folding method 1, the tensor to be processed needs to be filled into a 3072*1024 filled tensor first. Then the filled tensor is folded into three sub-tensors, namely sub-tensor 0, sub-tensor 1, and sub-tensor 2. Among them, sub-tensor 2 contains a filling area, and the size of the filling area is: 472*1024.

[0083] If the tensor to be processed is folded according to candidate folding method 2, the tensor to be processed needs to be padded into a padded tensor of 3072*1024 first. Then the padded tensor is folded into 6 sub-tensors, namely sub-tensor 0, sub-tensor 1, ..., sub-tensor 5, where sub-tensor 5 contains a padded area, and the size of the padded area is: 472*1024.

[0084] If the tensor to be processed is folded according to candidate folding method 3, the tensor to be processed needs to be padded into a padded tensor of 2816*1024 first. Then the padded tensor is folded into 11 sub-tensors, namely sub-tensor 0, sub-tensor 1, ..., sub-tensor 10, where sub-tensor 10 contains a padded area, and the size of the padded area is: 216*1024.

[0085] By comparison, it can be seen that the total size of the filling area corresponding to candidate folding method 3 is the smallest. Therefore, candidate folding method 3 is selected as the target folding method that matches the tensor to be processed.

[0086] For example, see Figure 6 , set the upper limit size of the input tensor set by the artificial intelligence chip to: 1024*1024, set the size of the tensor to be processed to: 2600*1500. It can be seen that the tensor to be processed exceeds the upper limit value in both the row dimension and the column dimension. Therefore, it is necessary to fold the tensor to be processed in both the row dimension and the column dimension.

[0087] The size of the sub-tensor in candidate folding method 1 is set to 1024*1024, and the size of the sub-tensor in candidate folding method 2 is set to 512*512.

[0088] If the tensor to be processed is folded according to candidate folding method 1, the tensor to be processed needs to be filled into a 3072*2048 filled tensor first. Then the filled tensor is folded into 6 sub-tensors, namely sub-tensor 0, sub-tensor 1, sub-tensor 2, sub-tensor 3, sub-tensor 4, and sub-tensor 5. Among them, sub-tensor 2, sub-tensor 3, sub-tensor 4, and sub-tensor 5 all contain filled areas, and the total size of multiple filled areas is: 3072*548+472*1500.

[0089] If the tensor to be processed is folded according to candidate folding method 2, the tensor to be processed needs to be filled into a 3072*1536 filled tensor first. Then the filled tensor is folded into 12 sub-tensors, namely sub-tensor 0, sub-tensor 1, ..., sub-tensor 17, among which sub-tensor 2, sub-tensor 3, sub-tensor 4, sub-tensor 5, sub-tensor 11, sub-tensor 12, sub-tensor 13, sub-tensor 14, sub-tensor 15, sub-tensor 16, and sub-tensor 17 all contain filled areas, and the total size of multiple filled areas is: 3072*36+472*1500.

[0090] By comparison, it can be seen that the total size of the filling area corresponding to candidate folding method 2 is smaller, so candidate folding method 2 is selected as the target folding method that matches the tensor to be processed.

[0091] It should be noted that when the total size of the filling areas corresponding to multiple candidate folding methods is equal and meets the condition that the total size of the filling area is minimum, the sizes of the sub-tensors corresponding to the multiple candidate folding methods are compared, and the candidate folding method corresponding to the largest sub-tensor is selected as the target folding method that matches the tensor to be processed.

[0092] Step 203, fill the tensor to be processed to obtain a target filled tensor; and fold the target filled tensor into multiple batches of target sub-tensors according to the target folding method.

[0093] Specifically, the tensor to be processed is first filled to obtain the target filled tensor, so that the size of the target filled tensor is an integer multiple of the size of the sub-tensor corresponding to the target folding method, and then the target filled tensor is folded to obtain multiple batches of target sub-tensors. Multiple batches of target sub-tensors are input into the artificial intelligence chip for calculation in multiple times.

[0094] For example, before tensor folding, each batch includes one tensor to be processed, that is, one tensor to be processed is input to the artificial intelligence chip for calculation each time. Since the size of the tensor to be processed exceeds the upper limit set by the artificial intelligence chip, the tensor to be processed is folded into 6 batches of target sub-tensors according to the selected target folding method, and each batch includes one target sub-tensor. After tensor folding, the 6 batches of target sub-tensors need to be input into the artificial intelligence chip for calculation in 6 times, and one target sub-tensor is input into the artificial intelligence chip for calculation each time.

[0095] In the embodiment of the present application, the target folding method that matches the tensor to be processed is selected from multiple candidate folding methods based on the minimum padding area contained in the folded sub-tensor. Then, according to the target folding method, the tensor to be processed is folded into multiple batches of target sub-tensors. Therefore, for large tensors that exceed the dimension size limit, memory transfer operations can also be performed to achieve performance tuning of the Wensheng graph model, thereby improving the effect of model performance tuning. Secondly, the target folding method is selected based on the minimum padding area contained in the folded sub-tensor. Therefore, when calculating the target sub-tensors of multiple batches after folding, the computing resources additionally allocated for the padding area can be greatly reduced, thereby reducing the resource consumption of the artificial intelligence chip and improving the chip performance.

[0096] In some embodiments, after the target filling tensor is folded into multiple batches of target sub-tensors according to the target folding method, the sum of the height of the tensor to be processed and the filling height of the tensor to be processed is equal to the product of the height of each target sub-tensor and the number of target sub-tensors folded in the column dimension, as shown in the following formula (1):

[0097] sub_H*H_fold = H_large+ padding_h (1)

[0098] Among them, sub_H represents the number of target sub-tensors folded in the column dimension, H_fold represents the height of each target sub-tensor, H_large represents the height of the tensor to be processed, and padding_h represents the padding height of the tensor to be processed.

[0099] The sum of the width of the tensor to be processed and the padding width of the tensor to be processed is equal to the product of the width of each target sub-tensor and the number of target sub-tensors folded in the row dimension, as shown in the following formula (2):

[0100] sub_W*W_fold = W_large+ padding_w (2)

[0101] Among them, sub_W represents the number of target sub-tensors folded in the row dimension, W_fold represents the width of each target sub-tensor, W_large represents the width of the tensor to be processed, and padding_w represents the padding width of the tensor to be processed.

[0102] It should be noted that, except for the target folding method, any other candidate folding method conforms to the above rules in the row dimension and column dimension, that is, the sum of the height of the tensor to be processed and the padding height of the tensor to be processed is equal to the product of the height of each sub-tensor and the number of sub-tensors folded in the column dimension; the sum of the width of the tensor to be processed and the padding width of the tensor to be processed is equal to the product of the width of each sub-tensor and the number of sub-tensors folded in the row dimension.

[0103] For example, set the size of the tensor to be processed to: 2600*1024, using Figure 4 When the candidate folding method in folds the tensor to be processed, the tensor to be processed is first filled into a target filled tensor of 3072*1024. Then the target filled tensor is folded into three batches of target sub-tensors, namely target sub-tensor 0, target sub-tensor 1, and target sub-tensor 2, where the number of sub-tensors folded in the column dimension is 1 and the number of sub-tensors folded in the row dimension is 3. The size of each target sub-tensor is 1024*1024.

[0104] In the row dimension, the width of the tensor to be processed is 2600, the padding width of the tensor to be processed is 472, the width of each target sub-tensor is 1024, and the number of target sub-tensors folded in the row dimension is 3. The sum of the width of the tensor to be processed and the padding width of the tensor to be processed is equal to the product of the width of each target sub-tensor and the number of target sub-tensors folded in the row dimension.

[0105] In the column dimension, the height of the tensor to be processed is 1024, the padding height of the tensor to be processed is 0, the height of each target sub-tensor is 1024, and the number of target sub-tensors folded in the column dimension is 1. The sum of the height of the tensor to be processed and the padding height of the tensor to be processed is equal to the product of the height of each target sub-tensor and the number of target sub-tensors folded in the column dimension.

[0106] In some embodiments, after the target filling tensor is folded into multiple batches of target sub-tensors according to the target folding method, each target sub-tensor can be traversed in turn on the batch dimension for calculation.

[0107] Specifically, according to the corresponding positions of the target sub-tensors of the multiple batches in the target filling tensor, the target sub-tensors of the multiple batches are traversed in sequence to perform the memory transfer operation.

[0108] In the specific implementation, after the target filling tensor is folded into multiple batches of target sub-tensors according to the target folding method, the row position index and column position index of each target sub-tensor in the target filling tensor are constructed. The row position index and column position index of the target sub-tensor are used to characterize the position of the target sub-tensor in the target filling tensor. Then, according to the row position index and column position index of the multiple target sub-tensors, the target sub-tensors of multiple batches are traversed in sequence to perform memory transfer operations; specifically, the target sub-tensors of multiple batches can be traversed in sequence in the order of row dimension first and then column dimension, or in the order of column dimension first and then row dimension.

[0109] For example, set the size of the tensor to be processed to: 2600*1024, using Figure 6 When candidate folding method 2 in folds the tensor to be processed, 18 batches of target sub-tensors are obtained, namely target sub-tensor 0, target sub-tensor 1, ..., target sub-tensor 17. Then, the row position index and column position index of the target sub-tensor of 18 batches are constructed in sequence, where the row position index of target sub-tensor 0 is 0, and the column position index of target sub-tensor 1 is 0; the row position index of target sub-tensor 1 is 0, and the column position index of target sub-tensor 1 is 1; ...; the row position index of target sub-tensor 17 is 17, and the column position index of target sub-tensor 17 is 17.

[0110] When traversing in the order of row dimension first and column dimension second, the traversal order of the target sub-tensors of the 18 batches is: target sub-tensor 0, target sub-tensor 1, ..., target sub-tensor 17.

[0111] When traversing in the order of column dimensions first and then row dimensions, the traversal order of the target sub-tensors of the 18 batches is: target sub-tensor 0, target sub-tensor 6, target sub-tensor 12, target sub-tensor 1, target sub-tensor 7, target sub-tensor 13, …, target sub-tensor 5, target sub-tensor 11, target sub-tensor 17.

[0112] In some embodiments, each time a target sub-tensor is traversed, the following memory transfer operation is performed on the target sub-tensor:

[0113] Perform memory address mapping on a target sub-tensor to obtain the target memory address of the target sub-tensor; save the target sub-tensor according to the target memory address.

[0114] Specifically, the artificial intelligence model includes different modules (for example, residual module, attention mechanism module, etc.), and the layout and shape of tensors supported by different modules may be different. For any two modules that support different layouts and shapes (such as the first module and the second module), in order to enable the output tensor of the first module to be used as the input tensor of the second module for subsequent calculations, it is necessary to first perform a memory transfer operation on the output tensor of the first module to adjust the layout and shape of the output tensor of the first module to the layout and shape supported by the second module, and then input it into the second module for calculation.

[0115] That is to say, in this application, the role of the memory transfer operation is to adjust the layout and shape of the target sub-tensor. In the specific implementation, the memory address mapping relationship can be determined according to the layout and shape before adjustment, and the layout and shape after adjustment. Then, according to the memory address mapping relationship, a memory address mapping is performed on a target sub-tensor to obtain the target memory address of the target sub-tensor, and the target memory address of the target sub-tensor corresponds to the adjusted layout and shape of the target sub-tensor. Then, the target sub-tensor is saved according to the target memory address.

[0116] This application no longer inputs the entire tensor to be processed for memory transfer operations, but folds the tensor to be processed into multiple batches of target sub-tensors, and then inputs each batch of target sub-tensors in turn for memory transfer operations. Therefore, even for large tensors that exceed the dimensional size limit, memory transfer operations can be performed to achieve performance tuning of the Wensheng graph model, thereby improving the effect of model performance tuning.

[0117] In some embodiments, since the size of the tensor to be processed exceeds the upper limit set by the artificial intelligence chip, it is impossible to directly perform memory transfer operations on the tensor to be processed. In view of this, the present application first fills the tensor to be processed to obtain a filled tensor. Then, according to the selected target folding method, the filled tensor is folded into multiple batches of target sub-tensors, and the multiple target sub-tensors belong to different batches and are independent of each other.

[0118] The target sub-tensors of multiple batches are separately transferred to memory, and one batch of target sub-tensors is input to the artificial intelligence chip for memory transfer operation each time, and each batch of target sub-tensors includes one target sub-tensor.

[0119] When performing a memory transfer operation, the accuracy of the memory address before the memory address mapping directly affects the accuracy of the memory address after the memory address mapping, and further affects the accuracy of the memory transfer operation result.

[0120] For the target filling tensor, when the target filling tensor is directly moved to memory, the memory address of the target filling tensor before the memory address mapping can be guaranteed to be correct. If the target filling tensor is directly moved to memory, the target filling tensor is first loaded into memory. At this time, the target filling tensor corresponds to the first memory address in memory, and each target sub-tensor as a data block in the target filling tensor will also correspond to an original memory address.

[0121] For example, see Figure 7 , the first memory address corresponding to the target filling tensor is (X, Y), and the target filling tensor is folded into three target sub-tensors, namely target sub-tensor 0, target sub-tensor 1, and target sub-tensor 2, where the original memory address of target sub-tensor 0 is (x0, y0), the original memory address of target sub-tensor 1 is (x1, y0), and the original memory address of target sub-tensor 2 is (x2, y0).

[0122] According to the memory address mapping relationship, when the first memory address of the target filling tensor is memory-mapped, the original memory addresses of multiple target sub-tensors are respectively memory-mapped to obtain the second memory address of the target filling tensor. Then, the target filling tensor is saved according to the second memory address.

[0123] Since the size of the target filling tensor exceeds the upper limit set by the artificial intelligence chip, it is impossible to directly perform memory transfer operations on the target filling tensor. Therefore, the present application implements memory transfer operations on the target filling tensor by folding the target filling tensor into multiple batches of target sub-tensors and performing memory transfer operations on the multiple batches of target sub-tensors separately.

[0124] When performing memory transfer operations on target sub-tensors of multiple batches respectively, the specific process is as follows:

[0125] When performing a memory transfer operation on the first target sub-tensor, the target sub-tensor is first loaded into the memory. At this time, the target sub-tensor corresponds to an input memory address in the memory. This input memory address is the same as the original memory address corresponding to the first target sub-tensor as a data block in the target fill tensor.

[0126] For example, see Figure 8 , fold the target filling tensor into three target sub-tensors, namely target sub-tensor 0, target sub-tensor 1, and target sub-tensor 2. First load target sub-tensor 0 into memory. At this time, the input memory address of target sub-tensor 0 is (x0, y0), and the input memory address of target sub-tensor 0 is the same as Figure 7 The original memory address of the target subtensor 0 is shown to be the same.

[0127] Therefore, according to the memory address mapping relationship, the input memory address of the first target sub-tensor is memory-mapped, and when the target memory address of the first target sub-tensor is obtained, the target memory address of the first target sub-tensor is correct.

[0128] When the memory transfer operation is performed on the second target sub-tensor, the memory space pre-allocated to the first target sub-tensor will be reallocated to the second target sub-tensor because the memory transfer operation has been performed on the first target sub-tensor. In other words, when the second target sub-tensor is loaded into memory, the input memory address corresponding to the second target sub-tensor in memory is the same as the input memory address corresponding to the first target sub-tensor. However, the input memory address of the second target sub-tensor is different from the original memory address corresponding to the second target sub-tensor when it is used as a data block in the target fill tensor.

[0129] For example, see Fig. 9 , load the target sub-tensor 1 into the memory. At this time, the input memory address of the target sub-tensor 1 is (x0, y0). The input memory address of the target sub-tensor 1 (x0, y0) is the same as Figure 7 The original memory address (x1, y0) of the target subtensor 1 is shown to be different.

[0130] At this time, according to the memory address mapping relationship, the input memory address of the second target sub-tensor is memory-mapped, and when the target memory address of the second target sub-tensor is obtained, the target memory address of the second target sub-tensor is wrong.

[0131] By analogy, the input memory address of each subsequent target sub-tensor is different from the original memory address corresponding to the target sub-tensor when it is used as a data block in the target filling tensor. Therefore, the result of the memory transfer operation is wrong.

[0132] In view of this, the present application first restores the input memory address of the target sub-tensor to the original memory address corresponding to the target sub-tensor in the target filling tensor, and then performs memory address mapping on the original memory address of the target sub-tensor to obtain the target memory address of the target sub-tensor.

[0133] This can ensure the correctness of the memory address before the memory address mapping, and correspondingly ensure the accuracy of the target memory address after the memory address mapping, thereby improving the performance of memory transfer.

[0134] In some embodiments, for each target sub-tensor, the original memory address of the target sub-tensor in the target filling tensor is obtained based on the input memory address, row position index and column position index of the target sub-tensor.

[0135] Specifically, the input memory address includes: a row input address and a column input address; the original memory address includes: a row original address and a column original address.

[0136] Based on the row input address, the row position index, and the width of each target sub-tensor, the row original address is determined. Specifically, the row position index and the width of each target sub-tensor can be multiplied and then added to the row input address to obtain the row original address.

[0137] Based on the column input address, column position index and the height of each target sub-tensor, the column original address is determined. Specifically, the column position index and the height of each target sub-tensor can be multiplied and then added to the column input address to obtain the row original address.

[0138] For example, the first memory address corresponding to the target filling tensor is (X, Y), using Figure 4 The candidate folding method in folds the target filling tensor into three target sub-tensors, namely target sub-tensor 0, target sub-tensor 1, and target sub-tensor 2. The original memory address of target sub-tensor 0 is (x0, y0), the original memory address of target sub-tensor 1 is (x1, y0), and the original memory address of target sub-tensor 2 is (x2, y0), where x0 = 1024, y0 = 1024, x1 = 2048, and x2 = 3072.

[0139] The row position index and column position index of target sub-tensor 0 are both 0; the row position index of target sub-tensor 1 is 1, and the column position index of target sub-tensor 1 is 0; the row position index of target sub-tensor 2 is 2, and the column position index of target sub-tensor 2 is 0. The size of each target sub-tensor is: 1024*1024.

[0140] according to Fig. 9 After the target sub-tensor 1 is loaded into the memory in the manner shown, the input memory address of the target sub-tensor 1 is (x0, y0), which is the same as Figure 7 The original memory address (x1, y0) of the target sub-tensor 1 shown is different. If the input memory address of the target sub-tensor 1 is directly mapped to the memory address, the obtained target memory address will be wrong. Therefore, the input memory address of the target sub-tensor 1 needs to be converted to the original memory address (x1, y0) of the target sub-tensor 1.

[0141] Specifically, the row position index of target sub-tensor 1 is 1, the row input address x0 of target sub-tensor 1 is 1024, and the width of each target sub-tensor is 1024. Therefore, after multiplying the row position index of target sub-tensor 1 and the width of each target sub-tensor, and then adding it to the row input address, the original row address is 2048 (i.e., x1 described above).

[0142] The column position index of target sub-tensor 1 is 0, the column input address y0 of target sub-tensor 1 is 1024, and the height of each target sub-tensor is 1024. Therefore, after multiplying the column position index of target sub-tensor 1 and the height of each target sub-tensor, and then adding it to the column input address, the original column address is 1024 (i.e., y0 described above).

[0143] In an embodiment of the present application, the original memory address of the target sub-tensor in the target filling tensor is obtained based on the input memory address, row position index and column position index of the target sub-tensor. Therefore, when the memory address mapping is subsequently performed based on the original memory address of the target sub-tensor, the correctness of the memory address before the memory address mapping is guaranteed, thereby ensuring the accuracy of the target memory address after the memory address mapping, thereby improving the performance of memory transfer.

[0144] Based on the same technical concept, the present application embodiment provides a structural schematic diagram of a tensor folding device, such as Fig.10 As shown, the tensor folding device 1000 includes:

[0145] The acquisition module 1001 is used to acquire multiple candidate folding modes, each candidate folding mode including: the size of the folded sub-tensor;

[0146] A selection module 1002 is used to select a target folding method that matches the tensor to be processed from the plurality of candidate folding methods based on the minimum filling area contained in the folded sub-tensor;

[0147] The folding module 1003 is used to fill the tensor to be processed to obtain a target filled tensor, and fold the target filled tensor into multiple batches of target sub-tensors according to the target folding method.

[0148] Optionally, a memory handling module 1004 is also included;

[0149] The memory transfer module 1004 is specifically used for:

[0150] For the target sub-tensors of the multiple batches, the following memory transfer operations are performed respectively:

[0151] Performing memory address mapping on a target sub-tensor to obtain a target memory address of the target sub-tensor;

[0152] The one target sub-tensor is saved according to the target memory address.

[0153] Optionally, the memory transfer module 1004 is specifically used for:

[0154] According to the corresponding positions of the target sub-tensors of the multiple batches in the target filling tensor, the target sub-tensors of the multiple batches are traversed in sequence to perform the following memory transfer operations.

[0155] Optionally, the target sub-tensors of the multiple batches respectively correspond to positions in the target filling tensor, and are represented by row position indices and column position indices of the target sub-tensors of the multiple batches respectively in the target filling tensor.

[0156] Optionally, the memory transfer module 1004 is further used for:

[0157] Performing memory address mapping on a target sub-tensor, before obtaining a target memory address of the target sub-tensor, restoring an input memory address of the target sub-tensor to an original memory address corresponding to the target sub-tensor in the target filling tensor;

[0158] The memory transfer module 1004 is specifically used for:

[0159] Memory address mapping is performed on an original memory address of the one target sub-tensor to obtain a target memory address of the one target sub-tensor.

[0160] Optionally, the memory transfer module 1004 is specifically used for:

[0161] Obtain the row position index and column position index of the one target sub-tensor in the target filling tensor;

[0162] Based on the input memory address of the target sub-tensor, the row position index and the column position index, obtain the original memory address corresponding to the target sub-tensor in the target filling tensor.

[0163] Optionally, the input memory address includes: a row input address and a column input address; the original memory address includes: a row original address and a column original address;

[0164] The memory transfer module 1004 is specifically used for:

[0165] Determining the row original address based on the row input address, the row position index, and the width of each target sub-tensor;

[0166] The column original address is determined based on the column input address, the column position index, and the height of each target sub-tensor.

[0167] Optionally, the sum of the height of the tensor to be processed and the filling height of the tensor to be processed is equal to the product of the height of each target sub-tensor and the number of target sub-tensors folded in the column dimension;

[0168] The sum of the width of the tensor to be processed and the padding width of the tensor to be processed is equal to the product of the width of each target sub-tensor and the number of target sub-tensors folded in the row dimension.

[0169] In the embodiment of the present application, the target folding method that matches the tensor to be processed is selected from multiple candidate folding methods based on the minimum padding area contained in the folded sub-tensor. Then, according to the target folding method, the tensor to be processed is folded into multiple batches of target sub-tensors. Therefore, for large tensors that exceed the dimension size limit, memory transfer operations can also be performed to achieve performance tuning of the Wensheng graph model, thereby improving the effect of model performance tuning. Secondly, the target folding method is selected based on the minimum padding area contained in the folded sub-tensor. Therefore, when calculating the target sub-tensors of multiple batches after folding, the computing resources additionally allocated for the padding area can be greatly reduced, thereby reducing the resource consumption of the artificial intelligence chip and improving the chip performance.

[0170] Based on the same technical concept, the embodiment of the present application provides a computer device, such as Fig.11 As shown, it includes at least one artificial intelligence chip 100 and a memory 1101 connected to the at least one artificial intelligence chip. The specific connection medium between the artificial intelligence chip 100 and the memory 1101 is not limited in the embodiment of the present application. Fig.11 In the example, the artificial intelligence chip 100 and the memory 1101 are connected via a bus. The bus can be divided into an address bus, a data bus, a control bus, etc.

[0171] In an embodiment of the present application, the memory 1101 stores instructions that can be executed by at least one artificial intelligence chip 100. At least one artificial intelligence chip 100 can perform the steps of the above-mentioned tensor folding method by executing the instructions stored in the memory 1101.

[0172] Among them, the artificial intelligence chip 100 is the control center of the computer device, and various interfaces and lines can be used to connect various parts of the computer device, and tensor folding can be realized by running or executing instructions stored in the memory 1101 and calling data stored in the memory 1101. Optionally, the artificial intelligence chip 100 may include one or more processing units, and the artificial intelligence chip 100 may integrate an application processor and a modem processor, wherein the application processor mainly processes the operating system, user interface, and application program, etc., and the modem processor mainly processes wireless communication. It is understandable that the above-mentioned modem processor may not be integrated into the artificial intelligence chip 100. In some embodiments, the artificial intelligence chip 100 and the memory 1101 can be implemented on the same chip, and in some embodiments, they can also be implemented separately on independent chips.

[0173] The artificial intelligence chip 100 can be a general-purpose processor, such as a digital signal processor, an application-specific integrated circuit (ASIC), a field programmable gate array or other programmable logic device, a discrete gate or transistor logic device, a discrete hardware component, and can implement or execute the methods, steps, and logic block diagrams disclosed in the embodiments of the present application. A general-purpose processor can be a microprocessor or any conventional processor, etc. The steps of the method disclosed in the embodiments of the present application can be directly embodied as a hardware processor, or can be executed by a combination of hardware and software modules in the processor.

[0174] Memory 1101, as a non-volatile computer-readable storage medium, can be used to store non-volatile software programs, non-volatile computer executable programs and modules. Memory 1101 may include at least one type of storage medium, such as flash memory, hard disk, multimedia card, card-type memory, random access memory (Random Access Memory, RAM), static random access memory (Static Random Access Memory, SRAM), programmable read-only memory (Programmable Read Only Memory, PROM), read-only memory (Read Only Memory, ROM), electrically erasable programmable read-only memory (Electrically Erasable Programmable Read-Only Memory, EEPROM), magnetic storage, disk, optical disk, etc. Memory 1101 is any other medium that can be used to carry or store a desired program code in the form of an instruction or data structure and can be accessed by a computer device, but is not limited thereto. The memory 1101 in the embodiment of the present application can also be a circuit or any other device that can realize a storage function, for storing program instructions and / or data.

[0175] Based on the same inventive concept, an embodiment of the present application provides a computer-readable storage medium, which stores a computer program that can be executed by a computer device. When the program runs on the computer device, the computer device executes the steps of the above-mentioned tensor folding method.

[0176] Based on the same inventive concept, an embodiment of the present application provides a computer program product, which includes a computer program stored on a computer-readable storage medium, and the computer program includes program instructions. When the program instructions are executed by a computer device, the computer device performs the steps of the above-mentioned tensor folding method.

[0177] It will be appreciated by those skilled in the art that embodiments of the present invention may be provided as methods or computer program products. Therefore, the present invention may take the form of a complete hardware embodiment, a complete software embodiment, or an embodiment combining software and hardware. Moreover, the present invention may take the form of a computer program product implemented on one or more computer-usable storage media (including but not limited to disk storage, CD-ROM, optical storage, etc.) containing computer-usable program code.

[0178] The present invention is described with reference to flowcharts and / or block diagrams of methods, devices (systems), and computer program products according to embodiments of the present invention. It should be understood that each process and / or block in the flowchart and / or block diagram, as well as the combination of processes and / or blocks in the flowchart and / or block diagram, can be implemented by computer program instructions. These computer program instructions can be provided to a processor of a general-purpose computer, a special-purpose computer, an embedded processor, or other programmable data processing device to produce a machine, so that the instructions executed by the processor of the computer device or other programmable data processing device generate instructions for implementing the processes in the flowchart and / or block diagram. Figure 1 A process or multiple processes and / or boxes Figure 1 A device that provides the functions specified in a block or multiple blocks.

[0179] These computer program instructions may also be stored in a computer readable memory capable of directing a computer device or other programmable data processing device to operate in a specific manner, so that the instructions stored in the computer readable memory produce a manufactured product including an instruction device, which implements the process Figure 1 A process or multiple processes and / or boxes Figure 1 A function specified in one or more boxes.

[0180] These computer program instructions can also be loaded onto a computer device or other programmable data processing device so that a series of operation steps are executed on the computer device or other programmable device to produce a process implemented by the computer device, thereby providing instructions for implementing the process. Figure 1 A process or multiple processes and / or boxes Figure 1 The steps for the functions specified in one or more boxes.

[0181] Although the preferred embodiments of the present invention have been described, those skilled in the art may make other changes and modifications to these embodiments once they have learned the basic creative concept. Therefore, the appended claims are intended to be interpreted as including the preferred embodiments and all changes and modifications that fall within the scope of the present invention.

[0182] Obviously, those skilled in the art can make various changes and modifications to the present invention without departing from the spirit and scope of the present invention. Thus, if these modifications and variations of the present invention fall within the scope of the claims of the present invention and their equivalents, the present invention is also intended to include these modifications and variations.

Claims

1. A tensor folding method, characterized in that: include: Obtain multiple candidate folding methods, each candidate folding method including: the size of the folded sub-tensor; Based on the minimum padding area contained in the folded sub-tensor, a target folding method matching the tensor to be processed is selected from the multiple candidate folding methods; The tensor to be processed is filled to obtain a target filled tensor, and the target filled tensor is folded into multiple batches of target sub-tensors according to the target folding method.

2. The method according to claim 1, characterized in that Also includes: For the target sub-tensors of the multiple batches, the following memory transfer operations are performed respectively: Performing memory address mapping on a target sub-tensor to obtain a target memory address of the target sub-tensor; The one target sub-tensor is saved according to the target memory address.

3. The method according to claim 2, characterized in that The following memory transfer operations are performed on the target sub-tensors of the multiple batches, respectively, including: According to the corresponding positions of the target sub-tensors of the multiple batches in the target filling tensor, the target sub-tensors of the multiple batches are traversed in sequence to perform the following memory transfer operations.

4. The method according to claim 3, characterized in that The target sub-tensors of the multiple batches respectively correspond to the positions in the target filling tensor, and are represented by the row position indexes and column position indexes of the target sub-tensors of the multiple batches respectively in the target filling tensor.

5. The method according to claim 2, characterized in that Before performing memory address mapping on a target sub-tensor to obtain a target memory address of the target sub-tensor, the method further includes: Restoring the input memory address of the one target sub-tensor to the original memory address corresponding to the one target sub-tensor in the target filling tensor; The performing memory address mapping on a target sub-tensor to obtain a target memory address of the target sub-tensor includes: Memory address mapping is performed on an original memory address of the one target sub-tensor to obtain a target memory address of the one target sub-tensor.

6. The method according to claim 5, characterized in that The step of restoring the input memory address of the target sub-tensor to the original memory address corresponding to the target sub-tensor in the target filling tensor includes: Obtain the row position index and column position index of the one target sub-tensor in the target filling tensor; Based on the input memory address of the target sub-tensor, the row position index and the column position index, obtain the original memory address corresponding to the target sub-tensor in the target filling tensor.

7. The method according to claim 6, characterized in that The input memory address includes: a row input address and a column input address; the original memory address includes: a row original address and a column original address; The obtaining, based on the input memory address of the target sub-tensor, the row position index, and the column position index, an original memory address corresponding to the target sub-tensor in the target filling tensor includes: Determining the row original address based on the row input address, the row position index, and the width of each target sub-tensor; The column original address is determined based on the column input address, the column position index, and the height of each target sub-tensor.

8. The method according to any one of claims 1 to 7, characterized in that: The sum of the height of the tensor to be processed and the filling height of the tensor to be processed is equal to the product of the height of each target sub-tensor and the number of target sub-tensors folded in the column dimension; The sum of the width of the tensor to be processed and the padding width of the tensor to be processed is equal to the product of the width of each target sub-tensor and the number of target sub-tensors folded in the row dimension.

9. A computer device comprising a memory, an artificial intelligence chip, and a computer program stored in the memory and executable on the artificial intelligence chip, characterized in that: When the artificial intelligence chip executes the computer program, the steps of any method described in claims 1 to 8 are implemented.

10. A computer-readable storage medium, characterized in that: It stores a computer program executable by a computer device. When the computer program is run on the computer device, the computer device executes the steps of any method described in claims 1 to 8.

11. A computer program product, characterized in that The computer program product comprises a computer program stored on a computer-readable storage medium, wherein the computer program comprises program instructions, and when the program instructions are executed by a computer device, the computer device is caused to execute the steps of the method according to any one of claims 1 to 8.

Citation Information

Cited By

  • Computational graph optimization method and device, storage medium and program product

    CN119337046A