Data stream optimization method and medium based on binary broadcast operator of GCU architecture
Patent Information
- Application Number
- CN202610657456.8
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2026-05-13
- Publication Date
- 2026-08-18
AI Technical Summary
[0004]发明人在实现本发明的过程中,发现现有技术二元广播算子在GCU框架上存在如下缺陷:不同维度的数据流不能准确根据张量形状生成适配于第一级缓存的切片尺寸;当输入为多维广播时,通过直接用单维硬件广播原语进行广播导致效率低以及硬件搬运重复;缺乏高效地流水化重叠,造成无法避免的搬运等待以及数据流处理效率低下的问题
[0010] The technical solution of this invention acquires the description information of the data stream to be processed in real time; based on the input tensor, output tensor shape, number of bytes in input elements, and number of bytes in output elements, it performs segmentation and calculation processing using a preset multi-dimensional greedy segmentation strategy to obtain the number of data stream segmentation processing tasks corresponding to each calculation unit; within each calculation unit, it sets an intermediate buffer chain broadcast mechanism or an inner and outer loop setting mechanism based on the description information of the data stream to be processed, and determines the current encapsulation description parameters; it instructs the device to perform data stream calculation processing using a preset asynchronous pipeline architecture transport method based on the received number of data stream segmentation processing tasks corresponding to each calculation unit and the current encapsulation description parameters to obtain the target data stream calculation result. This solves the problems of existing technologies being unable to accurately and flexibly slice data streams of different dimensions, and the low efficiency of data stream transport and optimization processing, improving the flexibility and processing efficiency of binary broadcast operator data stream slicing, reducing redundant transport and broadcasting, and improving the throughput and hardware utilization of data stream processing.
Smart Images

