Systolic array reconstruction method and device, storage medium and computer program product

By acquiring and adjusting the load matrix and configuration matrix of LSTM network tasks, optimizing resource allocation and data routing, and dynamically adjusting the operator unit status, the problem of low resource utilization and limited execution efficiency of pulsating arrays when processing LSTM network tasks is solved. , realizes more efficient computing task execution.

CN119292790AActive Publication Date: 2025-01-10深圳开鸿数字产业发展有限公司
View PDF 4 Cites 0 Cited by

Patent Information

Application Number
CN202411815632.3
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-12-11
Publication Date
2025-01-10
Estimated Expiration
2044-12-11

AI Technical Summary

Technical Problem

When handling the computing tasks of the LSTM network, the existing pulsating array has low resource utilization and limited execution efficiency, making it difficult to flexibly adapt to multiple operator structures, resulting in frequent hardware configuration resets during the calculation process to reduce execution efficiency.

Method used

By obtaining the configuration matrix of the current task load matrix and the pulsating array of the long and short-term memory network, the reconstruction value is determined based on the weight factors of the load matrix and operator unit, the configuration matrix is ​​adjusted to optimize resource allocation and data routing paths, and the operator unit is dynamically adjusted to the operator unit. to improve computing efficiency.

Benefits of technology

It realizes flexible response to task requirements, improves overall computing efficiency and resource utilization, avoids idle or overload of resources, and ensures that the pulsating array is always in the optimal working state.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119292790A_ABST
    Figure CN119292790A_ABST
Patent Text Reader

Abstract

The invention discloses a systolic array reconstruction method and device, a storage medium and a computer program product, and relates to the technical field of deep learning hardware acceleration, and the method comprises the steps: obtaining a load matrix of a current task of a long short-term memory network and a configuration matrix of a systolic array, the configuration matrix comprising operator units configured for each operator in the current task; determining a reconstruction value of the current task according to the load matrix and the weight factor of each operator; and under the condition that the reconstruction value exceeds a preset reconstruction threshold value, adjusting the configuration matrix according to the configuration of the load matrix and the operator unit. According to the method, the operator unit configuration of the systolic array is dynamically adjusted according to the task load of each operator of the current task, so that the systolic array can meet the resource requirement of the current task, and the overall operation efficiency is improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the technical field of deep learning hardware acceleration, and in particular to a systolic array reconstruction method, device, storage medium and computer program product. Background Art

[0002] In the current fields of time series processing, natural language processing, and speech recognition, LSTM (Long Short Term Memory) networks have been widely used due to their powerful time series information processing capabilities. The core of the LSTM network lies in its complex operator structure, including a large number of matrix multiplications, element-level operations, and activation function calculations. These operators work together to enable the LSTM network to process complex time series data.

[0003] At present, although parallel computing hardware such as systolic arrays can accelerate the calculation process of LSTM networks, they still face the problems of low resource utilization and limited execution efficiency. Conventional systolic arrays are usually fixed in configuration and difficult to flexibly adapt to the various operator structures in LSTM networks. Frequent switching of operator structures during the calculation process will significantly reduce the execution efficiency due to the reset of hardware configuration, thereby limiting the performance of the overall system.

[0004] The above contents are only used to assist in understanding the technical solution of the present application and do not constitute an admission that the above contents are prior art. Summary of the invention

[0005] The main purpose of the present application is to provide a systolic array reconstruction method, device, storage medium and computer program product, aiming to solve the technical problem of low efficiency of task execution based on systolic array.

[0006] To achieve the above objectives, the present application proposes a systolic array reconstruction method, the method comprising: Obtaining a load matrix of a current task of a long short-term memory network and a configuration matrix of a systolic array, wherein the configuration matrix includes operator units configured for each operator in the current task; Determining a reconstruction value of the current task according to the load matrix and the weight factors of each of the operators; In a case where the reconstruction value exceeds a preset reconstruction threshold, the configuration matrix is ​​adjusted according to the load matrix and the configuration of the operator unit.

[0007] In one embodiment, before the step of determining the reconstruction value of the current task, the method further includes: Determining whether the task load of each operator in the load matrix is ​​within a preset parameter range; In the case where there is at least one task load that is not within the parameter range, the calculation order and resource allocation of each operator are reconstructed.

[0008] In one embodiment, after the step of adjusting the configuration matrix, the method further includes: Determining the overall performance of the current task according to the acquired utilization rate of each operator and the weight factor; The weight factor, the reconstruction threshold and the parameter range are adjusted according to the overall performance.

[0009] In one embodiment, after the step of adjusting the configuration matrix, the method further includes: Determining a data routing path for the current task according to the adjusted configuration matrix and the load matrix; Processing computing tasks of the operators in parallel through the data routing paths and the operator units in the adjusted configuration matrix; The calculation results of each of the calculation tasks are integrated through the aggregation node to obtain the task execution result.

[0010] In one embodiment, after the step of obtaining the load matrix of the current task of the long short-term memory network and the configuration matrix of the systolic array, the method further includes: According to the acquired task load of each operator unit, the working state of each operator unit is adjusted.

[0011] In one embodiment, the step of adjusting the working state of each of the operator units according to the acquired task load of each of the operator units includes: When the task load of the operator unit is within a preset low power consumption range, reducing the voltage frequency of the operator unit; When the task load of the operator unit is within a preset no-task range, the operator unit is shut down.

[0012] In one embodiment, after the step of obtaining the load matrix of the current task of the long short-term memory network and the configuration matrix of the systolic array, the method further includes: Determine whether the obtained utilization rate of each of the operators is within a preset normal range; In the case that there is at least one of the utilization rates that is not within the normal range, the configuration matrix is ​​adjusted according to each of the utilization rates.

