Tensor convolution calculation method and device, equipment, storage medium and program product

By splicing tensor convolutional calculations, the tensor elements are spliced ​​to form transmission data and perform convolution operations on the target arithmetic logic unit, the problem of low utilization of inter-chip transmission bandwidth is solved, and the calculation performance is improved and data transmission optimization is achieved.

CN119849570APending Publication Date: 2025-04-18SHANGHAI SMARTLOGIC TECHNOLOGY LTD
View PDF 0 Cites 1 Cited by

Patent Information

Application Number
CN202411912935.7
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-12-24
Publication Date
2025-04-18

AI Technical Summary

Technical Problem

In higher-order tensor convolutional calculations, the utilization rate of inter-chip transmission bandwidth is low, resulting in data blocking and computing performance degradation, and the prior art lacks generalization and increases computing costs.

Method used

By reading the tensor information to be transmitted from the source arithmetic logic unit, selecting at least two tensor elements for splicing, forming the transmitted data, and performing convolution operations on the target arithmetic logic unit, the optimization of data transmission and the improvement of computing performance are achieved.

Benefits of technology

The number of transmissions of tensor elements is reduced, the transmission blockage problem is alleviated, the utilization rate of transmission bandwidth is improved, and the universality and computing performance of convolutional computing are enhanced.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119849570A_ABST
    Figure CN119849570A_ABST
Patent Text Reader

Abstract

The invention discloses a tensor convolution calculation method and device, equipment, a storage medium and a program product, and relates to the technical field of application computers, and the method comprises the steps: obtaining to-be-transmitted tensor information of a source arithmetic logic unit, and constructing transmission data according to at least two tensor elements in the tensor information; transmitting the tensor element to the destination arithmetic logic unit based on the transmission; and performing convolution operation on the tensor elements in the target arithmetic logic unit. According to the embodiment of the invention, by adopting a mode of splicing the tensor elements, any additional data transmission device does not need to be additionally arranged between the arithmetic logic units, the optimization of transmission data is realized, and by reducing the transmission quantity of the tensor elements, the problem of transmission blockage is relieved, the utilization rate of transmission bandwidth is improved, and the transmission efficiency is improved. According to the method, different types of input data can be processed, the universality of convolution calculation is enhanced, convolution calculation of tensor elements is carried out based on the spliced transmission data, the convolution calculation speed is increased, and the calculation performance is improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the field of computer technology, and in particular to a tensor convolution calculation method, device, equipment, storage medium and program product. Background Art

[0002] In the field of computer technology, the improvement of high-order tensor convolution computing performance mainly faces three major challenges: the upper limit of on-chip computing resources, the restriction of inter-chip transmission bandwidth, and the lag of inter-chip transmission technology. The rapid development of current processor technology has significantly improved the computing power of high-order tensor convolution computing, but in comparison, the development of inter-chip transmission technology is relatively slow. Especially when calculating high-order tensors, due to the relative lag of inter-chip transmission technology, the problems it brings become particularly prominent. Due to the variability of data characteristics in high-order tensors, the limited inter-chip transmission bandwidth is difficult to be fully utilized, which in turn causes data blocking and affects the overall computing performance. Traditional data transmission methods mainly rely on reusability analysis to design scheduling strategies or add additional transmission devices between arithmetic logic units. Although they solve the problem to a certain extent, they often lack versatility and increase computing costs. Therefore, how to improve the utilization of transmission bandwidth and enhance the versatility of convolution computing without adding additional data transmission devices between arithmetic logic units for tensor element transmission, thereby improving computing performance has become an urgent problem to be solved in the field of computer technology. Summary of the invention

[0003] The present invention provides a tensor convolution calculation method, device, equipment, storage medium and program product, which realizes the optimization of transmitted data, reduces the number of tensor elements in the transmission process, alleviates the transmission congestion problem, improves the utilization rate of transmission bandwidth, and enhances computing performance.

[0004] In one aspect of an embodiment of the present invention, a tensor convolution calculation method is provided, including:

[0005] Acquire tensor information to be transmitted from a source arithmetic logic unit, and construct transmission data according to at least two tensor elements in the tensor information;

[0006] Transmitting tensor elements to a destination arithmetic logic unit based on the transmission data;

[0007] Performs convolution operation on tensor elements at the destination ALU.

[0008] Another aspect of an embodiment of the present invention provides a tensor convolution computing device, including:

[0009] A transmission construction unit, used for acquiring tensor information to be transmitted from a source arithmetic logic unit, and constructing transmission data according to at least two tensor elements in the tensor information;

[0010] A data transfer unit for transferring tensor elements to a destination arithmetic logic unit based on the transfer data;

[0011] The convolution computing unit is used to perform convolution operations on tensor elements in the destination arithmetic logic unit.