Figure CN122601402A_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of data processing technology, and in particular to a method and medium for optimizing data streams using a binary broadcast operator based on a GCU architecture. Background Technology
[0002] The features related to the binary broadcast operator in the General Compute Unit (GCU) architecture include: a three-level storage hierarchy: Level 3 cache (L3) is global storage, characterized by large capacity and limited bandwidth; Level 2 cache (L2) is shared storage, specifically on-chip shared cache; and Level 1 cache (L1) is private storage, characterized by local visibility to each computation unit, high bandwidth, and small capacity. The data transfer engine provides hardware broadcast capabilities, but only supports broadcasting in one dimension per call. The computation unit adopts a SIMD (Single Instruction, Multiple Data) architecture, requiring inputs to be as continuous and aligned as possible in private storage. The data transfer engine (DTE) and the SIMD computation unit can work in parallel, and an event mechanism can be used to trigger a transfer or broadcast operation first, followed by waiting for completion.
[0003] In deep learning and scientific computing, element-wise operations using binary broadcast operators (such as addition, subtraction, multiplication, division, comparison, and maximum / minimum operations) are the most fundamental and frequently used type of operators. When the shapes of the left and right operand tensors are inconsistent, the smaller tensor needs to be expanded in the corresponding dimension according to broadcast semantics until it matches the output tensor before participating in the operation.
[0004] In the process of realizing this invention, the inventors discovered that the existing binary broadcast operator has the following defects in the GCU framework: data streams of different dimensions cannot accurately generate slice sizes adapted to the first-level buffer based on the tensor shape; when the input is a multi-dimensional broadcast, broadcasting directly using a single-dimensional hardware broadcast primitive leads to low efficiency and repetitive hardware handling; the lack of efficient pipelined overlap causes unavoidable handling waits and low data stream processing efficiency. Summary of the Invention
[0005] This invention provides a binary broadcast operator data stream optimization method and medium based on GCU architecture, so as to improve the flexibility and processing efficiency of binary broadcast operator data stream slicing.
[0006] According to one aspect of the present invention, a binary broadcast operator data stream optimization method based on GCU architecture is provided, wherein the method includes: Real-time acquisition of description information of the data stream to be processed; wherein, the description information of the data stream to be processed includes the input tensor, the shape of the output tensor, the number of bytes of the input elements, and the number of bytes of the output elements; Based on the input tensor, the shape of the output tensor, the number of bytes of the input elements, and the number of bytes of the output elements, the data stream is segmented and processed using a preset multi-dimensional greedy segmentation strategy to obtain the number of data stream segmentation processing tasks corresponding to each computing unit. Within each computing unit, an intermediate buffer chain broadcast mechanism or an inner and outer loop setting mechanism is set according to the description information of the data stream to be processed, and the current encapsulation description parameters are determined. The device is instructed to perform data stream processing according to the number of processing tasks corresponding to each received computing unit and the current encapsulation description parameters, and to obtain the target data stream calculation result through a preset asynchronous pipeline architecture transfer method.
[0007] According to another aspect of the present invention, a binary broadcast operator data stream optimization apparatus based on a GCU architecture is provided, comprising: The module for acquiring description information of the data stream to be processed is used to acquire description information of the data stream to be processed in real time; wherein, the description information of the data stream to be processed includes the input tensor, the shape of the output tensor, the number of bytes of the input elements, and the number of bytes of the output elements; The data stream segmentation processing task number determination module is used to segment and calculate the data stream segmentation processing task number corresponding to each computing unit based on the input tensor, the shape of the output tensor, the number of bytes of the input element and the number of bytes of the output element, and through a preset multi-dimensional greedy segmentation strategy method. The current encapsulation description parameter determination module is used to set an intermediate buffer chain broadcast mechanism or an inner and outer loop setting mechanism according to the data stream description information to be processed in each computing unit, and determine the current encapsulation description parameters. The target data stream calculation result determination module is used to instruct the device to perform data stream calculation processing according to the number of data stream segmentation and processing tasks corresponding to each received calculation unit and the current encapsulation description parameters, and to obtain the target data stream calculation result through a preset asynchronous pipeline architecture transport method.
[0008] According to another aspect of the present invention, an electronic device is provided, including a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor executes the computer program to implement the binary broadcast operator data stream optimization method based on the GCU architecture described in any embodiment of the present invention.
[0009] According to another aspect of the present invention, a computer-readable storage medium is provided, the computer-readable storage medium storing computer instructions, the computer instructions being configured to cause a processor to execute and implement the binary broadcast operator data stream optimization method based on the GCU architecture as described in any embodiment of the present invention.
[0010] The technical solution of this invention acquires the description information of the data stream to be processed in real time; based on the input tensor, output tensor shape, number of bytes in input elements, and number of bytes in output elements, it performs segmentation and calculation processing using a preset multi-dimensional greedy segmentation strategy to obtain the number of data stream segmentation processing tasks corresponding to each calculation unit; within each calculation unit, it sets an intermediate buffer chain broadcast mechanism or an inner and outer loop setting mechanism based on the description information of the data stream to be processed, and determines the current encapsulation description parameters; it instructs the device to perform data stream calculation processing using a preset asynchronous pipeline architecture transport method based on the received number of data stream segmentation processing tasks corresponding to each calculation unit and the current encapsulation description parameters to obtain the target data stream calculation result. This solves the problems of existing technologies being unable to accurately and flexibly slice data streams of different dimensions, and the low efficiency of data stream transport and optimization processing, improving the flexibility and processing efficiency of binary broadcast operator data stream slicing, reducing redundant transport and broadcasting, and improving the throughput and hardware utilization of data stream processing.
[0011] It should be understood that the description in this section is not intended to identify key or essential features of the embodiments of the present invention, nor is it intended to limit the scope of the invention. Other features of the invention will become readily apparent from the following description. Attached Figure Description
[0012] To more clearly illustrate the technical solutions in the embodiments of the present invention, the accompanying drawings used in the description of the embodiments will be briefly introduced below. Obviously, the accompanying drawings described below are only some embodiments of the present invention. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.
[0013] Figure 1 This is a flowchart of a binary broadcast operator data stream optimization method based on GCU architecture according to Embodiment 1 of the present invention; Figure 2 This is a detailed flowchart of a binary broadcast operator data stream optimization method based on GCU architecture according to Embodiment 2 of the present invention; Figure 3 This is a schematic diagram of a binary broadcast operator data stream optimization device based on GCU architecture according to Embodiment 3 of the present invention; Figure 4 This is a schematic diagram of the structure of an electronic device provided according to Embodiment 4 of the present invention. Detailed Implementation
[0014] To enable those skilled in the art to better understand the present invention, the technical solutions of the present invention will be clearly and completely described below with reference to the accompanying drawings of the embodiments of the present invention. Obviously, the described embodiments are only some embodiments of the present invention, and not all embodiments. Based on the embodiments of the present invention, all other embodiments obtained by those skilled in the art without creative effort should fall within the scope of protection of the present invention.
[0015] It should be noted that the terms "target," "current," etc., used in the specification, claims, and accompanying drawings of this invention are used to distinguish similar objects and are not necessarily used to describe a specific order or sequence. It should be understood that such data can be interchanged where appropriate so that embodiments of the invention described herein can be implemented in orders other than those illustrated or described herein. Furthermore, the terms "comprising" and "having," and any variations thereof, are intended to cover non-exclusive inclusion; for example, a process, method, system, product, or apparatus that comprises a series of steps or units is not necessarily limited to those steps or units explicitly listed, but may include other steps or units not explicitly listed or inherent to such processes, methods, products, or apparatus.
[0016] It is worth noting that the information collected in the technical solution of this application is information and data authorized by the user or fully authorized by all parties, and the collection, storage, use, processing, transmission, provision, disclosure and application of the relevant data all comply with the relevant laws, regulations and standards of the relevant countries and regions, take necessary confidentiality measures, do not violate public order and good morals, and provide corresponding operation entry points for users to choose to authorize or refuse; if the user chooses to refuse, the process will proceed to the expert decision-making process.
[0017] Example 1 Figure 1 The flowchart of a binary broadcast operator data stream optimization method based on GCU architecture is provided in Embodiment 1 of the present invention. This embodiment describes a scenario of binary broadcast operator data stream segmentation and scheduling calculation optimization. This method can be executed by a binary broadcast operator data stream optimization device based on GCU architecture, which can be implemented in hardware and / or software.
[0018] Correspondingly, such as Figure 1 As shown, the method includes: S110. Obtain description information of the data stream to be processed in real time.
[0019] The description information of the data stream to be processed includes the input tensor, the shape of the output tensor, the number of bytes of the input elements, and the number of bytes of the output elements.
[0020] The data stream description information to be processed includes various types of information describing the characteristics of the data stream.
[0021] In this embodiment, it is necessary to obtain the description information of the data stream to be processed in real time, which may include the input tensor, the shape of the output tensor, the number of bytes of the input elements, and the number of bytes of the output elements. The input tensor may include left operands and right operands.
[0022] The data flow description information may also include the shape of the input tensor, specifically composed of the shape of the left operand tensor and the shape of the right operand tensor.
[0023] S120. Based on the input tensor, the shape of the output tensor, the number of bytes of the input elements, and the number of bytes of the output elements, the data stream is segmented and processed using a preset multi-dimensional greedy segmentation strategy to obtain the number of data stream segmentation processing tasks corresponding to each computing unit.
[0024] Among them, the multi-dimensional greedy partitioning strategy can be a strategy for partitioning the data stream from low dimension to high dimension. The number of data stream partitioning processing tasks can be the specific number of tasks allocated to different computing units.
[0025] On the server side, the shapes of the input tensors and output tensors, as well as the number of bytes per element, are analyzed in real time to obtain the appropriate current first-level cache capacity, thereby achieving the optimal block partitioning and task scheduling strategy that prioritizes maintaining low-dimensional continuity.
[0026] Optionally, the step of performing segmentation and computation processing based on the input tensor, output tensor shape, number of input element bytes, and number of output element bytes using a preset multi-dimensional greedy segmentation strategy to obtain the number of data stream segmentation processing tasks corresponding to each computational unit includes: obtaining and calculating the current slice size threshold based on the left and right operands corresponding to the input tensor, the current available capacity of the first-level cache, and the number of input element bytes and the number of output element bytes; and performing segmentation and computation processing sequentially from low dimension to high dimension using the multi-dimensional greedy segmentation strategy based on the output tensor shape and the current slice size threshold to obtain the number of data stream segmentation processing tasks corresponding to each computational unit.
[0027] In this embodiment, the largest number of bytes among the left operand, right operand, input element bytes, and output element bytes is selected, and the current available capacity of the first-level cache is divided by this number of bytes to calculate the current slice size threshold. The current slice size threshold can be set as follows: .
[0028] Specifically, the step of performing segmentation and computation processing sequentially from low to high dimensions using the multi-dimensional greedy segmentation strategy method based on the output tensor shape and the current slice size threshold to obtain the number of data stream segmentation processing tasks corresponding to each computation unit includes: obtaining and comparing the length of the lowest-dimensional output dimension corresponding to the lowest dimension of the output tensor shape with the current slice size threshold using the multi-dimensional greedy segmentation strategy method; if the current slice size threshold is greater than or equal to the length of the lowest-dimensional output dimension, then determining the slice size corresponding to the lowest dimension as the length of the lowest-dimensional output dimension, and dividing the current slice size threshold by the length of the lowest-dimensional output dimension to obtain the current remaining capacity; sequentially obtaining the length of the output dimension corresponding to the previous dimension, and determining the current remaining capacity. If the current dimension is greater than or equal to the output dimension length, then the slice size corresponding to the current dimension is determined as the output dimension length, and the slice size is divided by the output dimension length to obtain the new current remaining capacity; otherwise, the output dimension length is divided by the current remaining capacity and rounded up to obtain the current intermediate value, and the output dimension length is divided by the current intermediate value and rounded up to obtain the slice size corresponding to the current dimension. If all dimensions of the output tensor shape have been traversed, and if so, the number of data stream splitting and processing tasks corresponding to each computational unit is calculated based on the slice size corresponding to each dimension; if not, the process returns to the previous step of sequentially obtaining the output dimension length corresponding to the previous dimension and determining whether the current remaining capacity is greater than or equal to the output dimension length.
[0029] In this embodiment, for the i-th dimension, the slice size is: Where R is the current remaining capacity; This is the length of the output dimension.
[0030] For example, suppose the output tensor has the following shape: , The value is 32768. The specific steps are as follows: Obtain the lowest-dimensional output dimension length corresponding to the lowest dimension of the output tensor shape, i.e., the lowest-dimensional output dimension length corresponding to dimension 2 (the lowest dimension) is 256; using a multi-dimensional greedy segmentation strategy, compare 256 with the current slice size threshold of 32768; since 32768 is greater than 256, the slice size corresponding to the lowest dimension can be determined as the lowest-dimensional output dimension length of 256, and the current remaining capacity is obtained by dividing the current slice size threshold by the lowest-dimensional output dimension length. The specific formula is... .
[0031] We sequentially retrieve the output dimension length of 128 corresponding to the previous dimension (i.e., dimension 1), and determine whether the current remaining capacity is greater than or equal to the output dimension length. Since 128 equals 128, we can determine that the slice size corresponding to the current dimension is the output dimension length of 128. We then divide the slice size by the output dimension length to obtain the new current remaining capacity, i.e. .
[0032] Determine whether all dimensions of the output tensor shape have been traversed. Since dimension 0 (the highest dimension) still exists, continue to obtain the output dimension length 8 corresponding to the previous dimension in turn, and determine whether the current remaining capacity is greater than or equal to the output dimension length. Since 1 is less than 8, it is necessary to divide the output dimension length 8 by the current remaining capacity 1 and round up to obtain the current intermediate value 8. Then, divide the output dimension length 8 by the current intermediate value 8 and round up to determine that the slice size corresponding to the current dimension is 1.
[0033] Determine whether all dimensions of the output tensor shape have been traversed. If the traversal is complete, calculate the number of data stream splitting and processing tasks corresponding to each computational unit based on the slice size corresponding to each dimension.
[0034] Specifically, the step of calculating the number of data stream segmentation processing tasks corresponding to each computing unit based on the slice size corresponding to each dimension includes: determining the current slice shape and the current slice quantity based on the slice size corresponding to each dimension; obtaining the number of computing units corresponding to the current GCU in real time; and calculating the number of data stream segmentation processing tasks corresponding to each computing unit by dividing the current slice quantity by the number of computing units and rounding up.
[0035] In this embodiment, based on the slice size corresponding to each dimension—for example, the slice size corresponding to dimension 2 is 256; the slice size corresponding to dimension 1 is 128; and the slice size corresponding to dimension 0 is 1—the current slice shape can be determined as follows: .
[0036] Furthermore, the current number of slices (and the total number of tasks requiring broadcasting) is calculated using a formula. It can be calculated .
[0037] Accordingly, the number of computing units corresponding to the current GCU is obtained in real time. Assuming By dividing the current number of slices by the number of computing units and rounding up, the number of data stream segmentation processing tasks corresponding to each computing unit can be calculated, which is 2.
[0038] The advantage of this setting is that it ensures that the lowest two dimensions of the resulting slice shape are completely continuous, which is beneficial for memory access bandwidth, and at the same time, it aligns the number of tasks with the number of hardware computing units to achieve load balancing.
[0039] S130. Within each computing unit, an intermediate buffer chain broadcast mechanism or an inner and outer loop setting mechanism is set according to the description information of the data stream to be processed, and the current encapsulation description parameters are determined.
[0040] Optionally, the data stream description information to be processed further includes the input tensor shape; the input tensor shape includes the left operand tensor shape and the right operand tensor shape; within each computing unit, an intermediate buffer chain broadcast mechanism is set according to the data stream description information to be processed, and the current encapsulation description parameters are determined, including: in the number of data stream segmentation processing tasks corresponding to each computing unit, based on the current slice shape, it is determined whether the left operand tensor shape and the right operand tensor shape need to be broadcast; if broadcasting is required, a multi-level intermediate buffer is set in the first-level buffer through the intermediate buffer chain broadcast mechanism, and the multi-dimensional broadcast of the operand is decomposed into a chained process of multiple single-dimensional broadcasts, and each intermediate buffer stores the intermediate results after partial dimension expansion is completed, and the current chain broadcast encapsulation description parameters are determined.
[0041] In this embodiment, among the data stream segmentation processing tasks corresponding to each computing unit, the case where there is a data stream for one computing unit is as follows: assuming the shape of the left operand tensor is... The shape of the right operand tensor is The current slice shape is The shape of the right operand tensor can be determined. If broadcasting is not required, skip this operand.
[0042] However, due to the shape of the left operand tensor The lowest and highest dimensions need to be broadcast. This requires a chained broadcast mechanism using intermediate buffers. Multiple intermediate buffers are set up in the first-level cache, and the multi-dimensional broadcast of operands is decomposed into a chained process of multiple single-dimensional broadcasts. Each intermediate buffer stores the intermediate results after partial dimension expansion and determines the encapsulation description parameters for the current chained broadcast. Specifically: allocate three buffers (buffer0, buffer1, and buffer2) on the first-level cache, first storing the lvalues... Copy to buffer0, then use the single-dimensional hardware broadcast primitive to broadcast dimension 2, broadcasting buffer0 to buffer1, and update the data tensor. Next, broadcast dimension 0, transferring the data from buffer1. Broadcast to buffer2, data tensor updated to This completes the multi-level broadcasting of the left operand, thereby obtaining a tensor of the same size as the right value, which facilitates subsequent SIMD operations.
[0043] The advantages of this setup are: by setting up a chained broadcast mechanism for intermediate buffers, each intermediate buffer stores the intermediate results after partial dimension expansion has been completed, and there is only a size difference between adjacent levels in one broadcast dimension, so that each step can be completed by calling a single-dimensional hardware broadcast primitive; and the chained broadcast can avoid frequent access to the third-level cache L3 global memory, thus maximizing the efficiency of hardware broadcast.
[0044] Additionally, for inputs that need to be broadcast, the server determines whether the total amount of data does not exceed the current available L2 cache capacity. If the condition is met, the input data is prefetched from L3 into L2 and resides in L2 throughout the entire kernel execution, reducing multiple accesses to global storage.
[0045] Optionally, the step of setting an inner and outer loop setting mechanism based on the description information of the data stream to be processed within each computing unit and determining the current encapsulation description parameters includes: within each computing unit, scanning the shape of the left operand tensor and the shape of the right operand tensor from low dimension to high dimension respectively; if a broadcast dimension is determined to exist, then using the inner and outer loop setting mechanism to determine the broadcast dimension as the inner loop and the non-broadcast dimension as the outer loop, and determining the current inner and outer loop encapsulation description parameters.
[0046] In this embodiment, in order to maximize the reuse efficiency of broadcast data, the server places the broadcast dimension in the inner loop when calculating the task layout.
[0047] The specific operation requires first scanning the shapes of the left operand tensor and the right operand tensor from low dimension to high dimension in each computation unit to identify which dimensions are broadcast dimensions and which are non-broadcast dimensions; then, when constructing the task traversal order, the broadcast dimensions are placed in the inner loop and the non-broadcast dimensions are placed in the outer loop.
[0048] For example, suppose the shape of the left operand tensor is The shape of the right operand tensor and the shape of the output are The shape of the L1 slice is The total number of tasks can be calculated to be 14352.
[0049] First, the 0th dimension (highest dimension) of the left operand is identified as the broadcast dimension and placed in the inner loop. Assuming all tasks are placed in a single computation unit, as tasks 0 through 7176 are executed sequentially, the output starting coordinates advance from [0,0] to [7175,0], but the starting coordinates of the left operand remain [0,0]. Since the slice position does not change, data reloading from L3 to L1 does not occur. Therefore, the left operand is only loaded once in task 0, and reused in the subsequent 7175 tasks. The position of the left operand is only updated in task 7176.
[0050] The advantage of this setup is that multiple consecutive tasks will proceed along the broadcast dimension. Since the starting coordinates of operands on the broadcast dimension are always kept at 0, this means that the data on the broadcast side can be reused in these consecutive tasks without repeated loading, thus reducing the waste of hardware bandwidth.
[0051] S140, instruct the device to perform data stream calculation processing according to the number of data stream processing tasks corresponding to each received computing unit and the current encapsulation description parameters, and obtain the target data stream calculation result through a preset asynchronous pipeline architecture transfer method.
[0052] In this embodiment, the device uses the Data Transfer Engine (DTE) to complete slicing from L3 or L2 to L1, multi-level broadcast expansion within L1, and result write-back from L1 to L3. The DTE data transfer engine is a dedicated hardware acceleration unit within the GCU hardware responsible for multidimensional tensor data transfer. Executed by dedicated hardware circuitry, it can perform slicing or fast broadcast operations. Therefore, an asynchronous pipeline architecture can be used to asynchronously trigger data stream transfer and computation processing to obtain the target data stream computation results and provide feedback to the user.
[0053] The technical solution of this invention acquires the description information of the data stream to be processed in real time; based on the input tensor, output tensor shape, number of bytes in input elements, and number of bytes in output elements, it performs segmentation and calculation processing using a preset multi-dimensional greedy segmentation strategy to obtain the number of data stream segmentation processing tasks corresponding to each calculation unit; within each calculation unit, it sets an intermediate buffer chain broadcast mechanism or an inner and outer loop setting mechanism based on the description information of the data stream to be processed, and determines the current encapsulation description parameters; it instructs the device to perform data stream calculation processing using a preset asynchronous pipeline architecture transport method based on the received number of data stream segmentation processing tasks corresponding to each calculation unit and the current encapsulation description parameters to obtain the target data stream calculation result. This solves the problems of existing technologies being unable to accurately and flexibly slice data streams of different dimensions, and the low efficiency of data stream transport and optimization processing, improving the flexibility and processing efficiency of binary broadcast operator data stream slicing, reducing redundant transport and broadcasting, and improving the throughput and hardware utilization of data stream processing.
[0054] Example 2 Figure 2 This document provides a detailed flowchart of a binary broadcast operator data stream optimization method based on a GCU architecture, as described in Embodiment 2 of the present invention. This embodiment refines the above embodiment by performing data stream calculations on the indicating device based on the number of data stream processing tasks corresponding to each received computing unit and the current encapsulation description parameters, using a preset asynchronous pipeline architecture transfer method. The resulting target data stream calculation results are then further refined.
[0055] S210. Obtain description information of the data stream to be processed in real time.
[0056] The description information of the data stream to be processed includes the input tensor, the shape of the output tensor, the number of bytes of the input elements, and the number of bytes of the output elements.
[0057] S220. Based on the input tensor, the shape of the output tensor, the number of bytes of the input elements, and the number of bytes of the output elements, the data stream is segmented and processed using a preset multi-dimensional greedy segmentation strategy to obtain the number of data stream segmentation processing tasks corresponding to each computing unit.
[0058] S230. Within each computing unit, an intermediate buffer chain broadcast mechanism or an inner / outer loop setting mechanism is set according to the description information of the data stream to be processed, and the current encapsulation description parameters are determined.
[0059] S240, instruct the device to asynchronously trigger the loading of the current data stream, the calculation of the current data stream, or the writing back of the calculation result of the current data stream, based on the number of processing tasks corresponding to each received computing unit and the current encapsulation description parameters, using the asynchronous pipeline architecture transfer method.
[0060] S250. After the number of data stream segmentation and processing tasks corresponding to each computing unit is determined and completed, the target data stream computing result is obtained.
[0061] For example, suppose each computing unit includes two or more data stream splitting and processing tasks, specifically, three data stream splitting and processing tasks. The current data stream can be loaded in Task 1 during the first time period; in the next time period, Task 1 calculates the current data stream, and Task 2 loads the second data stream; in the following time period, Task 1 broadcasts the calculation result of the current data stream back, Task 2 calculates the second data stream, and Task 3 loads the third data stream.
[0062] The advantage of this setup is that asynchronous triggering is achieved through an asynchronous pipeline architecture, allowing data transfer or broadcasting to overlap with computation in time, thereby improving overall throughput and hardware utilization, and enhancing data stream processing and computation efficiency.
[0063] The technical solution of this invention involves: acquiring the description information of the data stream to be processed in real time; performing segmentation and calculation processing based on the input tensor, output tensor shape, number of bytes in input elements, and number of bytes in output elements using a preset multi-dimensional greedy segmentation strategy to obtain the number of data stream segmentation processing tasks corresponding to each computing unit; within each computing unit, setting an intermediate buffer chain broadcast mechanism or an inner / outer loop setting mechanism based on the description information of the data stream to be processed, and determining the current encapsulation description parameters; instructing the device to perform data stream calculation processing based on the received number of data stream segmentation processing tasks corresponding to each computing unit and the current encapsulation description parameters using a preset asynchronous pipeline architecture transport method to obtain the target data stream calculation result; instructing the device to asynchronously trigger the loading of the current data stream, the calculation of the current data stream, or the writing back of the current data stream calculation result using the asynchronous pipeline architecture transport method based on the received number of data stream segmentation processing tasks corresponding to each computing unit and the current encapsulation description parameters; and obtaining the target data stream calculation result after determining that the data stream segmentation processing tasks corresponding to each computing unit have been processed. By using an asynchronous pipeline architecture to perform asynchronous triggering, data transfer or broadcasting can overlap with computation in time, improving the efficiency of data stream processing and computation, reducing redundant transfer and broadcasting, and increasing the throughput and hardware utilization of data stream processing.
[0064] Example 3 Figure 3 This is a schematic diagram of a binary broadcast operator data stream optimization device based on a GCU architecture, provided in Embodiment 2 of the present invention. The binary broadcast operator data stream optimization device based on a GCU architecture provided in this embodiment can be implemented through software and / or hardware, and can be configured in a terminal device or server to implement a binary broadcast operator data stream optimization method based on a GCU architecture according to an embodiment of the present invention. Figure 3 As shown, the device includes: a data stream description information acquisition module 310, a data stream segmentation processing task number determination module 320, a current encapsulation description parameter determination module 330, and a target data stream calculation result determination module 340.
[0065] The data stream description information acquisition module 310 is used to acquire the data stream description information in real time; wherein the data stream description information includes the input tensor, the shape of the output tensor, the number of bytes of the input elements, and the number of bytes of the output elements. The data stream segmentation processing task number determination module 320 is used to perform segmentation and calculation processing based on the input tensor, the shape of the output tensor, the number of bytes of the input element and the number of bytes of the output element, and to obtain the number of data stream segmentation processing tasks corresponding to each calculation unit by performing segmentation and calculation processing through a preset multi-dimensional greedy segmentation strategy method. The current encapsulation description parameter determination module 330 is used to set an intermediate buffer chain broadcast mechanism or an inner and outer loop setting mechanism according to the data stream description information to be processed in each computing unit, and determine the current encapsulation description parameters. The target data stream calculation result determination module 340 is used to instruct the device to perform data stream calculation processing according to the number of data stream segmentation and processing tasks corresponding to each received calculation unit and the current encapsulation description parameters, through a preset asynchronous pipeline architecture transport method, to obtain the target data stream calculation result.
[0066] The technical solution of this invention acquires the description information of the data stream to be processed in real time; based on the input tensor, output tensor shape, number of bytes in input elements, and number of bytes in output elements, it performs segmentation and calculation processing using a preset multi-dimensional greedy segmentation strategy to obtain the number of data stream segmentation processing tasks corresponding to each calculation unit; within each calculation unit, it sets an intermediate buffer chain broadcast mechanism or an inner and outer loop setting mechanism based on the description information of the data stream to be processed, and determines the current encapsulation description parameters; it instructs the device to perform data stream calculation processing using a preset asynchronous pipeline architecture transport method based on the received number of data stream segmentation processing tasks corresponding to each calculation unit and the current encapsulation description parameters to obtain the target data stream calculation result. This solves the problems of existing technologies being unable to accurately and flexibly slice data streams of different dimensions, and the low efficiency of data stream transport and optimization processing, improving the flexibility and processing efficiency of binary broadcast operator data stream slicing, reducing redundant transport and broadcasting, and improving the throughput and hardware utilization of data stream processing.
[0067] Based on the above embodiments, the data stream segmentation processing task number determination module 320 specifically includes: a current slice size threshold calculation unit, which can be specifically used to: obtain and calculate the current slice size threshold based on the left and right operands corresponding to the input tensor, the current available capacity of the first-level cache, and the number of bytes of the input element and the number of bytes of the output element; and a data stream segmentation processing task number determination unit, which can be specifically used to: perform segmentation and calculation processing from low dimension to high dimension sequentially through the multi-dimensional greedy segmentation strategy method based on the shape of the output tensor and the current slice size threshold, to obtain the number of data stream segmentation processing tasks corresponding to each calculation unit.
[0068] Based on the above embodiments, the data stream segmentation processing task number determination unit can be specifically used to: obtain and compare the length of the lowest-dimensional output dimension corresponding to the lowest dimension corresponding to the shape of the output tensor with the current slice size threshold using the multi-dimensional greedy segmentation strategy method; if the current slice size threshold is greater than or equal to the length of the lowest-dimensional output dimension, then determine the slice size corresponding to the lowest dimension as the length of the lowest-dimensional output dimension, and use the current slice size threshold divided by the length of the lowest-dimensional output dimension to obtain the current remaining capacity; sequentially obtain the length of the output dimension corresponding to the previous dimension, and determine whether the current remaining capacity is greater than or equal to the length of the output dimension; if so, determine the current dimension. The corresponding slice size is the output dimension length, and the new current remaining capacity is obtained by dividing the slice size by the output dimension length; if not, the current remaining capacity is divided by the output dimension length and rounded up to obtain the current intermediate value, and the slice size corresponding to the current dimension is determined by dividing the current intermediate value by the output dimension length and rounding up; it is determined whether all dimensions of the output tensor shape have been traversed. If the traversal is complete, the number of data stream splitting and processing tasks corresponding to each computing unit is calculated according to the slice size corresponding to each dimension; if the traversal is not complete, the process returns to the operation of sequentially obtaining the output dimension length corresponding to the previous dimension and determining whether the current remaining capacity is greater than or equal to the output dimension length.
[0069] Based on the above embodiments, the data stream segmentation processing task number determination unit can also be specifically used to: determine the current slice shape and the current slice number according to the slice size corresponding to each dimension; obtain the number of computing units corresponding to the current GCU in real time, and calculate the number of data stream segmentation processing tasks corresponding to each computing unit by dividing the current slice number by the number of computing units and rounding up.
[0070] Based on the above embodiments, the data stream description information to be processed further includes the input tensor shape; the input tensor shape includes the left operand tensor shape and the right operand tensor shape.
[0071] Based on the above embodiments, the current encapsulation description parameter determination module 330 can be specifically used to: in the data stream segmentation processing tasks corresponding to each computing unit, determine whether the shape of the left operand tensor and the shape of the right operand tensor need to be broadcast according to the current slice shape. If broadcasting is required, set up multiple intermediate buffers in the first-level cache through the intermediate buffer chain broadcasting mechanism, decompose the multidimensional broadcast of the operand into a chained process of multiple single-dimensional broadcasts, and save the intermediate results after partial dimension expansion in each intermediate buffer, and determine the current chain broadcast encapsulation description parameters.
[0072] Based on the above embodiments, the current encapsulation description parameter determination module 330 can be specifically used to: scan the shape of the left operand tensor and the shape of the right operand tensor from low dimension to high dimension in each computing unit; if it is determined that there is a broadcast dimension, the broadcast dimension is determined as the inner loop and the non-broadcast dimension is determined as the outer loop through the inner and outer loop setting mechanism, and the current inner and outer loop encapsulation description parameters are determined.
[0073] Based on the above embodiments, the target data stream calculation result determination module 340 can be specifically used to: instruct the device to asynchronously trigger the loading of the current data stream, the calculation of the current data stream, or the writing back of the calculation result of the current data stream through the asynchronous pipeline architecture transport method, based on the number of data stream segmentation processing tasks corresponding to each calculation unit and the current encapsulation description parameters; and obtain the target data stream calculation result after the number of data stream segmentation processing tasks corresponding to each calculation unit is determined to be completed.
[0074] The binary broadcast operator data stream optimization device based on GCU architecture provided in the embodiments of the present invention can execute the binary broadcast operator data stream optimization method based on GCU architecture provided in any embodiment of the present invention, and has the corresponding functional modules and beneficial effects of the execution method.
[0075] Example 4 Figure 4 A schematic diagram of an electronic device 10, which can be used to implement Embodiment 4 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 can also represent various forms of mobile devices, such as personal digital processors, cellular phones, smartphones, wearable devices (such as helmets, glasses, watches, etc.), and other similar computing devices. The components shown herein, their connections and relationships, and their functions are merely illustrative and are not intended to limit the implementation of the invention described and / or claimed herein.
[0076] like Figure 4As shown, the electronic device 10 includes at least one processor 11 and a memory, such as a read-only memory (ROM) 12 or a random access memory (RAM) 13, communicatively connected to the at least one processor 11. The memory stores computer programs executable by the at least one processor. The processor 11 can perform various appropriate actions and processes based on the computer program stored in the ROM 12 or loaded from storage unit 18 into the RAM 13. The RAM 13 can also store various programs and data required for the operation of the electronic device 10. The processor 11, ROM 12, and RAM 13 are interconnected via a bus 14. An input / output (I / O) interface 15 is also connected to the bus 14.
[0077] Multiple components in electronic device 10 are connected to I / O interface 15, including: input unit 16, such as keyboard, mouse, etc.; output unit 17, such as various types of displays, speakers, etc.; storage unit 18, such as disk, optical disk, etc.; and communication unit 19, such as network card, modem, wireless transceiver, etc. Communication unit 19 allows electronic device 10 to exchange information / data with other devices through computer networks such as the Internet and / or various telecommunications networks.
[0078] Processor 11 can be a variety of general-purpose and / or special-purpose processing components with processing and computing capabilities. Some examples of processor 11 include, but are not limited to, a central processing unit (CPU), a graphics processing unit (GPU), various special-purpose artificial intelligence (AI) computing chips, various processors running machine learning model algorithms, a digital signal processor (DSP), and any suitable processor, controller, microcontroller, etc. Processor 11 performs the various methods and processes described above, such as the binary broadcast operator dataflow optimization method based on the GCU architecture.
[0079] In some embodiments, the binary broadcast operator data stream optimization method based on the GCU architecture can be implemented as a computer program tangibly contained in a computer-readable storage medium, such as storage unit 18. In some embodiments, part or all of the computer program can be loaded and / or installed on the electronic device 10 via ROM 12 and / or communication unit 19. When the computer program is loaded into RAM 13 and executed by processor 11, one or more steps of the binary broadcast operator data stream optimization method based on the GCU architecture described above can be performed. Alternatively, in other embodiments, processor 11 can be configured to execute the binary broadcast operator data stream optimization method based on the GCU architecture by any other suitable means (e.g., by means of firmware).
[0080] The method includes: acquiring the description information of the data stream to be processed in real time; wherein the description information of the data stream to be processed includes the input tensor, the shape of the output tensor, the number of bytes of the input elements, and the number of bytes of the output elements; performing segmentation and calculation processing according to the input tensor, the shape of the output tensor, the number of bytes of the input elements, and the number of bytes of the output elements using a preset multi-dimensional greedy segmentation strategy to obtain the number of data stream segmentation processing tasks corresponding to each calculation unit; within each calculation unit, setting an intermediate buffer chain broadcast mechanism or an inner and outer loop setting mechanism according to the description information of the data stream to be processed, and determining the current encapsulation description parameters; instructing the device to perform data stream calculation processing according to the received number of data stream segmentation processing tasks corresponding to each calculation unit and the current encapsulation description parameters using a preset asynchronous pipeline architecture transport method to obtain the target data stream calculation result.
[0081] Various embodiments of the systems and techniques described above herein can be implemented in digital electronic circuit systems, integrated circuit systems, field-programmable gate arrays (FPGAs), application-specific integrated circuits (ASICs), application-specific standard products (ASSPs), systems-on-a-chip (SoCs), payload-programmable logic devices (CPLDs), computer hardware, firmware, software, and / or combinations thereof. These various embodiments may include implementations in one or more computer programs that can be executed and / or interpreted on a programmable system including at least one programmable processor, which may be a dedicated or general-purpose programmable processor, capable of receiving data and instructions from a storage system, at least one input device, and at least one output device, and transmitting data and instructions to the storage system, the at least one input device, and the at least one output device.
[0082] Computer programs used to implement the methods 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, such that when executed by the processor, the computer programs cause the functions / operations specified in the flowcharts and / or block diagrams to be performed. The computer programs may be executed entirely on a machine, partially on a machine, or as a standalone software package, partially on a machine and partially on a remote machine, or entirely on a remote machine or server.
[0083] In the context of this invention, a computer-readable storage medium can be a tangible medium that may contain or store a computer program for use by or in conjunction with an instruction execution system, apparatus, or device. A computer-readable storage medium may include, but is not limited to, electronic, magnetic, optical, electromagnetic, infrared, or semiconductor systems, apparatus, or devices, or any suitable combination thereof. Alternatively, a computer-readable storage medium may be a machine-readable signal medium. More specific examples of machine-readable storage media include electrical connections based on one or more wires, portable computer disks, hard disks, random access memory (RAM), read-only memory (ROM), erasable programmable read-only memory (EPROM or flash memory), optical fibers, portable compact disk read-only memory (CD-ROM), optical storage devices, magnetic storage devices, or any suitable combination thereof.
[0084] To provide interaction with a user, the systems and techniques described herein can be implemented on an electronic device having: a display device (e.g., a CRT (cathode ray tube) or LCD (liquid crystal display) monitor) for displaying information to the user; and a keyboard and pointing device (e.g., a mouse or trackball) through which the user provides input to the electronic device. Other types of devices can also be used to provide interaction with the user; for example, feedback provided to the user can be any form of sensory feedback (e.g., visual feedback, auditory feedback, or tactile feedback); and input from the user can be received in any form (including sound input, voice input, or tactile input).
[0085] The systems and technologies described herein can be implemented in computing systems that include backend components (e.g., as data servers), or middleware components (e.g., application servers), or frontend components (e.g., user computers with graphical user interfaces or web browsers through which users can interact with implementations of the systems and technologies described herein), or any combination of such backend, middleware, or frontend components. The components of the system can be interconnected via digital data communication of any form or medium (e.g., communication networks). Examples of communication networks include local area networks (LANs), wide area networks (WANs), blockchain networks, and the Internet.
[0086] A computing system can include clients and servers. Clients and servers are generally located far apart and typically interact through communication networks. The client-server relationship is created by computer programs running on the respective computers and having a client-server relationship with each other. The server can be a cloud server, also known as a cloud computing server or cloud host, which is a hosting product within the cloud computing service system to address the shortcomings of traditional physical hosts and VPS services, such as high management difficulty and weak business scalability.
[0087] It should be understood that the various forms of processes shown above can be used, with steps reordered, added, or deleted. For example, the steps described in this invention can be executed in parallel, sequentially, or in different orders, as long as the desired result of the technical solution of this invention can be achieved, and this is not limited herein.
[0088] The specific embodiments described above do not constitute a limitation on the scope of protection of this invention. Those skilled in the art should understand that various modifications, combinations, sub-combinations, and substitutions can be made according to design requirements and other factors. Any modifications, equivalent substitutions, and improvements made within the spirit and principles of this invention should be included within the scope of protection of this invention.
[0089] Example 5 Embodiment 5 of the present invention also provides a computer-readable storage medium, wherein the computer-readable instructions, when executed by a computer processor, are used to execute a binary broadcast operator data stream optimization method based on a GCU architecture. The method includes: real-time acquisition of data stream description information to be processed; wherein the data stream description information to be processed includes an input tensor, an output tensor shape, the number of bytes of input elements, and the number of bytes of output elements; based on the input tensor, the output tensor shape, the number of bytes of input elements, and the number of bytes of output elements, performing segmentation and calculation processing using a preset multi-dimensional greedy segmentation strategy to obtain the number of data stream segmentation processing tasks corresponding to each computing unit; within each computing unit, setting an intermediate buffer chain broadcast mechanism or an inner / outer loop setting mechanism based on the data stream description information to be processed, and determining the current encapsulation description parameters; instructing the device to perform data stream calculation processing using a preset asynchronous pipeline architecture transport method based on the received number of data stream segmentation processing tasks corresponding to each computing unit and the current encapsulation description parameters to obtain the target data stream calculation result.
[0090] Of course, the computer-executable instructions provided in the embodiments of the present invention, which include a computer-readable storage medium, are not limited to the method operations described above, but can also perform related operations in the binary broadcast operator data stream optimization method based on the GCU architecture provided in any embodiment of the present invention.
[0091] Based on the above description of the implementation methods, those skilled in the art can clearly understand that the present invention can be implemented using software and necessary general-purpose hardware, and of course, it can also be implemented using hardware, but in many cases the former is a better implementation method. Based on this understanding, the technical solution of the present invention, or the part that contributes to the prior art, can be embodied in the form of a software product. This computer software product can be stored in a computer-readable storage medium, such as a computer floppy disk, read-only memory (ROM), random access memory (RAM), flash memory, hard disk, or optical disk, etc., including several instructions to cause a computer device (which may be a personal computer, server, or network device, etc.) to execute the methods described in the various embodiments of the present invention.
[0092] It is worth noting that in the embodiments of the binary broadcast operator data stream optimization method based on the GCU architecture described above, the various units and modules included are only divided according to functional logic, but are not limited to the above division, as long as the corresponding functions can be achieved; in addition, the specific names of each functional unit are only for easy differentiation and are not used to limit the scope of protection of the present invention.
[0093] The specific embodiments described above do not constitute a limitation on the scope of protection of this invention. Those skilled in the art should understand that various modifications, combinations, sub-combinations, and substitutions can be made according to design requirements and other factors. Any modifications, equivalent substitutions, and improvements made within the spirit and principles of this invention should be included within the scope of protection of this invention.
Claims
1. A data flow optimization method for a binary broadcast operator based on GCU architecture, characterized in that, include: Real-time acquisition of description information of the data stream to be processed; wherein, the description information of the data stream to be processed includes the input tensor, the shape of the output tensor, the number of bytes of the input elements, and the number of bytes of the output elements; Based on the input tensor, the shape of the output tensor, the number of bytes of the input elements, and the number of bytes of the output elements, the data stream is segmented and processed using a preset multi-dimensional greedy segmentation strategy to obtain the number of data stream segmentation processing tasks corresponding to each computing unit. Within each computing unit, an intermediate buffer chain broadcast mechanism or an inner and outer loop setting mechanism is set according to the description information of the data stream to be processed, and the current encapsulation description parameters are determined. The device is instructed to perform data stream processing according to the number of processing tasks corresponding to each received computing unit and the current encapsulation description parameters, and to obtain the target data stream calculation result through a preset asynchronous pipeline architecture transfer method.
2. The method according to claim 1, characterized in that, The process involves segmenting and calculating the data stream based on the input tensor, the shape of the output tensor, the number of bytes in the input elements, and the number of bytes in the output elements using a preset multi-dimensional greedy segmentation strategy. This yields the number of data stream segmentation processing tasks corresponding to each computational unit, including: The current slice size threshold is calculated by obtaining and calculating the left and right operands corresponding to the input tensor, the available capacity of the first-level cache, and the number of bytes of the input element and the number of bytes of the output element. Based on the shape of the output tensor and the current slice size threshold, the multi-dimensional greedy segmentation strategy is used to perform segmentation and computation processing from low dimension to high dimension in sequence, so as to obtain the number of data stream segmentation processing tasks corresponding to each computation unit.
3. The method according to claim 2, characterized in that, The process involves segmenting and calculating data streams from low to high dimensions sequentially using the multi-dimensional greedy segmentation strategy based on the output tensor shape and the current slice size threshold, to obtain the number of data stream segmentation processing tasks corresponding to each computational unit. This includes: Obtain the length of the lowest dimension output dimension corresponding to the lowest dimension of the output tensor shape, and compare it with the current slice size threshold using the multi-dimensional greedy segmentation strategy method. If the current slice size threshold is greater than or equal to the length of the lowest dimension output dimension, then the slice size corresponding to the lowest dimension is determined as the length of the lowest dimension output dimension, and the current remaining capacity is obtained by dividing the current slice size threshold by the length of the lowest dimension output dimension. The output dimension length corresponding to the previous dimension is obtained sequentially, and it is determined whether the current remaining capacity is greater than or equal to the output dimension length. If so, the slice size corresponding to the current dimension is determined as the output dimension length, and the slice size is divided by the output dimension length to obtain the new current remaining capacity. If not, divide the output dimension length by the current remaining capacity and round up to get the current intermediate value, and then divide the output dimension length by the current intermediate value and round up to get the slice size corresponding to the current dimension. Determine whether all dimensions of the output tensor shape have been traversed. If the traversal is complete, calculate the number of data stream splitting and processing tasks corresponding to each computational unit based on the slice size corresponding to each dimension. If the traversal is not completed, return to the operation of obtaining the length of the output dimension corresponding to the previous dimension in turn, and determining whether the current remaining capacity is greater than or equal to the length of the output dimension.
4. The method according to claim 3, characterized in that, The step of calculating the number of data stream segmentation and processing tasks corresponding to each computing unit based on the slice size corresponding to each dimension includes: Based on the slice size corresponding to each dimension, determine the current slice shape and the current number of slices; The number of computing units corresponding to the current GCU is obtained in real time. The number of data stream segmentation processing tasks corresponding to each computing unit is calculated by dividing the current number of slices by the number of computing units and rounding up.
5. The method according to claim 4, characterized in that, The description information of the data stream to be processed also includes the shape of the input tensor; the shape of the input tensor includes the shape of the left operand tensor and the shape of the right operand tensor; Within each computing unit, an intermediate buffer chain broadcast mechanism is set up based on the description information of the data stream to be processed, and the current encapsulation description parameters are determined, including: In the data stream segmentation processing tasks corresponding to each computing unit, based on the current slice shape, it is determined whether the shapes of the left operand tensor and the right operand tensor need to be broadcast. If broadcasting is required, a multi-level intermediate buffer is set in the first-level buffer through the intermediate buffer chain broadcasting mechanism, and the multi-dimensional broadcasting of operands is decomposed into a chained process of multiple single-dimensional broadcasts. Each intermediate buffer stores the intermediate results after partial dimension expansion is completed, and the current chain broadcast encapsulation description parameters are determined.
6. The method according to claim 5, characterized in that, Within each computing unit, an inner and outer loop setting mechanism is established based on the description information of the data stream to be processed, and the current encapsulation description parameters are determined, including: Within each computational unit, the shapes of the left operand tensor and the right operand tensor are scanned from low dimension to high dimension. If a broadcast dimension is determined, the broadcast dimension is determined as the inner loop and the non-broadcast dimension is determined as the outer loop through the inner and outer loop setting mechanism, and the current inner and outer loop encapsulation description parameters are determined.
7. The method according to any one of claims 1-6, characterized in that, The instruction device, based on the number of data stream processing tasks corresponding to each received computing unit and the current encapsulation description parameters, performs data stream computation processing using a preset asynchronous pipeline architecture transport method to obtain the target data stream computation result, including: The device is instructed to divide the data stream into processing tasks based on the number of data streams corresponding to each received computing unit and the current encapsulation description parameters, and to asynchronously trigger the loading of the current data stream, the calculation of the current data stream, or the writing back of the calculation result of the current data stream through the asynchronous pipeline architecture transfer method. After the number of data stream segmentation and processing tasks corresponding to each computing unit is determined and completed, the target data stream computing result is obtained.
8. A binary broadcast operator data stream optimization device based on GCU architecture, characterized in that, include: The module for acquiring description information of the data stream to be processed is used to acquire description information of the data stream to be processed in real time; wherein, the description information of the data stream to be processed includes the input tensor, the shape of the output tensor, the number of bytes of the input elements, and the number of bytes of the output elements; The data stream segmentation processing task number determination module is used to segment and calculate the data stream segmentation processing task number corresponding to each computing unit based on the input tensor, the shape of the output tensor, the number of bytes of the input element and the number of bytes of the output element, and through a preset multi-dimensional greedy segmentation strategy method. The current encapsulation description parameter determination module is used to set an intermediate buffer chain broadcast mechanism or an inner and outer loop setting mechanism according to the data stream description information to be processed in each computing unit, and determine the current encapsulation description parameters. The target data stream calculation result determination module is used to instruct the device to perform data stream calculation processing according to the number of data stream segmentation and processing tasks corresponding to each received calculation unit and the current encapsulation description parameters, and to obtain the target data stream calculation result through a preset asynchronous pipeline architecture transport method.
9. An electronic device comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, characterized in that, When the processor executes the computer program, it implements a binary broadcast operator data stream optimization method based on the GCU architecture as described in any one of claims 1-7.
10. A computer-readable storage medium, characterized in that, The computer-readable storage medium stores computer instructions that cause a processor to execute a binary broadcast operator data stream optimization method based on any one of claims 1-7.