[0013] In addition, to achieve the above-mentioned purpose, the present application also proposes a systolic array reconstruction device, the systolic array reconstruction device comprising: An acquisition module, used to acquire a load matrix of a current task of a long short-term memory network and a configuration matrix of a systolic array, wherein the configuration matrix includes operator units configured for each operator in the current task; A determination module, used to determine the reconstruction value of the current task according to the load matrix and the weight factor of each operator; An adjustment module is used to adjust the configuration matrix according to the load matrix and the configuration of the operator unit when the reconstruction value exceeds a preset reconstruction threshold.

[0014] In addition, to achieve the above objectives, the present application also proposes a systolic array reconstruction device, which includes: a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the computer program is configured to implement the steps of the systolic array reconstruction method as described above.

[0015] In addition, to achieve the above objectives, the present application also proposes a storage medium, which is a computer-readable storage medium, and a computer program is stored on the storage medium. When the computer program is executed by a processor, the steps of the systolic array reconstruction method described above are implemented.

[0016] In addition, to achieve the above objectives, the present application also provides a computer program product, which includes a computer program. When the computer program is executed by a processor, the steps of the systolic array reconstruction method as described above are implemented.

[0017] One or more technical solutions proposed in this application have at least the following technical effects: first, by obtaining the load matrix of the current task of the long short-term memory network and the configuration matrix of the pulsation array, the computing requirements of the task and the configuration of the existing operator units are understood, providing a data basis for subsequent optimization; then, the reconstruction value of the current task is determined according to the load matrix and the weight factors of each operator, ensuring that the key operators are given priority in the allocation of computing resources, thereby improving the efficiency and accuracy of the overall calculation; further, when the reconstruction value exceeds the preset reconstruction threshold, it indicates that the current configuration can no longer meet the efficient execution requirements of the task. At this time, the configuration matrix can be automatically adjusted according to the configuration of the load matrix and the operator unit, quickly responding to changes in computing requirements, avoiding idle or overloaded resources, and ensuring that the pulsation array is always in the optimal working state. This application dynamically adjusts the allocation of operator units by accurately matching task requirements with pulsation array resources, achieving flexible response to changes in task requirements, and achieving efficient use of resources, thereby improving the execution efficiency of computing tasks. BRIEF DESCRIPTION OF THE DRAWINGS

[0018] The accompanying drawings, which are incorporated in and constitute a part of this specification, illustrate embodiments consistent with the present application and, together with the description, serve to explain the principles of the present application.

[0019] In order to more clearly illustrate the embodiments of the present application or the technical solutions in the prior art, the drawings required for use in the embodiments or the description of the prior art will be briefly introduced below. Obviously, for ordinary technicians in this field, other drawings can be obtained based on these drawings without paying any creative work.

[0020] Figure 1 A schematic diagram of a flow chart provided for Embodiment 1 of the systolic array reconstruction method of the present application; Figure 2 The overall execution flow chart of the systolic array reconstruction method provided in the second embodiment of the present application; Figure 3 A module structure diagram of a systolic array reconstruction system provided in Embodiment 3 of the present application; Figure 4 This is a schematic diagram of the module structure of the systolic array reconstruction device according to an embodiment of the present application; Figure 5 Schematic diagram of the device structure of the hardware operating environment involved in the systolic array reconstruction method in the embodiment of the present application. DETAILED DESCRIPTION

[0021] It should be understood that the specific embodiments described herein are only used to explain the technical solutions of the present application and are not used to limit the present application.

[0022] In order to better understand the technical solution of the present application, a detailed description will be given below in conjunction with the accompanying drawings and specific implementation methods.

[0023] In this embodiment, for the convenience of description, the following description is made with the terminal as the execution subject.

[0024] Since traditional systolic array designs are usually optimized for specific computing tasks, it is difficult to flexibly adapt to the diverse operator structures in LSTM networks. In the process of processing the calculations of LSTM networks, the utilization rate of hardware resources is low and cannot meet the needs of efficient computing. At the same time, since the operator types in LSTM networks are complex and the amount of calculation is large, traditional systolic arrays often need to perform multiple data transmissions and calculation scheduling when processing these operators, which increases the calculation delay and power consumption, resulting in reduced execution efficiency of the LSTM network's computing tasks.

[0025] The present application provides a solution, which obtains the load matrix of the current task of the long short-term memory network and the configuration matrix of the systolic array, analyzes the computing requirements of the task and the existing resource allocation in real time, and facilitates the subsequent optimization and adjustment of resource allocation; then, determines whether the task load of each operator in the load matrix is ​​within the preset parameter range, which helps to timely discover load anomalies and make timely adjustments to unbalanced loads. When at least one task load exceeds the parameter range, the calculation order and resource allocation of each operator are reconstructed to balance the load and improve computing efficiency; further, the current task load matrix and the weight factors of each operator are determined according to the load matrix. The reconstruction value of the task comprehensively considers the task requirements and the importance of the operator, and accurately evaluates whether the current resource allocation is reasonable; when the reconstruction value exceeds the preset reconstruction threshold, it indicates that the current configuration can no longer meet the efficient execution requirements of the task. At this time, the configuration matrix can be automatically adjusted according to the configuration of the load matrix and the operator unit, and the change of computing requirements can be quickly responded to to avoid idle or overloaded resources, and ensure that the pulsating array is more reasonable in computing resource allocation, thereby improving computing efficiency; finally, according to the adjusted configuration matrix and load matrix, the data routing path of the current task is determined, which helps to optimize the data transmission efficiency, ensure that the fixed link is fully utilized, and further improve the computing efficiency. This application improves the execution efficiency of computing tasks by optimizing resource allocation and optimizing data transmission.