[0012] Another aspect of an embodiment of the present invention provides an electronic device, including:

[0013] at least one processor;

[0014] and a memory communicatively coupled to the at least one processor;

[0015] Among them, the memory stores a computer program that can be executed by at least one processor, and the computer program is executed by at least one processor so that the at least one processor can execute any tensor convolution calculation method of the embodiments of the present invention.

[0016] According to another aspect of the present invention, a computer-readable storage medium is provided, wherein the computer-readable storage medium stores computer instructions, and the computer instructions are used to enable a processor to implement the tensor convolution calculation method of any embodiment of the present invention when executed.

[0017] According to another aspect of the present invention, a computer program product is provided. The computer program product includes a computer program. When the computer program is executed by a processor, the tensor convolution calculation method of any embodiment of the present invention is implemented.

[0018] In an embodiment of the present invention, tensor information to be transmitted is read from a source arithmetic logic unit, at least two tensor elements are selected from the tensor information, the tensor elements may be any data items in the tensor information, the selected tensor elements may be spliced ​​to form a spliced ​​data block, the spliced ​​data block is used as transmission data, all tensor elements in the tensor information to be transmitted may be included in the construction process, the transmission data may be constructed, all tensor elements in the tensor information to be transmitted may be transmitted to a destination arithmetic logic unit in the form of transmission data, a preset sliding step size or a preset convolution kernel is obtained, a convolution operation is performed on all tensor elements transmitted by the source arithmetic logic unit in the destination arithmetic logic unit, the convolution kernel may be placed at the starting position of the tensor element, the convolution kernel may be slid on the tensor element according to the preset sliding step size until all tensor elements are covered, the convolution kernel may be multiplied by the tensor element at each sliding position, all products are added, an output value of the convolution operation may be obtained, and subsequent operations may be performed based on the result of the convolution operation. The embodiment of the present invention achieves optimization of transmitted data by splicing tensor elements without adding any additional data transmission devices between arithmetic logic units. By reducing the number of tensor elements transmitted, the transmission congestion problem is alleviated and the utilization rate of the transmission bandwidth is improved. The method of the embodiment of the present invention can process different types of input data, enhance the versatility of convolution calculation, adapt to different computing requirements by changing the number of spliced ​​tensor elements, enhance the flexibility of data transmission, perform convolution operations on tensor elements based on the spliced ​​transmission data, improve the rate of convolution calculation, and thus improve the computing performance of the arithmetic logic unit. BRIEF DESCRIPTION OF THE DRAWINGS

[0019] 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 creative work.

[0020] Figure 1 is a flow chart of a tensor convolution calculation method provided according to Embodiment 1 of the present invention;

[0021] Figure 2 is a flow chart of another tensor convolution calculation method provided according to Embodiment 2 of the present invention;

[0022] Figure 3 It is a schematic diagram of the structure of a device for implementing a tensor convolution calculation method provided by an embodiment of the present invention;

[0023] Figure 4 It is a schematic diagram of the structure of an electronic device for implementing the tensor convolution calculation method of an embodiment of the present invention. DETAILED DESCRIPTION

[0024] In order to enable those skilled in the art to better understand the scheme of the present invention, the technical scheme in the embodiments of the present invention will be clearly and completely described below in conjunction with the drawings in the embodiments of the present invention. Obviously, the described embodiments are only part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work should fall within the scope of protection of the present invention.

[0025] It should be noted that the terms "first", "second", etc. in the specification and claims of the present invention and the above-mentioned drawings are used to distinguish similar objects, and are not necessarily used to describe a specific order or sequence. It should be understood that the data used in this way can be interchanged where appropriate, so that the embodiments of the present invention described herein can be implemented in an order other than those illustrated or described herein. In addition, the terms "including" and "having" and any variations thereof are intended to cover non-exclusive inclusions, for example, a process, method, system, product or device that includes a series of steps or units is not necessarily limited to those steps or units that are clearly listed, but may include other steps or units that are not clearly listed or inherent to these processes, methods, products or devices.

[0026] Embodiment 1

[0027] Figure 1 A tensor convolution calculation method flow chart is provided for an embodiment of the present invention. This embodiment is applicable to the case of optimizing transmission data. The method can be executed by a tensor convolution calculation device. The tensor convolution calculation device can be implemented in the form of hardware and / or software. The tensor convolution calculation device can be configured in an electronic device. Figure 1 As shown, the method includes:

[0028] S101. Obtain tensor information to be transmitted from a source arithmetic logic unit, and construct transmission data according to at least two tensor elements in the tensor information.

[0029] In the embodiment of the present invention, the source arithmetic logic unit can be understood as a component responsible for performing arithmetic and logical operations, and can be used to store tensor information that needs to be transmitted.

[0030] Tensor information can be understood as an array of arbitrary dimensions, in which a single data item is a tensor element. For example, the arbitrary dimension may include: one dimension or three dimensions.