[0026] It should be noted that the execution subject of this embodiment may be a computing service device with data processing, network communication and program running functions, such as a tablet computer, a personal computer, a mobile phone, etc., or an electronic device capable of realizing the above functions, etc. The following takes the terminal as the execution subject as an example to illustrate this embodiment and the following embodiments.

[0027] Based on this, the present application embodiment provides a systolic array reconstruction method, referring to Figure 1 , Figure 1 It is a flowchart of the first embodiment of the systolic array reconstruction method of the present application.

[0028] In this embodiment, the systolic array reconstruction method includes steps S10 to S30: Step S10, obtaining a load matrix of a current task of the long short-term memory network and a configuration matrix of a systolic array, wherein the configuration matrix includes operator units configured for each operator in the current task; In a feasible embodiment, a computing task submitted by a user is received, and a load matrix is ​​generated according to the task characteristics to understand the computing requirements of each operator; a configuration matrix is ​​obtained to facilitate the allocation of operator units to each operator to execute the computing task.

[0029] It should be noted that the load matrix is ​​used to represent the computational load of each operator in the current task, usually in the form of two-dimensional data or matrix, where each element represents the computational demand or data volume of a specific operator at a specific time point or computing cycle. The configuration matrix describes the configuration of the PE (Processing Element, operator unit) assigned to each operator in the current task, which is used to control the state of each operator unit; and the systolic array is a parallel computing architecture composed of multiple PE units, which is used to execute parallel computing tasks.

[0030] For example, the current task obtained is a computing task based on an LSTM network. The operators in the computing task may include a matrix multiplication operator, an element-by-element operation operator, and an activation function operator. The computing task is analyzed to obtain a load matrix , and configure 80% of the PE units as matrix multiplication units, 10% of the PE units as element-by-element operation units, and 10% of the PE units as activation function units, which are assigned to the corresponding operators and generate a configuration matrix.

[0031] Exemplarily, the load matrix may change as the task is executed, and the configuration matrix may be adjusted according to the change in the load matrix.

[0032] It can be understood that by obtaining the load matrix and the configuration matrix, we can more accurately understand the resource requirements of each operator and the allocation of the current operator units, which facilitates the subsequent adjustment of the configuration matrix according to the resource requirements, thereby performing more efficient operator scheduling and improving task execution efficiency.

[0033] Step S20, determining the reconstruction value of the current task according to the load matrix and the weight factors of each operator; In a feasible embodiment, the acquired computing task includes multiple small tasks (operators), and the rationality of the current resource allocation can be determined according to the workload (load matrix) and importance (weight factor) of each small task.

[0034] It should be noted that the weight factor is used to indicate the importance or priority of each operator in the overall task; the reconstruction value is used to guide the resource allocation of the current task.

[0035] For example, the reconstruction value It can be determined according to the following formula:

[0036] Among them, α, β, and γ represent the weight factors of the matrix multiplication operator, the element-by-element operation operator, and the activation function operator, respectively.

[0037] Exemplarily, a multi-objective optimization algorithm may be introduced to simultaneously consider multiple performance indicators, such as response time, throughput, etc., so that a more comprehensive reconstruction value may be calculated.

[0038] It can be understood that determining the reconstruction value helps determine whether the configuration of the current systolic array needs to be adjusted, thereby optimizing resource allocation and task scheduling and improving task execution efficiency.

[0039] Step S30: When the reconstruction value exceeds a preset reconstruction threshold, the configuration matrix is ​​adjusted according to the load matrix and the configuration of the operator unit.

[0040] In a feasible embodiment, the change of the reconstruction value is detected in real time or periodically, and the reconstruction value is compared with the reconstruction threshold to evaluate whether the current configuration meets the performance requirements; if the reconstruction value exceeds the reconstruction threshold, more operator units are allocated or activated for operators with high loads according to the configuration of the load matrix and the operator units.

[0041] It should be noted that the reconstruction threshold refers to a pre-set numerical limit used to determine whether the operator unit configuration (configuration matrix) of the current systolic array can meet the current load array. If the reconstruction value exceeds the reconstruction threshold, it means that the current configuration matrix may cause some operators to be overloaded, and the allocation of operator units needs to be adjusted.

[0042] Exemplarily, the loads of operators such as matrix multiplication, element-by-element operation, and activation function are monitored in real time, and the reconstruction value is calculated. If the reconstruction value exceeds a preset reconstruction threshold at a certain moment and the load proportion of matrix multiplication reaches 80%, the PE units supporting matrix multiplication are activated first, and some matrix multiplication units that are in standby or off state (inactivated state) are adjusted to an activated state; if the reconstruction value still exceeds the reconstruction threshold after all matrix multiplication units are activated, some inactivated element-by-element operation units or activation function units are reconfigured as matrix multiplication units according to the operator load.

[0043] Exemplarily, according to the task load, the resource allocation of high-load operators is gradually increased to avoid activating too many PE units at one time, which leads to power consumption or resource waste. For example, when activating two PE units can meet the current task requirements, the operator units corresponding to the two high-load operators are activated to leave margin for subsequent tasks.

[0044] It can be understood that by dynamically adjusting the configuration matrix, the operator units can be more reasonably allocated and utilized, thereby improving resource utilization and task execution efficiency.

[0045] This embodiment provides a systolic array reconstruction method, which helps to timely discover resource limitations and bottleneck problems and reduce the response time of the system by understanding the current task requirements and judging whether the current configuration of the operator unit can meet the current task requirements. When the current configuration does not meet the current task requirements, the configuration of the operator unit is adjusted according to the operator load.

[0046] Based on the above first embodiment, a second embodiment of the systolic array reconstruction method of the present application is proposed. In this embodiment, before step S20, the method further includes: Step S11, determining whether the task load of each operator in the load matrix is ​​within a preset parameter range; In a feasible embodiment, a load matrix of the current task is obtained, and the task load of each operator in the load matrix is ​​compared with a preset parameter range.

[0047] It should be noted that task load refers to the amount of computing resources required by an operator to perform a task, such as CPU time, memory, etc.

[0048] Exemplarily, the load matrix can represent the resource usage of different operators. The preset parameter range can be the minimum usage threshold to the safety threshold of the resource utilization rate. By comparing whether the resource utilization rate of each operator exceeds the minimum usage threshold and whether it is lower than the safety threshold, it is determined whether the resource allocation of each operator needs to be adjusted.

[0049] For example, the load matrix can represent the computing requirements of different operators, and the preset parameter range can be the limit range of processing time or memory usage. By comparing the computing requirements with the limit range, it is determined whether it is necessary to optimize the processing flow of the operator or increase computing resources.

[0050] Step S12, when there is at least one task load that is not within the parameter range, reconstructing the calculation order and resource allocation of each operator; It should be noted that the calculation order includes but is not limited to the priority, parallel relationship and data flow direction of each operator when it is executed on the systolic array.

[0051] For example, if the task load ratio of the matrix multiplication operator is greater than 75% (the preset parameter upper limit), the priority of the matrix algorithm operator is increased so that more data flows to the matrix multiplication operator first, and more PE resources, memory, bandwidth and other resources are allocated to the matrix operator first.

[0052] Exemplarily, if the task load ratio of the activation function operator is lower than 20% (the preset parameter lower limit), it is determined that the PE resources of the operator are wasted, the priority of the activation function operator is lowered, some low-power activation operator units are turned off, and the released PE units are reallocated to high-load operators.

[0053] In this implementation, the calculation order and resource allocation of each operator are dynamically adjusted according to the task load, which can avoid system crash or performance degradation caused by task overload, and can also reduce the resource allocation of low-load operators to avoid resource waste, thereby more effectively utilizing resources and improving overall execution efficiency.

[0054] In a feasible implementation manner, after step S30, the method further includes: Step B101, determining the overall performance of the current task according to the obtained utilization and weight factor of each operator; It should be noted that utilization refers to the efficiency of an operator in using resources when executing a task, and is used to measure the use of resources allocated to the operator. The utilization of an operator is directly affected by the task load and resource configuration adjustment. For example, when the load of an operator reaches a preset threshold (such as the load of the matrix multiplication operator exceeds 75%), after dynamically adjusting the operator resource allocation and increasing the number of activations of the matrix multiplication operator unit, the utilization of the matrix multiplication operator will decrease to avoid exceeding the preset upper limit of the normal range.

[0055] For example, by comprehensively considering the actual degree of use of the operator (utilization rate) and the importance of the operator in the overall task (weight factor), an indicator reflecting the overall performance of the current task can be obtained, referring to the following formula:

[0056] Among them, E(t) is the overall performance index of the current task, w i is the weight factor of each operator, u i (t) is the utilization rate of each operator of the current task at a specific time. Through the above formula, the overall performance index of the current task can be determined, and the subsequent task optimization can be carried out based on the index.

[0057] Step B102, adjusting the weight factor, reconstruction threshold and parameter range according to the overall performance.

[0058] Exemplarily, when a large fluctuation in overall performance is detected, the reconstruction threshold is updated. The reconstruction threshold can be determined based on the current overall performance and task load. When the reconstruction value approaches the reconstruction threshold for a long time, the reconstruction threshold is appropriately lowered or the reconstruction factor is adjusted according to the current task load to trigger resource reallocation in advance. It is also possible to use a regression model (such as linear regression or neural network) to predict the optimal threshold and weight factor under different task loads based on historical operation data, including historical task load matrix, utilization and power consumption.

[0059] Exemplarily, the parameter range of reconstruction judgment can also be adjusted according to the overall performance. Under the condition of the same power consumption, if the performance index is reduced, the parameter range can be appropriately reduced, that is, the lower limit of the task load during reconstruction judgment is increased. When the load of an operator drops below a certain parameter range (a higher low threshold), reconstruction will be triggered, thereby keeping all operator units working within a higher utilization range, avoiding resource waste and improving performance; and reducing the lower limit of the task load during reconstruction judgment, which means that a smaller load increase can trigger the reconstruction of the calculation order and resource allocation, avoiding performance bottlenecks and ensuring performance stability.

[0060] In this implementation, reasonable parameter adjustment helps to achieve more reasonable resource allocation, improve resource utilization, and optimize overall performance.

[0061] In a feasible implementation manner, after step S30, the method further includes: Step S40, determining the data routing path of the current task according to the adjusted configuration matrix and load matrix.

[0062] In one feasible embodiment, how data flows or is transmitted between the operator units is determined according to the configuration of the operator units in the systolic array and the computing requirements of the current task.

[0063] It should be noted that the data routing path is a logical data flow path, including the direction of data flow between different operator units. The systolic array itself has a fixed link, and the data routing path relies on the fixed link to realize dynamic scheduling control of data transmission.

[0064] For example, if the current task load of the matrix multiplication operator is relatively high, most operator units in the adjusted configuration matrix are used for matrix multiplication, the data routing path also preferentially supports matrix multiplication, and the acquired input data preferentially flows to the matrix multiplication operator unit.