[0031] A tensor element refers to a single data item in the tensor information. For example, the data type of a tensor element may include: a complex type or an integer.

[0032] The transmission data may be understood as a data block, which is constructed from at least two tensor elements and is used for transmission between a source arithmetic logic unit and a destination arithmetic logic unit.

[0033] Specifically, the tensor information to be transmitted is read from the source arithmetic logic unit, and at least two tensor elements are selected from the tensor information. The tensor elements can be any data items in the tensor information. The selected tensor elements can be spliced ​​to form a spliced ​​data block, and the spliced ​​data block is used as transmission data.

[0034] For example, the selected tensor elements may be concatenated using a built-in concatenation function of a deep learning framework or a broadcast mechanism.

[0035] S102. Transmit tensor elements to a destination arithmetic logic unit based on the transmission data.

[0036] In an embodiment of the present invention, the destination arithmetic logic unit is similar to the source arithmetic logic unit, and can be understood as another component responsible for performing arithmetic and logical operations, and is used to receive tensor elements sent by the source arithmetic logic unit. It can be understood that the destination arithmetic logic unit can be used as the source arithmetic logic unit for the next round of convolution calculations.

[0037] Specifically, all tensor elements in the tensor information to be transmitted can be included in the construction process to construct transmission data. All tensor elements in the tensor information to be transmitted can be transmitted to the destination arithmetic logic unit in the form of transmission data. The destination arithmetic logic unit performs subsequent operations based on the acquired tensor elements, wherein each constructed transmission data contains at least two tensor elements. It can be understood that all constructed transmission data contain all tensor elements in the tensor information to be transmitted.

[0038] For example, a data transmission mechanism for transmitting tensor elements to a destination arithmetic logic unit may include: a communication bus transmission mechanism or a mechanism for a destination arithmetic logic unit to access a source arithmetic logic unit register.

[0039] S103. Perform convolution operation on the tensor elements in the destination arithmetic logic unit.

[0040] In the embodiment of the present invention, the convolution operation can be understood as a mathematical operation, which is a process of sliding one function on another function to calculate the sum of products at each position.

[0041] Specifically, a preset sliding step size or a preset convolution kernel can be obtained, and a convolution operation can be performed on all tensor elements transmitted by the source arithmetic logic unit in the destination arithmetic logic unit. The convolution kernel can be placed at the starting position of the tensor element, and the convolution kernel can be slid on the tensor element according to the preset sliding step size until all tensor elements are covered. The convolution kernel can be multiplied by the tensor element at each sliding position, and all products can be added to obtain the output value of the convolution operation. Subsequent operations can be performed based on the result of the convolution operation. In an embodiment of the present invention, tensor information to be transmitted is read from a source arithmetic logic unit, at least two tensor elements are selected from the tensor information, the tensor elements may be any data items in the tensor information, the selected tensor elements may be spliced ​​to form a spliced ​​data block, the spliced ​​data block is used as transmission data, all tensor elements in the tensor information to be transmitted may be included in the construction process, the transmission data may be constructed, all tensor elements in the tensor information to be transmitted may be transmitted to a destination arithmetic logic unit in the form of transmission data, a preset sliding step size or a preset convolution kernel is obtained, a convolution operation is performed on all tensor elements transmitted by the source arithmetic logic unit in the destination arithmetic logic unit, the convolution kernel may be placed at the starting position of the tensor element, the convolution kernel may be slid on the tensor element according to the preset sliding step size until all tensor elements are covered, the convolution kernel may be multiplied by the tensor element at each sliding position, all products are added, an output value of the convolution operation may be obtained, and subsequent operations may be performed based on the result of the convolution operation. The embodiment of the present invention achieves optimization of transmitted data by splicing tensor elements without adding any additional data transmission devices between arithmetic logic units. By reducing the number of tensor elements transmitted, the transmission congestion problem is alleviated and the utilization rate of the transmission bandwidth is improved. The method of the embodiment of the present invention can process different types of input data, enhance the versatility of convolution calculation, adapt to different computing requirements by changing the number of spliced ​​tensor elements, enhance the flexibility of data transmission, perform convolution operations on tensor elements based on the spliced ​​transmission data, improve the rate of convolution calculation, and thus improve the computing performance of the arithmetic logic unit.

[0042] Embodiment 2

[0043] Figure 2 This is a flow chart of another tensor convolution calculation method provided by an embodiment of the present invention. Based on the above embodiment, the embodiment of the present invention provides another tensor convolution calculation method. Figure 2 As shown, the method includes:

[0044] S201. Extract tensor information in a source arithmetic logic unit, and determine the element position number of each tensor element in the tensor information.

[0045] In the embodiment of the present invention, the element position number can be understood as an identifier used to identify the specific position of the element in the tensor.