[0065] Exemplarily, if the load of matrix multiplication in the load matrix decreases and the load of the activation function increases, the load of the matrix multiplication operator in the changed load matrix is ​​the highest, followed by the activation function operator, and the load of the element-by-element operation operator is the lowest, then the matrix multiplication operator unit in the configuration matrix is ​​reconfigured to an activation function operator unit, and the data routing path is replanned so that after the data flows to the matrix multiplication operator unit, it preferentially flows to the activation function operator unit.

[0066] Exemplarily, a fixed link with a larger bandwidth is allocated to a high-load operator, and a low-load operator occupies less routing resources.

[0067] It can be understood that by dynamically reconstructing the routing path, it is possible to efficiently adapt to the load changes of the current task at different execution stages, maximize the use of the hardware performance of the fixed link, and there is no need to change the hardware physical link during the configuration adjustment process. Only the logical configuration needs to be modified, and the switching process is fast and efficient. According to the task load of each operator, the data flow is optimized to avoid data transmission conflicts and data transmission bottlenecks, thereby improving the operation efficiency of the task.

[0068] Step S41, processing the computing tasks of each operator in parallel through the data routing path and the operator units in the adjusted configuration matrix; In a feasible embodiment, the current task is split into multiple computing tasks, and the computing tasks are assigned to different operator units. The data is transmitted to the corresponding operator units through the data routing path. Each operator unit that receives the data simultaneously executes the assigned computing tasks and collects the computing results of each operator unit.

[0069] Step S42, integrating the calculation results of each calculation task through the aggregation node to obtain the task execution result.

[0070] For example, when using the LSTM network to process computing tasks, different data sets are processed in parallel through different operator units, and then all computing results are integrated through aggregation nodes to obtain the final result of the entire experiment or simulation.

[0071] In this implementation, parallel processing significantly reduces the total time required to complete the task, which helps to improve computing efficiency; the integration capability of the aggregation node ensures the correctness and completeness of the task execution results.

[0072] For example, to help understand the implementation process of the systolic array reconstruction method obtained by combining this embodiment with the first embodiment, please refer to Figure 2 , Figure 2 A general execution flow chart of a systolic array reconstruction method is provided, specifically: First, execute step S301 to obtain the load matrix of the current task of the long short-term memory network and the configuration matrix of the systolic array to understand the operation status of the current task; then enter S302 to determine whether the task load of each operator is within the preset parameter range. If the task load of each operator is not within the parameter range, execute S303 to reconstruct the calculation order and resource allocation of each operator, and execute S304 to determine the reconstruction value of the current task; if the task load of each operator is within the parameter range, execute S304 directly; after determining the reconstruction value, enter S305 to determine whether the reconstruction value exceeds the reconstruction threshold. If the reconstruction value exceeds the reconstruction threshold, execute S306 to adjust the configuration matrix according to the load matrix and the configuration of the operator unit, and perform data distribution and routing (S307) according to the adjusted configuration matrix, and re-determine the data routing path; if the reconstruction value does not exceed the reconstruction threshold, execute S307 directly to distribute and transmit data according to the original configuration matrix and the original data routing path.

[0073] Based on the above first and / or second embodiments, a third embodiment of the systolic array reconstruction method of the present application is proposed. In this embodiment, after step S10, the method further includes: Step A10: adjusting the working state of each operator unit according to the acquired task load of each operator unit.

[0074] In a feasible embodiment, the task load of each operator unit is obtained in real time, and then according to a preset strategy or algorithm, it is determined to which working state the operator unit should be adjusted under the current load state to achieve optimal resource allocation.

[0075] It should be noted that the working state refers to the operating mode of the operator unit at a specific moment, including activation state, standby state, shutdown state, etc. For different working states, the power consumption and resources used by the operator unit will be different.

[0076] Exemplarily, when the operator unit does not perform a task (the task load remains below 5%), the operator unit is adjusted to enter standby mode. In this mode, the clock frequency and voltage of the operator unit are greatly reduced to save energy. In the case where the operator unit occasionally responds (the task load varies from 5% to 20%), the voltage frequency is appropriately reduced, and the operating frequency of the operator unit is adjusted according to the change in the task load to avoid over-allocation of resources. When the operator unit has no task assignment for a long time (the task load is at 0 for a long time), the power supply of the operator unit can be turned off to reduce unnecessary power consumption. The division of working states is not limited to the above method, and can also be divided according to user needs.

[0077] In this implementation, dynamically adjusting the working state of the operator unit helps optimize resource allocation and reduce energy waste.

[0078] In a feasible implementation manner, step A10 includes: Step A11, when the task load of the operator unit is within a preset low power consumption range, reducing the voltage frequency of the operator unit; It should be noted that voltage frequency refers to the combination of voltage and clock frequency supplied to an operator unit, which directly affects the operation speed and power consumption of the operator unit.

[0079] For example, in the inference and prediction process of an LSTM network, the activation function operator may only be responsible for processing a small amount or simple computing tasks. At this time, the load of some activation function operator units is low and in a low power consumption range. After detecting this situation, the voltage frequency of the operator unit can be dynamically reduced according to the actual task load changes of the operator unit to ensure that these operator units can perform tasks normally while reducing power consumption.

[0080] Step A12: When the task load of the operator unit is within a preset no-task range, shut down the operator unit.

[0081] It should be noted that the no-task range refers to the range of task loads in which the preset operator units do not execute tasks within a specific period of time, and can be set based on historical data.

[0082] For example, when the LSTM network is idle or waiting for new input data, most operators may have no tasks to process, and the load of the operator unit is extremely low, even close to 0. When it is detected that the operator unit is in a task-free range, energy is saved by automatically shutting down these task-free operator units.

[0083] In this implementation, by reducing the voltage frequency of the operator unit, power consumption can be reduced and energy efficiency can be improved while ensuring that the task is completed on time; by shutting down operator units without tasks, energy can be further saved and operating costs can be reduced, thereby jointly improving the overall performance.

[0084] In a feasible implementation manner, after step S10, the method further includes: Step B10, determining whether the obtained utilization rate of each operator is within a preset normal range; Exemplarily, the utilization of each operator is determined by detecting the resource consumption and execution status of each operator in the computing task. For example, the load of an operator at a specific moment is compared with its maximum computing capacity (pre-allocated resources) to obtain the current utilization of the operator; then the obtained utilization is compared with a preset normal range. When the utilization is within the preset range, it means that the current resource allocation is relatively reasonable, which not only reduces resource waste but also avoids the occurrence of bottleneck problems.

[0085] Step B20: When at least one utilization rate is not within a normal range, adjust the configuration matrix according to each utilization rate.

[0086] In a feasible embodiment, if the utilization rate of an operator is not within a normal range, it means that the resources allocated to the operator may be too much or too little. According to the utilization rates of the operator and other operators, the number of operator units allocated to the operator is adjusted to reallocate resources.

[0087] Exemplarily, it is detected that the utilization rate of the matrix multiplication operator exceeds 95% (the upper limit of the preset normal range) and the utilization rate of the activation function operator is lower than 50% (the lower limit of the preset normal range), indicating that the resources of the matrix multiplication operator are insufficient, which may lead to a decrease in the operating efficiency of the matrix multiplication operator, while the activation function operator has a waste of resources; considering the utilization rates of these two operators, some activation function operator units can be appropriately closed, or some activation function operator units can be configured as matrix multiplication operator units to reduce the resource allocation of the activation function operator and prioritize allocating more resources to the matrix multiplication operator.

[0088] In this implementation, by adjusting the configuration matrix according to the utilization rate, it is possible to optimize the efficiency of resource use, avoid resource waste and overuse, and reasonably allocate resources, thereby improving the overall execution efficiency of the task.

[0089] For example, to help understand the implementation process of the systolic array reconstruction method obtained by combining the first embodiment and the second embodiment, please refer to Figure 3 , Figure 3 A module structure diagram of a systolic array reconstruction system is provided. Specifically, the systolic array reconstruction system may include the following modules: The operator reconstruction control module 201 is used to determine whether the current task load is within the parameter range according to the load matrix. When the load of a certain operator exceeds the upper limit of the parameter range, the reconstruction of the calculation order and resource allocation is triggered to preferentially allocate more resources to the high-load operator; conversely, if the operator load is lower than the lower limit of the parameter range, the reconstruction will also be triggered to reduce the resource allocation of the operator and save resources for other operators. The reconstruction value of the current task can also be determined according to the load matrix and the weight factors of each operator to determine whether the configuration matrix of the systolic array needs to be updated.

[0090] The power consumption control and resource optimization module 202 is used to monitor the working status of each operator unit in real time during the execution of the task, including the operation of the operator reconstruction control module 201, the data distribution and routing module 203 and the closed-loop feedback and adaptive optimization module 204, and reduce the voltage frequency of the low-load operator unit to ensure the lowest energy consumption.

[0091] The data distribution and routing module 203 is used to distribute input data to corresponding operator units according to the load matrix and the configuration matrix, and to reconstruct the data routing path according to the operator requirements when the configuration matrix changes, so as to optimize the data flow efficiency.

[0092] The closed-loop feedback and adaptive optimization module 204 is used to detect the utilization of each operator, adjust the configuration matrix according to the utilization of the operator, and optimize the allocation of operator units; at the same time, according to the utilization of each operator and the weight factor of each operator, the overall performance of the current task is determined, and through the closed-loop feedback mechanism, the weight factor and the threshold related to the reconstruction judgment are optimized to ensure the rational use of resources.

[0093] It should be noted that the above examples are only used to understand the present application and do not constitute a limitation on the systolic array reconstruction method of the present application. More simple transformations based on this technical concept are all within the protection scope of the present application.

[0094] The present application also provides a systolic array reconstruction device, please refer to Figure 4 , the systolic array reconstruction device comprises: An acquisition module 10 is used to acquire a load matrix of a current task of a long short-term memory network and a configuration matrix of a systolic array, wherein the configuration matrix includes operator units configured for each operator in the current task; A determination module 20, for determining a reconstruction value of a current task according to a load matrix and weight factors of each operator; The adjustment module 30 is used to adjust the configuration matrix according to the load matrix and the configuration of the operator unit when the reconstruction value exceeds a preset reconstruction threshold.

[0095] The systolic array reconstruction device provided in the embodiment of the present application adopts the systolic array reconstruction method in the above embodiment, which can solve the technical problem of low efficiency of task execution based on the systolic array. Compared with the prior art, the beneficial effects of the systolic array reconstruction device provided in the present application are the same as the beneficial effects of the systolic array reconstruction method provided in the above embodiment, and other technical features in the systolic array reconstruction device are the same as the features disclosed in the above embodiment method, which will not be repeated here.

[0096] An embodiment of the present application provides a systolic array reconstruction device, the systolic array reconstruction device comprising: at least one processor; and a memory communicatively connected to the at least one processor; wherein the memory stores instructions executable by the at least one processor, and the instructions are executed by the at least one processor, so that the at least one processor can perform the systolic array reconstruction method in the above-mentioned embodiment 1.