[0046] Specifically, the tensor information to be transmitted is read from the source arithmetic logic unit, each tensor element in the tensor information can be traversed, the element position of each tensor element in the tensor information can be read, and based on the element position of each tensor element in the tensor information read, the element position serial number of each tensor element in the tensor information is determined.

[0047] For example, based on the element position of each tensor element read in the tensor information, the step of determining the element position number of each tensor element in the tensor information may include: using a multidimensional index to calculate the element position number of each linear tensor element or using a built-in indexing function in an arithmetic logic unit to directly obtain the tensor element position number.

[0048] S202. Select two tensor elements as a group of elements to be filled according to the sequence number of the element position numbers.

[0049] In the embodiment of the present invention, the serial number order refers to the order in which tensor elements are arranged in sequence according to the element position serial numbers, which is used for selecting and combining tensor elements.

[0050] The element group to be filled can be understood as a set of elements consisting of two tensor elements, which is used to construct the transmission data.

[0051] Specifically, determine the element position numbers of the tensor elements in the information to be transmitted, arrange the tensor elements in sequence based on the element position numbers of the tensor elements to establish a serial number sequence of each element position number, select two tensor elements in the information to be transmitted according to the determined serial number sequence of each element position number, combine the selected two tensor elements to form an element set containing two tensor elements, and use the element set containing two tensor elements as the element group to be filled for subsequent operations.

[0052] For example, the selection method of selecting two tensor elements in the information to be transmitted may include: selecting two adjacent tensor elements in sequence according to the sequence number order of the element position numbers as the element group to be filled, or selecting tensor elements with a certain interval as the element group to be filled according to the sequence number order of the element position numbers.

[0053] S203 . For each to-be-filled element group, concatenate two tensor elements in the to-be-filled element group into transmission data.

[0054] Specifically, according to the sequence number order of the element position number, all tensor elements in the tensor information can be traversed, and all tensor elements are selected in pairs. Each selected pair of tensor elements is used as a group of elements to be filled. For each group of elements to be filled, the two tensor elements in the group are spliced ​​to form each transmission data.

[0055] S204, transmitting the tensor elements to the destination arithmetic logic unit based on the transmission data.

[0056] S205. Perform convolution operation on the tensor elements in the destination arithmetic logic unit.

[0057] In an embodiment of the present invention, the tensor information to be transmitted is read from the source arithmetic logic unit, each tensor element in the tensor information can be traversed, the element position of each tensor element in the tensor information can be read, and the element position sequence number of each tensor element in the tensor information is determined based on the element position sequence number of each tensor element read in the tensor information, and the tensor elements are arranged in sequence based on the element position sequence number of the tensor element to establish the sequence number order of each element position sequence number, and two tensor elements are selected in the information to be transmitted according to the sequence number order of each element position sequence number that has been determined, and the selected two tensor elements are grouped Combine to form an element set containing two tensor elements, and use the element set containing two tensor elements as the element group to be filled. All tensor elements in the tensor information can be traversed, and all tensor elements are selected in pairs. Each pair of tensor elements selected is used as an element group to be filled. For each element group to be filled, the two tensor elements in the group are spliced ​​to form each transmission data. Based on each transmission data, the tensor elements contained in each transmission data are transmitted to the destination arithmetic logic unit. After receiving the tensor elements, the destination arithmetic logic unit performs a hospital-level operation on the tensor elements. In an embodiment of the present invention, by selecting two tensor elements as an element group to be filled according to the sequence number order of the element position sequence number, the order of data can be ensured, the repeated selection of the same tensor element is avoided, and the accuracy of data transmission is improved. The two tensor elements in the element group to be filled are spliced ​​to form transmission data, and the tensor elements are transmitted to the destination arithmetic logic unit based on the transmission data, which simplifies the data transmission process, reduces the amount of data to be transmitted, and thus reduces transmission delay and bandwidth occupancy, alleviates transmission congestion, and improves transmission efficiency.

[0058] Based on the above embodiments, an embodiment of the present invention, before the destination arithmetic logic unit performs a convolution operation on the tensor elements, further includes: determining a linear offset based on the element values ​​of the tensor information at different time sequences, and processing each tensor element in the tensor information according to the linear offset.

[0059] In the embodiment of the present invention, different time series refer to the time series corresponding to the convolution operation performed on the tensor elements at different time points or stages, which are used to calculate the linear offset of each tensor element.

[0060] The element value can be understood as the specific value of each tensor element at a specified time point or stage, which is used to calculate the linear offset of each tensor element.

[0061] The linear offset can be understood as a numerical value used to adjust the element values ​​of each tensor element.