[0097] Reference below Figure 5, which shows a schematic diagram of the structure of a systolic array reconstruction device suitable for implementing an embodiment of the present application. The systolic array reconstruction device in the embodiment of the present application may include but is not limited to mobile terminals such as mobile phones, laptop computers, digital broadcast receivers, PDAs (Personal Digital Assistants), PADs (Portable Application Descriptions), PMPs (Portable Media Players), vehicle-mounted terminals (such as vehicle-mounted navigation terminals), etc., and fixed terminals such as digital TVs, desktop computers, etc. Figure 5 The systolic array reconstruction device shown is only an example and should not bring any limitation to the functions and scope of use of the embodiments of the present application.

[0098] like Figure 5 As shown, the systolic array reconstruction device may include a processing device 1001 (such as a central processing unit, a graphics processor, etc.), which can perform various appropriate actions and processes according to a program stored in a read-only memory (ROM: Read Only Memory) 1002 or a program loaded from a storage device 1003 to a random access memory (RAM: Random Access Memory) 1004. In RAM1004, various programs and data required for the operation of the systolic array reconstruction device are also stored. The processing device 1001, ROM1002 and RAM1004 are connected to each other through a bus 1005. An input / output (I / O) interface 1006 is also connected to the bus. Generally, the following systems can be connected to the I / O interface 1006: an input device 1007 including, for example, a touch screen, a touch pad, a keyboard, a mouse, an image sensor, a microphone, an accelerometer, a gyroscope, etc.; an output device 1008 including, for example, a liquid crystal display (LCD: Liquid Crystal Display), a speaker, a vibrator, etc.; a storage device 1003 including, for example, a magnetic tape, a hard disk, etc.; and a communication device 1009. The communication device 1009 can allow the systolic array reconstruction device to communicate with other devices wirelessly or by wire to exchange data. Although the systolic array reconstruction device with various systems is shown in the figure, it should be understood that it is not required to implement or have all the systems shown. More or fewer systems can be implemented or have alternatively.

[0099] In particular, according to the embodiments disclosed in the present application, the process described above with reference to the flowchart can be implemented as a computer software program. For example, the embodiments disclosed in the present application include a computer program product, which includes a computer program carried on a computer-readable medium, and the computer program includes a program code for executing the method shown in the flowchart. In such an embodiment, the computer program can be downloaded and installed from a network through a communication device, or installed from a storage device 1003, or installed from a ROM 1002. When the computer program is executed by the processing device 1001, the above-mentioned functions defined in the method of the embodiment disclosed in the present application are executed.

[0100] The systolic array reconstruction device provided in the embodiment of the present application adopts the systolic array reconstruction method in the above embodiment, which can solve the technical problem of low efficiency of task execution based on the systolic array. Compared with the prior art, the beneficial effects of the systolic array reconstruction device provided in the present application are the same as the beneficial effects of the systolic array reconstruction method provided in the above embodiment, and other technical features in the systolic array reconstruction device are the same as the features disclosed in the method of the previous embodiment, which will not be repeated here.

[0101] It should be understood that the various parts disclosed in this application can be implemented by hardware, software, firmware or a combination thereof. In the description of the above embodiments, specific features, structures, materials or characteristics can be combined in any one or more embodiments or examples in a suitable manner.

[0102] The above is only a specific implementation of the present application, but the protection scope of the present application is not limited thereto. Any person skilled in the art who is familiar with the present technical field can easily think of changes or substitutions within the technical scope disclosed in the present application, which should be included in the protection scope of the present application. Therefore, the protection scope of the present application should be based on the protection scope of the claims.

[0103] An embodiment of the present application provides a computer-readable storage medium having computer-readable program instructions (ie, a computer program) stored thereon, wherein the computer-readable program instructions are used to execute the systolic array reconstruction method in the above embodiment.

[0104] The computer-readable storage medium provided in the embodiment of the present application may be, for example, a USB flash drive, but is not limited to electrical, magnetic, optical, electromagnetic, infrared, or semiconductor systems or devices, or any combination of the above. More specific examples of computer-readable storage media may include, but are not limited to: an electrical connection with one or more wires, a portable computer disk, a hard disk, a random access memory (RAM: Random Access Memory), a read-only memory (ROM: Read Only Memory), an erasable programmable read-only memory (EPROM: Erasable Programmable Read Only Memory or flash memory), an optical fiber, a portable compact disk read-only memory (CD-ROM: CD-Read Only Memory), an optical storage device, a magnetic storage device, or any suitable combination of the above. In this embodiment, the computer-readable storage medium may be any tangible medium containing or storing a program, which may be used by or in combination with an instruction execution system or device. The program code contained on the computer-readable storage medium may be transmitted using any appropriate medium, including but not limited to: wires, optical cables, RF (Radio Frequency: Radio Frequency), etc., or any suitable combination of the above.

[0105] The computer-readable storage medium may be included in the systolic array reconstruction device; or may exist independently without being assembled into the systolic array reconstruction device.

[0106] The computer-readable storage medium carries one or more programs. When the one or more programs are executed by the systolic array reconstruction device, the systolic array reconstruction device: obtains the load matrix of the current task of the long short-term memory network and the configuration matrix of the systolic array, wherein the configuration matrix includes operator units configured for each operator in the current task; determines a reconstruction value of the current task according to the load matrix and the weight factors of each operator; and adjusts the configuration matrix according to the load matrix and the configuration of the operator unit when the reconstruction value exceeds a preset reconstruction threshold.

[0107] Computer program code for performing the operations of the present application may be written in one or more programming languages ​​or a combination thereof, including object-oriented programming languages ​​such as Java, Smalltalk, C++, and conventional procedural programming languages ​​such as "C" or similar programming languages. The program code may be executed entirely on the user's computer, partially on the user's computer, as a separate software package, partially on the user's computer and partially on a remote computer, or entirely on a remote computer or server. In the case of a remote computer, the remote computer may be connected to the user's computer through any type of network, including a local area network (LAN) or a wide area network (WAN), or may be connected to an external computer (e.g., via the Internet using an Internet service provider).

[0108] The flow chart and block diagram in the accompanying drawings illustrate the possible architecture, function and operation of the system, method and computer program product according to various embodiments of the present application. In this regard, each square box in the flow chart or block diagram can represent a module, a program segment or a part of a code, and the module, the program segment or a part of the code contains one or more executable instructions for realizing the specified logical function. It should also be noted that in some alternative implementations, the functions marked in the square box can also occur in a sequence different from that marked in the accompanying drawings. For example, two square boxes represented in succession can actually be executed substantially in parallel, and they can sometimes be executed in the opposite order, depending on the functions involved. It should also be noted that each square box in the block diagram and / or flow chart, and the combination of the square boxes in the block diagram and / or flow chart can be implemented with a dedicated hardware-based system that performs a specified function or operation, or can be implemented with a combination of dedicated hardware and computer instructions.

[0109] The modules involved in the embodiments described in this application may be implemented by software or hardware, wherein the name of the module does not constitute a limitation on the unit itself in some cases.

[0110] The readable storage medium provided in the embodiment of the present application is a computer-readable storage medium, which stores computer-readable program instructions (i.e., computer programs) for executing the above-mentioned systolic array reconstruction method, and can solve the technical problem of low efficiency of task execution based on systolic arrays. Compared with the prior art, the beneficial effects of the computer-readable storage medium provided in the present application are the same as the beneficial effects of the systolic array reconstruction method provided in the above-mentioned embodiment, and will not be repeated here.

[0111] An embodiment of the present application further provides a computer program product, including a computer program, which implements the steps of the systolic array reconstruction method as described above when the computer program is executed by a processor.

[0112] The computer program product provided in the embodiment of the present application can solve the technical problem of low efficiency of task execution based on systolic array. Compared with the prior art, the beneficial effects of the computer program product provided in the present application are the same as the beneficial effects of the systolic array reconstruction method provided in the above embodiment, which will not be described in detail here.

[0113] The above descriptions are only some embodiments of the present application, and are not intended to limit the patent scope of the present application. All equivalent structural changes made using the contents of the present application specification and drawings under the technical concept of the present application, or direct / indirect applications in other related technical fields are included in the patent protection scope of the present application.

Claims

1. A systolic array reconstruction method, characterized in that: The systolic array reconstruction method comprises: Obtaining a load matrix of a current task of a long short-term memory network and a configuration matrix of a systolic array, wherein the configuration matrix includes operator units configured for each operator in the current task; Determining a reconstruction value of the current task according to the load matrix and the weight factors of each of the operators; In a case where the reconstruction value exceeds a preset reconstruction threshold, the configuration matrix is ​​adjusted according to the load matrix and the configuration of the operator unit.

2. The systolic array reconstruction method according to claim 1, characterized in that: Before the step of determining the reconstruction value of the current task, the method further includes: Determining whether the task load of each operator in the load matrix is ​​within a preset parameter range; In the case where there is at least one task load that is not within the parameter range, the calculation order and resource allocation of each operator are reconstructed.

3. The systolic array reconstruction method according to claim 2, characterized in that: After the step of adjusting the configuration matrix, the method further includes: Determining the overall performance of the current task according to the acquired utilization rate of each operator and the weight factor; The weight factor, the reconstruction threshold and the parameter range are adjusted according to the overall performance.

4. The systolic array reconstruction method according to claim 1, characterized in that: After the step of adjusting the configuration matrix, the method further includes: Determining a data routing path for the current task according to the adjusted configuration matrix and the load matrix; Processing computing tasks of the operators in parallel through the data routing paths and the operator units in the adjusted configuration matrix; The calculation results of each of the calculation tasks are integrated through the aggregation node to obtain the task execution result.

5. The systolic array reconstruction method according to claim 1, characterized in that: After the step of obtaining the load matrix of the current task of the long short-term memory network and the configuration matrix of the systolic array, the method further includes: According to the acquired task load of each operator unit, the working state of each operator unit is adjusted.

6. The systolic array reconstruction method according to claim 5, characterized in that: The step of adjusting the working state of each of the operator units according to the acquired task load of each of the operator units includes: When the task load of the operator unit is within a preset low power consumption range, reducing the voltage frequency of the operator unit; When the task load of the operator unit is within a preset no-task range, the operator unit is shut down.

7. The systolic array reconstruction method according to claim 1, characterized in that: After the step of obtaining the load matrix of the current task of the long short-term memory network and the configuration matrix of the systolic array, the method further includes: Determine whether the obtained utilization rate of each of the operators is within a preset normal range; In the case that there is at least one of the utilization rates that is not within the normal range, the configuration matrix is ​​adjusted according to each of the utilization rates.

8. A systolic array reconstruction device, characterized in that: The device comprises: a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the computer program is configured to implement the steps of the systolic array reconstruction method according to any one of claims 1 to 7.

9. A storage medium, characterized in that: The storage medium is a computer-readable storage medium, and a computer program is stored on the storage medium. When the computer program is executed by a processor, the steps of the systolic array reconstruction method according to any one of claims 1 to 7 are implemented.

10. A computer program product, characterized in that The computer program product comprises a computer program, and when the computer program is executed by a processor, the steps of the systolic array reconstruction method according to any one of claims 1 to 7 are implemented.

Citation Information

Patent Citations

  • Method, device and system for adjusting calculation operator type distribution in calculation system

    CN111694653A

  • Matrix multiplier for Transform class model training

    CN116738135A

  • System and method for dynamic runtime merging of real time streaming operator environments

    US20170235555A1

  • Node configuration method, device and system

    WO2024045016A1