[0062] Specifically, before the destination arithmetic logic unit performs a convolution operation on the tensor elements of the tensor information, the tensor information at different time sequences can be collected, the element positions can be aligned on the tensor information at different time sequences, the tensor information at all time sequences can be traversed, and for each tensor element at the corresponding position, the difference between the element values ​​of the tensor element at different time sequences is calculated to obtain the element difference of each tensor element, and the element difference can be used as the linear offset of each tensor element, the calculated linear offset is applied to each tensor element in the tensor information at the current time sequence, and the element values ​​of the tensor elements are adjusted to eliminate the linear offset of the element values ​​caused by the splicing of each tensor element, and the convolution operation can be performed in the destination arithmetic logic unit based on the adjusted tensor elements.

[0063] For example, the calculated linear offset is applied to each tensor element in the tensor information at the current time sequence, and the step of adjusting the element value of the tensor element may include: performing a subtraction operation on each tensor element in the tensor information based on the linear offset, or performing an addition operation on each tensor element in the tensor information based on the linear offset, etc.

[0064] Based on the above embodiments, an embodiment of the present invention determines a linear offset based on the element values ​​of tensor information at different time sequences, including: extracting a first tensor and a second tensor corresponding to the tensor information at different time sequences; determining the value errors of tensor elements at the same element positions in the first tensor and the second tensor; accumulating each value error for a preset dimension of the tensor information to obtain a dimensional cumulative error; obtaining a weight coefficient for the preset dimension, and using the product of the weight coefficient and the dimensional cumulative error as the linear offset.

[0065] In the embodiment of the present invention, the first tensor refers to tensor information at a specified time sequence, and can be used as reference tensor information to be compared with the second tensor.

[0066] The second tensor is similar to the first tensor, and refers to tensor information at another specified time sequence, which is used to compare with the first tensor to determine the value error of the same element position. It can be understood that the first tensor and the second tensor have the same data structure.

[0067] The element position refers to the coordinate position of the tensor element, wherein the same element position refers to the coordinate position of the tensor elements with the same element position sequence number in the first tensor and the second tensor. For example, the coordinate position representation method may include: (row, column) or (row, column, depth).

[0068] The value error can be understood as another numerical value that reflects the deviation of the value of each tensor element at different time sequences.

[0069] The preset dimension can be understood as the array dimension of the preset tensor information. For example, the preset dimension can include: one dimension or two dimensions, etc.

[0070] The dimension cumulative error can be understood as a numerical value, which refers to the sum of the errors in the value of all tensor elements in the same element position on the preset dimension.

[0071] The weight coefficient can be understood as a quantitative value, which can be used to adjust the contribution of the value error to the linear offset.

[0072] Specifically, for the tensor information to be transmitted, the first tensor corresponding to the tensor information to be transmitted at a certain specified time sequence and the second tensor corresponding to another specified time sequence are collected, and the element positions of the first tensor and the second tensor are aligned. For each tensor element at the corresponding position, the value error of the tensor element at the corresponding position is calculated, and the preset dimensions of the first tensor and the second tensor are determined. Based on the determined preset dimensions of the first tensor and the second tensor, the value errors of the tensor elements at all corresponding positions in the preset dimensions are accumulated to obtain the cumulative sum of the value errors, and the cumulative sum of the value errors is used as the dimension cumulative error. In the preset dimensions of the first tensor and the second tensor, the weight coefficient corresponding to each position for adjusting the contribution of the value error to the linear offset is determined, and the weight coefficient is multiplied by the dimension cumulative error to obtain the linear offset corresponding to each position.

[0073] On the basis of the above-mentioned embodiment, the embodiment of the present invention processes each tensor element in the tensor information according to the linear offset, including: adding the linear offset to the tensor element corresponding to the tensor information according to the corresponding preset dimension.

[0074] Specifically, the linear offset of each tensor element is determined, and the determined linear offset of each tensor element is added to the tensor element at the corresponding position in the tensor information to adjust the element value of the tensor element and eliminate the deviation of the element value in the tensor information.

[0075] Embodiment 3

[0076] Based on the above embodiment, the embodiment of the present invention provides another tensor convolution calculation method, which includes: setting the number of cores of a known traditional 64-bit computing system to m, the number of arithmetic logic units (ALUs) of each core to n, and the cores to use 3D interconnection, then each ALU can be numbered as ALU 00 ...ALU 01 ...ALU 02 ...ALU mn Under this premise, the minimum transmission granularity between m×nALUs in this computing system is 64 bits. If it is known that a computing instance contains i×j-order tensors, denoted as now that Its corresponding i-th order weight tensor is recorded as In the case of linear offset, the linear offset All elements in contribute to it, so it is also an i-order tensor; at the same time, the linear offset The contribution of all elements in the have the same mapping relationship t; based on the above relationship, the offset (tensor) function is The elements are recorded as In the presence of linear offset, the i-th order tensor after the introduction of linear offset is At this time, due to the existence of linear offset, At the same time and The two work together; according to their relationship, It can also be expressed as: now that for and Based on the above (tensor) function and representation method, traverse the offset i-order (tensor) function And accumulate them according to their dimensions, namely:

[0077]

[0078] Similarly, for the corresponding i-th order weight tensor Transpose Do the same operation, that is:

[0079]

[0080] For the above formula, multiply formula (1) by formula (2) on the left, that is:

[0081]

[0082] At this time, for the above formula, There exists a mapping relationship t, so it is not difficult to know that formula (3) can also be equivalent to the following formula:

[0083]

[0084] in, is the coefficient tensor Elements of is the i-th order vector containing the mapping relation t.

[0085] Based on the above calculations, Equivalent to At the same time, due to the offset The contributions of all elements in are linear superposition, so the offset can be eliminated through a series of linear operations, making Convert to

[0086] If the linear offset does not exist at this time, the i-th order tensor after the linear offset is introduced is At this time, since linear offset does not exist, the offset (tensor) function is a zero tensor, It can be expressed as Similarly, repeating the calculation steps of formula (1), formula (2), formula (3), and formula (4) above, we can also get That is, in the absence of linear offset, the above calculation steps do not change

[0087] Embodiment 4

[0088] Figure 3 A schematic diagram of the structure of a tensor convolution computing device provided by an embodiment of the present invention. Figure 3 As shown, the device comprises:

[0089] A transmission construction unit 301 is used to obtain tensor information to be transmitted from a source arithmetic logic unit, and construct transmission data according to at least two tensor elements in the tensor information;

[0090] A data transmission unit 302, for transmitting tensor elements to a destination arithmetic logic unit based on the transmission data;

[0091] The convolution calculation unit 303 is used to perform convolution operations on tensor elements in the destination arithmetic logic unit.

[0092] In an embodiment of the present invention, tensor information to be transmitted is read from a source arithmetic logic unit, at least two tensor elements are selected from the tensor information, the tensor elements may be any data items in the tensor information, the selected tensor elements may be spliced ​​to form a spliced ​​data block, the spliced ​​data block is used as transmission data, all tensor elements in the tensor information to be transmitted may be included in the construction process, the transmission data may be constructed, all tensor elements in the tensor information to be transmitted may be transmitted to a destination arithmetic logic unit in the form of transmission data, a preset sliding step size or a preset convolution kernel is obtained, a convolution operation is performed on all tensor elements transmitted by the source arithmetic logic unit in the destination arithmetic logic unit, the convolution kernel may be placed at the starting position of the tensor element, the convolution kernel may be slid on the tensor element according to the preset sliding step size until all tensor elements are covered, the convolution kernel may be multiplied by the tensor element at each sliding position, all products are added, an output value of the convolution operation may be obtained, and subsequent operations may be performed based on the result of the convolution operation. The embodiment of the present invention achieves optimization of transmitted data by splicing tensor elements without adding any additional data transmission devices between arithmetic logic units. By reducing the number of tensor elements transmitted, the transmission congestion problem is alleviated and the utilization rate of the transmission bandwidth is improved. The method of the embodiment of the present invention can process different types of input data, enhance the versatility of convolution calculation, adapt to different computing requirements by changing the number of spliced ​​tensor elements, enhance the flexibility of data transmission, perform convolution operations on tensor elements based on the spliced ​​transmission data, improve the rate of convolution calculation, and thus improve the computing performance of the arithmetic logic unit.

[0093] Based on the above embodiment, the transmission construction unit 301 is specifically used to extract the tensor information in the source arithmetic logic unit and determine the element position serial number of each tensor element in the tensor information; according to the serial number order of the element position serial number, two tensor elements are selected as a group of elements to be filled; for each group of elements to be filled, the two tensor elements in the group of elements to be filled are spliced ​​into transmission data.

[0094] Based on the above embodiment, the convolution calculation unit 303 also includes: an offset determination unit, which is used to determine the linear offset based on the element values ​​of the tensor information at different time sequences; and a tensor element processing unit, which is used to process each tensor element in the tensor information according to the linear offset.

[0095] Based on the above embodiments, the offset determination unit is specifically used to extract the first tensor and the second tensor corresponding to the tensor information at different time sequences; determine the value errors of the tensor elements at the same element positions in the first tensor and the second tensor; accumulate the value errors for the preset dimension of the tensor information to obtain the dimension cumulative error; obtain the weight coefficient of the preset dimension, and use the product of the weight coefficient and the dimension cumulative error as the linear offset.

[0096] On the basis of the above embodiment, the tensor element processing unit is specifically used to add the linear offset to the tensor element corresponding to the tensor information according to the corresponding preset dimension.

[0097] Embodiment 4

[0098] Figure 4 A schematic diagram of an electronic device that can be used to implement an embodiment of the present invention is shown. The electronic device is intended to represent various forms of digital computers, such as laptop computers, desktop computers, workstations, personal digital assistants, servers, blade servers, mainframe computers, and other suitable computers. The electronic device may also represent various forms of mobile devices, such as personal digital processing, cellular phones, smart phones, wearable devices (such as helmets, glasses, watches, etc.) and other similar computing devices. The components shown in the embodiments of the present invention, their connections and relationships, and their functions are merely examples and are not intended to limit the implementation of the embodiments of the present invention described and / or required herein.

[0099] like Figure 4 As shown, the electronic device includes at least one processor 11, and a memory connected to the at least one processor 11, such as a read-only memory (ROM) 12, a random access memory (RAM) 13, etc., wherein the memory stores a computer program that can be executed by at least one processor, and the processor 11 can perform various appropriate actions and processes according to the computer program stored in the ROM 12 or the computer program loaded from the storage unit 18 to the RAM 13. In the RAM 13, various programs and data required for the operation of the electronic device 10 can also be stored. The processor 11, the ROM 12, and the RAM 13 are connected to each other through a bus 14. The input / output (I / O) interface 15 is also connected to the bus 14.

[0100] A number of components in the electronic device are connected to the I / O interface 15, including: an input unit 16, such as a keyboard, a mouse, etc.; an output unit 17, such as various types of displays, speakers, etc.; a storage unit 18, such as a disk, an optical disk, etc.; and a communication unit 19, such as a network card, a modem, a wireless communication transceiver, etc. The communication unit 19 allows the electronic device to exchange information / data with other devices through a computer network such as the Internet and / or various telecommunication networks.

[0101] The processor 11 may be a variety of general and / or special processing components with processing and computing capabilities. Some examples of the processor 11 include, but are not limited to, a central processing unit, a graphics processing unit, various special artificial intelligence computing chips, various processors running machine learning model algorithms, digital signal processors, and any appropriate processors, controllers, microcontrollers, etc. The processor 11 performs the various methods and processes described above, for example, the tensor convolution calculation method.

[0102] In some embodiments, the tensor convolution calculation method may be implemented as a computer program, which is tangibly contained in a computer-readable storage medium, such as a storage unit 18. In some embodiments, part or all of the computer program may be loaded and / or installed on the electronic device via the ROM 12 and / or the communication unit 19. When the computer program is loaded into the RAM 13 and executed by the processor 11, one or more steps of the tensor convolution calculation method may be performed. Alternatively, in other embodiments, the processor 11 may be configured as a tensor convolution calculation method in any other appropriate manner (e.g., by means of firmware).

[0103] Various implementations of the systems and techniques described above in the embodiments of the present invention may be implemented in digital electronic circuit systems, integrated circuit systems, field programmable gate arrays, application specific integrated circuits, application specific standard products, systems on a chip, load programmable logic devices, computer hardware, firmware, software, and / or combinations thereof. These various implementations may include: being implemented in one or more computer programs, which may be executed and / or interpreted on a programmable system including at least one programmable processor, which may be a dedicated or general programmable processor, which may receive data and instructions from a storage system, at least one input device, and at least one output device, and transmit data and instructions to the storage system, the at least one input device, and the at least one output device.

[0104] The computer programs for implementing the methods of the embodiments of the present invention may be written in any combination of one or more programming languages. These computer programs may be provided to a processor of a general-purpose computer, a special-purpose computer, or other programmable data processing device, so that when the computer programs are executed by the processor, the functions / operations specified in the flow chart and / or block diagram are implemented. The computer programs may be executed entirely on the machine, partially on the machine, partially on the machine and partially on a remote machine as a stand-alone software package, or entirely on a remote machine or server.

[0105] In the context of an embodiment of the present invention, a computer-readable storage medium may be a tangible medium that may contain or store a computer program for use by an instruction execution system, device or equipment or used in combination with an instruction execution system, device or equipment. A computer-readable storage medium may include, but is not limited to, electronic, magnetic, optical, electromagnetic, infrared, or semiconductor systems, devices or equipment, or any suitable combination of the foregoing. Alternatively, a computer-readable storage medium may be a machine-readable signal medium. A more specific example of a machine-readable storage medium may include an electrical connection based on one or more lines, a portable computer disk, a hard disk, a RAM, a ROM, an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disk read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the foregoing.

[0106] To provide interaction with a user, the systems and techniques described herein may be implemented on an electronic device having: a display device (e.g., a cathode ray tube or a liquid crystal display monitor) for displaying information to the user; and a keyboard and a pointing device (e.g., a mouse or a trackball) through which the user can provide input to the electronic device. Other types of devices may also be used to provide interaction with the user; for example, the feedback provided to the user may be any form of sensory feedback (e.g., visual feedback, auditory feedback, or tactile feedback); and input from the user may be received in any form (including: acoustic input, voice input, or tactile input).

[0107] The systems and techniques described herein may be implemented in a computing system that includes backend components (e.g., as a data server), or a computing system that includes middleware components (e.g., an application server), or a computing system that includes frontend components (e.g., a user computer with a graphical user interface or a web browser through which a user can interact with implementations of the systems and techniques described herein), or a computing system that includes any combination of such backend components, middleware components, or frontend components. The components of the system may be interconnected by any form or medium of digital data communication (e.g., a communication network). Examples of communication networks include: local area networks, wide area networks, blockchain networks, and the Internet.

[0108] A computing system may include a client and a server. The client and the server are generally remote from each other and usually interact through a communication network. The client and server relationship is generated by computer programs running on the respective computers and having a client-server relationship with each other. The server may be a cloud server, also known as a cloud computing server or cloud host, which is a host product in the cloud computing service system to solve the defects of difficult management and weak business scalability in traditional physical hosts and virtual private server services.

[0109] It should be understood that the various forms of processes shown above can be used to reorder, add or delete steps. For example, the steps described in the present invention can be executed in parallel, sequentially or in different orders, as long as the desired results of the technical solution of the present invention can be achieved, and this document does not limit this.

[0110] The above specific implementations do not constitute a limitation on the protection scope of the embodiments of the present invention. It should be understood by those skilled in the art that various modifications, combinations, sub-combinations and substitutions can be made according to design requirements and other factors. Any modification, equivalent substitution and improvement made within the spirit and principle of the present invention should be included in the protection scope of the present invention.

Claims

1. A tensor convolution calculation method, characterized in that: Applied to a computing system, the computing system at least comprising a source arithmetic logic unit and a destination arithmetic logic unit, the method comprising: Acquire tensor information to be transmitted by a source arithmetic logic unit, and construct transmission data according to at least two tensor elements in the tensor information; transmitting the tensor element to a destination arithmetic logic unit based on the transmission data; A convolution operation is performed on the tensor elements at the destination arithmetic logic unit.

2. The method according to claim 1, characterized in that: The step of obtaining tensor information to be transmitted from a source arithmetic logic unit and constructing transmission data according to at least two tensor elements in the tensor information includes: Extracting tensor information in the source arithmetic logic unit, and determining the element position number of each tensor element in the tensor information; According to the sequence number order of the element position numbers, two of the tensor elements are selected as a group of elements to be filled; For each of the to-be-filled element groups, two of the tensor elements in the to-be-filled element group are concatenated into the transmission data.

3. The method according to claim 1, characterized in that: Before the destination arithmetic logic unit performs a convolution operation on the tensor element, the method further includes: Determine a linear offset based on the element values ​​of the tensor information at different time sequences; Each of the tensor elements in the tensor information is processed according to the linear offset.

4. The method according to claim 3, characterized in that: The determining of the linear offset based on the element values ​​of the tensor information at different time sequences includes: Extracting a first tensor and a second tensor corresponding to the tensor information at different time sequences; Determine a value error of tensor elements at the same element position in the first tensor and the second tensor; Accumulating the value errors for the preset dimension of the tensor information to obtain a dimension cumulative error; A weight coefficient of the preset dimension is obtained, and the product of the weight coefficient and the cumulative error of the dimension is used as the linear offset.

5. The method according to claim 3, characterized in that: The processing of each tensor element in the tensor information according to the linear offset includes: The linear offset is added to the tensor element corresponding to the tensor information according to the corresponding preset dimension.

6. A tensor convolution computing device, characterized in that: Applied to a computing system, the computing system at least comprising a source arithmetic logic unit and a destination arithmetic logic unit, the device comprising: A transmission construction module, used for acquiring tensor information to be transmitted by a source arithmetic logic unit, and constructing transmission data according to at least two tensor elements in the tensor information; A data transmission module, configured to transmit the tensor element to a destination arithmetic logic unit based on the transmission data; A convolution calculation module is used to perform a convolution operation on the tensor elements in the destination arithmetic logic unit.

7. A device, characterized in that: The device comprises: at least one processor; and a memory communicatively connected to the at least one processor; wherein, The memory stores a computer program executable by the at least one processor, and the computer program is executed by the at least one processor so that the at least one processor can perform the tensor convolution calculation method described in any one of claims 1-5.

8. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores computer instructions, and the computer instructions are used to enable a processor to implement the tensor convolution calculation method described in any one of claims 1-5 when executed.

9. A computer program product, characterized in that The computer program product comprises a computer program which, when executed by a processor, implements the tensor convolution calculation method according to any one of claims 1 to 5.

Citation Information

Cited By

  • Data loading method, data storage method, processor, electronic equipment and medium

    CN120216401A