Resource allocation method and device of operator graph, computer device and storage medium

By allocating runtime periods to the operator graph and determining the target core resources, the problem of unreasonable resource allocation in many-core systems is solved, and the rational allocation and efficient utilization of resources are achieved.

CN115269163BActive Publication Date: 2026-02-17LYNXI TECH CO LTD
View PDF 3 Cites 0 Cited by

Patent Information

Application Number
CN202110474902.9
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2021-04-29
Publication Date
2026-02-17
Estimated Expiration
2041-04-29

AI Technical Summary

Technical Problem

In existing technologies, the allocation of core resources in many-core systems is unreasonable, leading to resource waste and low utilization.

Method used

By allocating runtime periods to the operator graph and determining the target core resources based on its runtime requirements, reasonable allocation and time-sharing operation can be achieved.

Benefits of technology

It improves resource utilization, reduces resource waste, meets the operational requirements of operator graphs, and enhances the efficiency of resource allocation.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN115269163B_ABST
    Figure CN115269163B_ABST
Patent Text Reader

Abstract

Embodiments of the present application disclose a resource allocation method and device for an operator graph, a computer device and a storage medium. The method comprises: in a set of operator graphs to be run on a many-core system, obtaining operator graphs with running demand information; dividing a running period into multiple running time periods, and allocating running time periods to each of the operator graphs with running demand information according to the running demand information of each of the operator graphs; and determining target core resources for running each of the operator graphs in each running time period according to a resource allocation type and the running demand information of each of the operator graphs. The running data of the operator graphs with running demand information in the allocated running time periods meets the running demand information in the running period. Embodiments of the present application can reasonably allocate core resources of a many-core system.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The embodiments of the present invention relate to the field of artificial intelligence, and in particular to a resource allocation method, apparatus, computer device and storage medium for operator graphs. Background Technology

[0002] In recent years, with the rapid development of artificial intelligence-related applications and technologies, the requirements for computing power and power efficiency have been increasing. However, related technologies also suffer from the drawback of unreasonable allocation of core resources in many-core systems. Summary of the Invention

[0003] This invention provides a method, apparatus, computer device, and storage medium for resource allocation of operator graphs, which can reasonably allocate the core resources of many-core systems.

[0004] In a first aspect, embodiments of the present invention provide a resource allocation method for an operator graph, applied to a many-core system, wherein the many-core system includes allocable core resources, including:

[0005] From the set of operator graphs to be run on many-core systems, obtain the demand operator graphs configured with running requirement information;

[0006] The running cycle is divided into multiple running time periods, and running time periods are allocated to each of the demand operator graphs according to the running demand information of each demand operator graph.

[0007] Based on the resource allocation type and the operational requirements of each demand operator graph, determine the target core resources used to run each demand operator graph within each operational time period;

[0008] The operational data of the demand operator graph within the allocated operating time period satisfies the operational demand information under the operating cycle.

[0009] Secondly, embodiments of the present invention also provide a resource allocation device for an operator graph, configured in a many-core system, the many-core system including allocable core resources, including:

[0010] The module for obtaining demand operator graphs is used to obtain demand operator graphs with running demand information from the set of operator graphs to be run on many-core systems.

[0011] The runtime allocation module is used to divide the runtime cycle into multiple runtime periods and allocate runtime periods to each demand operator graph according to the runtime demand information of each demand operator graph.

[0012] The target core resource allocation module is used to determine the target core resources for running each demand operator graph in each running time period based on the resource allocation type and the running demand information of each demand operator graph; wherein, the running data of the demand operator graph in the allocated running time period satisfies the running demand information under the running cycle.

[0013] Thirdly, embodiments of the present invention also provide a computer device, including a memory, a processor, and a computer program stored in the memory and executable on the processor. When the processor executes the program, it implements a resource allocation method for an operator graph as described in any of the embodiments of the present invention.

[0014] Fourthly, embodiments of the present invention also provide a computer-readable storage medium having a computer program stored thereon, which, when executed by a processor, implements the resource allocation method for the operator graph as described in any of the embodiments of the present invention.

[0015] This invention addresses the problem in related technologies where full resource allocation for each operator graph leads to wasted core resources. By allocating runtime periods to demanding operator graphs and determining the target core resources for each graph to run within those periods, this invention provides a method for allocating time and core resources. This method allows demanding operator graphs to run in a time-sharing manner and allocates appropriate core resources to meet runtime requirements. This enables the rational allocation of resources required by the operator graphs and targeted resource allocation, thereby improving resource utilization and reducing waste. Attached Figure Description

[0016] Figure 1 This is a flowchart of a resource allocation method for an operator graph according to Embodiment 1 of the present invention;

[0017] Figure 2 This is a flowchart of a resource allocation method for an operator graph according to Embodiment 2 of the present invention;

[0018] Figure 3 This is a flowchart of a resource allocation method for an operator graph according to Embodiment 3 of the present invention;

[0019] Figure 4 This is a flowchart of a resource allocation method for an operator graph according to Embodiment 4 of the present invention;

[0020] Figure 5 This is a schematic diagram of the structure of a resource allocation device for an operator graph according to Embodiment 5 of the present invention;

[0021] Figure 6 This is a schematic diagram of the structure of a computer device according to Embodiment Six of the present invention. Detailed Implementation

[0022] The present invention will now be described in further detail with reference to the accompanying drawings and embodiments. It should be understood that the embodiments described herein are merely illustrative of the invention and not intended to limit it. Furthermore, it should be noted that, for ease of description, the accompanying drawings show only the parts relevant to the present invention, and not all of the structures.

[0023] Example 1

[0024] Figure 1 This is a flowchart of a resource allocation method for an operator graph according to Embodiment 1 of the present invention. This embodiment is applicable to situations where resources are allocated to an operator graph based on its operational requirements. This method can be executed by the resource allocation device for the operator graph provided in this embodiment of the invention. This device can be implemented in software and / or hardware and is generally integrated into computer equipment. Figure 1 As shown, the method in this embodiment includes:

[0025] Any embodiment of the present invention is applied to a many-core system, which includes allocable core resources.

[0026] In this context, allocatable core resources refer to cores specifically allocated to operator graphs. A core is the smallest independently schedulable unit with full computational capabilities, possessing its own storage and computational resources. In addition to allocatable core resources, computer equipment resources also include core resources allocated to programs outside the operator graph to run other programs. Computer equipment implementing operator graph resource allocation methods includes many-core systems, which are used to run multiple operator graphs simultaneously. Many cores consist of a large number (potentially hundreds or thousands in the future) and various types of cores connected in a pre-defined manner, possessing high-performance parallel processing capabilities.

[0027] S110: Obtain the required operator graph with runtime requirement information from the set of operator graphs to be run on the many-core system.

[0028] An operator graph set can refer to a collection of operator graphs running in a many-core system. Runtime requirement information refers to the performance requirements of the corresponding operator graph. Runtime requirement information can be configured by the user. For example, runtime requirement information includes the minimum running speed and / or minimum running accuracy of the operator graph with configured runtime requirement information. A demanding operator graph is an operator graph in the operator graph set that has configured runtime requirement information. Matching the runtime data of a demanding operator graph with its runtime requirement information indicates that running the demanding operator graph using the allocated time period and resources yields runtime data that meets the requirements of the runtime requirement information. Operator graphs without configured runtime requirement information have no performance restrictions or requirements and can be allocated any number of core resources greater than zero.

[0029] The set of operator graphs includes at least one operator graph. Each operator graph includes at least one operator. When an operator graph includes at least two operators, the output of the preceding operator serves as the input of the next adjacent operator. Operators can refer to algorithms such as convolution, addition, subtraction, multiplication, division, or matrix addition and multiplication. Operator graphs are used to implement specific functions and can refer to high-performance computing algorithms. Operator graphs can include, but are not limited to, AI algorithms, machine learning algorithms, and general scientific computing algorithms. For example, an operator graph can be a deep learning model or a neural network. Multiple operator graphs can be allocated resources. At least two operator graphs can be independent or dependent, where the output of the first operator graph serves as the input of the second. Operator graphs require resources to run. Core resources are allocated to the operator graphs to run them, compute the input data, obtain the output data, and thus achieve the specific function.

[0030] Optionally, the operator graph includes: a neural network model or at least one network included in the neural network model.

[0031] In this context, an operator graph can be the entirety or a part of a neural network model. It can be understood as an operator graph used to implement a complete specific function, or a portion of a specific function. For example, an operator graph can be a neural network model, or a collection of networks consisting of at least one network within a neural network model.

[0032] In some optional embodiments, the operator graph may include a model formed by an image detection network and a speech recognition network, or the operator graph may only include an image detection network, or the operator graph may only include a speech recognition network. Similarly, the operator graph may include a model formed by an image detection network and an object recognition network, or the operator graph may only include an image detection network, or the operator graph may only include an object recognition network.

[0033] By configuring the operator graph as the entire model or as a part of the network included in the model, the application scenarios of the operator graph that the chip can execute can be enriched, as well as the business models of the operator graph, while improving the utilization rate of core resources.

[0034] S120, the running cycle is divided into multiple running time periods, and running time periods are allocated to each of the demand operator graphs according to the running demand information of each demand operator graph.

[0035] A runtime cycle refers to the time required for the many-core system to complete one execution of the computational tasks corresponding to all operator graphs in the operator graph set. The many-core system repeats runtime cycles cyclically. A runtime period refers to a portion of a runtime cycle, and its duration is shorter than the runtime cycle. The runtime period allocated to a demand operator graph refers to the time during which the demand operator graph runs in the many-core system. The runtime period is a portion of the runtime cycle of the many-core system. Demand operator graphs are loaded into the many-core system and run during their scheduled runtime periods, and are removed from the many-core system at the end of the runtime period. The runtime periods can be divided based on the number of demand operator graphs. For example, if there are 8 demand operator graphs, the runtime cycle can be divided into 4 runtime periods of equal duration, with each runtime period running two demand operator graphs. Different demand operator graphs can be allocated the same or different runtime periods.

[0036] In some optional embodiments, the on-chip storage of the many-core system cannot hold the configuration information of all operator graphs included in the operator graph set at once. Therefore, the operator graphs need to be loaded into the many-core system in batches to achieve time-sharing execution within the many-core system. The time period during which the operator graphs run in the many-core system is the execution time period. On-chip storage can refer to the allocable storage resources in the many-core system or the chip's memory, used to store the data associated with the operator graph set. If the on-chip storage is smaller than the space occupied by the operator graph set, it indicates that the chip cannot store (or accommodate) the operator graph set at the same time. If the on-chip storage is smaller than the space occupied by the operator graph set, and the on-chip storage cannot hold the configuration information of the operator graph set, the configuration information of a portion of the operator graphs in the operator graph set can be loaded first. After the partial operator graphs have completed execution and obtained the output results, the configuration information of the partial operator graphs is removed from the on-chip storage, and the configuration information of the remaining operator graphs is loaded into the on-chip storage to run the remaining part of the operator graphs, continuing the calculation, and so on, until the final result is obtained.

[0037] Dividing the runtime cycle into multiple runtime periods can be achieved by pre-allocating a period shorter than the runtime cycle as the current runtime period. For each demand operator graph, it is placed into the many-core system to run within that runtime period, and runtime data is collected. If the runtime data meets the runtime requirements, the runtime period is confirmed as the runtime period for that demand operator graph. If the runtime requirements are not met, the demand operator graph is determined to be mismatched with that runtime period. This process continues until all demand operator graphs to be assigned have been checked against runtime periods. Based on the number of demand operator graphs to be assigned, the remaining runtime cycle is divided into another runtime period, and the process of checking whether the demand operator graphs to be assigned will run within the current runtime period continues, and so on, until all demand operator graphs have been assigned, and the runtime period division is considered complete. Here, demand operator graphs to be assigned can refer to those demand operator graphs that have not yet been assigned a runtime period within the currently defined runtime period.

[0038] S130, based on the resource allocation type and the operational requirement information of each of the demand operator graphs, determine the target core resources for running each of the demand operator graphs in each operational time period; wherein, the operational data of the demand operator graph in the allocated operational time period satisfies the operational requirement information under the operational cycle.

[0039] The target core resource is the core resource allocated to the demanding operator graph during the runtime period. In a many-core system, the target core resource is used to run the demanding operator graph. The resource allocation type serves as the basis for allocating core resources to the operator graph and determines the resource allocation strategy for the set of operator graphs. The resource allocation type determines the method for allocating core resources; different resource allocation types correspond to different core resource allocation methods. Optionally, different operator graphs in an operator graph group may have the same resource allocation type, i.e., they may correspond to the same core resource allocation method.

[0040] Optionally, resource allocation types include: high-performance, energy-saving, or balanced. Resource evaluation can be categorized into three types, primarily corresponding to the power consumption of AI chips. Since power consumption is related to throughput, it can be viewed as a combination of different priorities of the three keywords mentioned above, thus resource allocation types can be classified as high-performance, balanced, or energy-saving. Chip power consumption mainly depends on data transfer, core computation, and resource scheduling. The power consumption of these three varies under different conditions. For example, all other things being equal, the greater the amount of data transferred per unit time, the greater the power consumption; all other things being equal, the more cores used for computation per unit time, the greater the power consumption; all other things being equal, the more resource scheduling instructions issued per unit time, the greater the power consumption of the scheduler.

[0041] This invention addresses the problem in related technologies where full resource allocation for each operator graph leads to wasted core resources. By allocating runtime periods to demanding operator graphs and determining the target core resources for each graph to run within those periods, this invention provides a method for allocating time and core resources. This method allows demanding operator graphs to run in a time-sharing manner and allocates appropriate core resources to meet runtime requirements. This enables the rational allocation of resources required by the operator graphs and targeted resource allocation, thereby improving resource utilization and reducing waste.

[0042] Example 2

[0043] Figure 2 This is a flowchart of a resource allocation method for an operator graph according to Embodiment 2 of the present invention. Based on the above embodiments, this embodiment divides the operating cycle into multiple operating time periods and allocates operating time periods to each demanding operator graph according to its operating demand information. This can be achieved by alternately executing the operation of dividing a operating time period within the operating cycle, and the operation of determining each target demanding operator graph running within the divided operating time period according to its operating demand information, until matching operating time periods are allocated to all demanding operator graphs within the operating cycle. Optionally, the method of this embodiment may include:

[0044] S210: Obtain the required operator graph with runtime requirement information from the set of operator graphs to be run on the many-core system.

[0045] For embodiments not detailed in the present invention, please refer to the foregoing description.

[0046] S220, alternately execute the operation of dividing a running time period within the running cycle, and determine the operation of each target demand operator graph to run within the divided running time period according to the running demand information of each demand operator graph to be assigned, until a matching running time period is assigned to all demand operator graphs within the running cycle.

[0047] The selectable running time periods are determined one by one. When dividing a running time period, it is checked whether the demand operator graph to be assigned is the target demand operator graph. That is, it is checked whether the running data of the demand operator graph to be assigned during the running time period meets the configured running requirement information. Thus, the operation of dividing the running time period and the operation of determining the target first operator graph within the running time period are executed alternately.

[0048] A target demand operator graph refers to a demand operator graph in which the running data within the divided running time period satisfies the configured running requirements. The target demand operator graph is matched with the currently divided running time period.

[0049] Optionally, after dividing the runtime into a runtime period, the system checks whether the runtime data obtained by each demand operator graph running in that runtime period meets the runtime requirements. If it does, the demand operator graph is identified as the target demand operator graph for that runtime period. If it does not, the demand operator graph is determined to be mismatched with the runtime period, i.e., it is not the target demand operator graph for that runtime period. After all demand operator graphs have been checked for matching with the runtime period, the system divides the runtime period into another runtime period and checks whether the runtime data obtained by the remaining demand operator graphs to be assigned in that runtime period meets the runtime requirements, and so on.

[0050] S230, based on the resource allocation type and the operational requirement information of each of the demand operator graphs, determine the target core resources for running each of the demand operator graphs within each operational time period; wherein, the operational data of the demand operator graph within the allocated operational time period satisfies the operational requirement information under the operational cycle.

[0051] This invention, through alternating the operations of dividing the runtime into time periods and determining the target demand operator graph within each runtime period, can quickly and accurately divide the runtime into time periods. For each runtime period, it sequentially determines the matching target demand operator graph in the demand operator graph to be allocated, reducing the omission of demand operator graphs, improving the accuracy of runtime allocation, increasing runtime utilization, and ensuring that each demand operator graph can meet the configured runtime demand information, thereby rationally allocating the resources of the many-core system and improving the resource utilization of the many-core system.

[0052] Optionally, determining each target demand operator graph running within the divided running time period based on the running demand information of each demand operator graph to be assigned includes: determining each target demand operator graph running within the divided running time period based on the segment demand information obtained by converting the running demand information of the current demand operator graph to be assigned into the divided running time period, and the running data of the current demand operator graph to be assigned within the divided running time period.

[0053] The segment-specific demand information is used to determine whether the divided runtime period matches the runtime period of the currently to-be-assigned demand operator graph, i.e., whether the currently to-be-assigned demand operator graph is the target demand operator graph running within the divided runtime period. The segment-specific demand information matches the runtime demand information; the runtime demand information is the demand information within the runtime cycle, while the segment-specific demand information is the demand information within the divided runtime period. The segment-specific demand information can be determined based on the runtime cycle, the duration of the divided runtime period, and the runtime demand information. For example, the product of the ratio of the runtime cycle to the duration of the divided runtime period and the corresponding value of the runtime demand information is the value corresponding to the segment-specific demand information.

[0054] In some optional embodiments, the runtime requirement information of the currently to-be-assigned demand operator graph refers to the requirement information that needs to be met throughout the entire runtime cycle. The currently to-be-assigned demand operator graph runs within its allocated runtime period and does not run within the unallocated runtime period. That is, the runtime data of the currently to-be-assigned demand operator graph within its allocated runtime period needs to also meet certain requirement information within the unallocated runtime period. Accordingly, the runtime requirement information can be converted into segmented runtime periods and mapped to segment-level requirement information. Based on the segment-level requirement information, it is compared with the runtime data of the currently to-be-assigned demand operator graph to detect whether the runtime data of the currently to-be-assigned demand operator graph meets the segment-level requirement information, thereby detecting whether the runtime data of the currently to-be-assigned demand operator graph meets the runtime requirement information for the entire runtime cycle.

[0055] By converting the runtime demand information under the runtime cycle into the segment demand information within the runtime time period, and based on the segment demand information, detecting whether the runtime data of the currently to-be-assigned demand operator graph within the runtime time period meets the segment demand information, it is possible to determine whether the currently to-be-assigned demand operator graph matches the runtime time period. This can accurately determine whether the runtime data of the currently to-be-assigned demand operator graph within the runtime time period meets the runtime demand information under the runtime cycle, thereby accurately determining the target demand operator graph that matches the runtime time period, improving the allocation accuracy of runtime time periods, and precisely meeting the runtime demand information configured for each demand operator graph.

[0056] Optionally, dividing a running time period within the running cycle includes: dividing the first running time period within the running cycle according to the starting time of the running cycle and a preset duration; or dividing the currently unallocated demand operator graphs to determine the number of groups formed by the division; determining the remaining duration according to the running cycle and the durations corresponding to the divided running time periods; dividing the remaining duration according to the number of groups to obtain sub-durations; and dividing a running time period within the running cycle according to the end point of the last running time period in the time sequence and the sub-durations.

[0057] The starting point of the running cycle is determined as the starting point of the first running time segment, and the preset duration is determined as the duration of the first running time segment. Based on the starting point and duration of the first running time segment, the first running time segment can be determined within the running cycle. The preset duration can be determined based on the running requirements information of each first operator graph, or it can be determined based on the average running cycle of the first operator graphs as statistically analyzed in experiments, or it can be determined by calculating the ratio between the running cycle and the number of groups formed by the currently assigned first operator graphs.

[0058] Apart from the first running time period, the division of other running time periods is determined by the number of groups and the remaining time, and the end point of the last running time period in the time sequence.

[0059] The number of groups is used to divide the remaining time. The number of groups can be calculated as the ratio between the number of first operator graphs to be assigned and the number of first operator graphs in the group, based on the number of first operator graphs in the preset group. For example, if the number of first operator graphs in the group is 2 and the number of first operator graphs to be assigned is 8, the number of groups is 8 / 2 = 4.

[0060] The difference between the running cycle and the sum of the durations of each of the pre-divided running time periods is determined as the remaining time. The ratio of the remaining time to the number of groups is determined as the minute duration. For example, if the number of groups is 4 and the remaining time is 8 minutes, then the minute duration is determined to be 8 / 4 = 2 minutes.

[0061] The end point of the last running time period in the divided running time period is taken as the starting point of the running time period other than the first time period. Based on the time length, the running time period other than the first time period is determined in the running cycle.

[0062] By providing a way to divide the runtime, the duration of the runtime can be flexibly adjusted in real time according to the number of each first operator graph to be allocated. This allows for precise control of the runtime of each first operator graph, reasonable configuration of the runtime of the many-core system, improved utilization and flexibility of time resources, and reduced waste of many-core system resources.

[0063] Optionally, a running cycle may include multiple running time periods, with at least two running time periods having different durations.

[0064] The runtime cycle can be divided into multiple runtime periods to enable time-sharing reuse of operator graphs in a many-core system. Optionally, based on the aforementioned determined runtime periods, the duration of the runtime period with earlier timing is greater than the duration of the runtime period with later timing. The first optional runtime period has the longest duration, and the optional duration decreases as the number of remaining operator graphs is subdivided.

[0065] By configuring a runtime cycle to include multiple runtime periods, and configuring at least two runtime periods to have different durations, the runtime periods can be flexibly adjusted to adapt to the runtime configuration requirements of the demand operator graph.

[0066] Optionally, based on the segment-specific demand information obtained by converting the runtime demand information of the currently unassigned demand operator graph to the divided runtime period, and the runtime data of the currently unassigned demand operator graph within the divided runtime period, each target first operator graph running within the divided runtime period is determined. This includes: determining the current operator graph in each of the currently unassigned demand operator graphs; determining the segment-specific demand information of the current operator graph within the divided runtime period based on the runtime demand information of the current operator graph, the duration within the divided runtime period, and the runtime cycle; obtaining the runtime data of the current operator graph within the divided runtime period; determining the current operator graph as a target demand operator graph when the current operator graph meets the performance conditions based on the segment-specific demand information and the runtime data; and returning to the operation of determining the current operator graph in each of the currently unassigned demand operator graphs until the end-of-assignment condition is met.

[0067] Among the demand operator graphs currently awaiting allocation, one demand operator graph is selected as the current operator graph. For example, the current operator graph can be determined based on its priority among the current demand operator graphs. For example, priority can be whether the demand operator graph has a temporal relationship, and whether the temporal relationship to which the demand operator graph belongs contains a demand operator graph with an allocated runtime period. The order of priority from high to low can be: demand operator graphs awaiting allocation that have a temporal relationship with a demand operator graph with an allocated runtime period, all demand operator graphs awaiting allocation that have a temporal relationship, and all demand operator graphs awaiting allocation that do not have a temporal relationship. Two demand operator graphs with a temporal relationship have a dependency relationship in their input data and / or output data.

[0068] The ratio between the numerical value corresponding to the current operator graph's runtime requirement information and the numerical value corresponding to the segment requirement information within the divided runtime period corresponds to the ratio between the runtime cycle and the duration within the divided runtime period. For example, the former is inversely proportional to the latter. Runtime data describes the runtime performance of the current operator graph within the current processing runtime period. Optionally, it uses the remaining core resources of the current processing runtime period to run the current operator graph, obtaining the runtime performance test results. It should be noted that the core resources ultimately allocated to this third operator graph can be different from the remaining core resources; optionally, the core resources ultimately allocated to this third operator graph are less than or equal to the remaining core resources. Remaining core resources are used to determine whether the maximum remaining capacity of the current processing runtime period can meet the runtime requirements of the third operator graph. If the maximum capacity cannot meet the requirements, then the current processing runtime period cannot meet the runtime requirements of the third operator graph. Performance conditions are used to determine whether the runtime data of the current operator graph meets the segment requirement information. The end allocation condition is used to determine whether the pending demand operator graphs have been completely evaluated. For example, the end-of-assignment condition is that the matching results of the currently pending demand operator graph and the running time period have been determined, and there is no currently pending demand operator graph.

[0069] By iteratively determining whether each demand operator graph to be assigned is a target demand operator graph running within a specified time period, the matching relationship between each demand operator graph and the time period is established. This ensures accurate allocation of time periods for each demand operator graph, avoiding omissions. Furthermore, each demand operator graph needs to be checked to ensure it meets performance requirements. This allows for the allocation of time periods while precisely meeting the operational needs of the demand operator graph, improving the flexibility and control precision of time period allocation.

[0070] Optionally, two demand operator graphs that have a temporal relationship may be assigned the same or adjacent runtime periods.

[0071] Temporal relationships include sequential temporal relationships and / or parallel temporal relationships. At least two operator graphs with a sequential temporal relationship can mean that the dependencies of at least two operator graphs on data are sequential in time; for example, the input data of the first operator graph is the output data of the second operator graph. At least two operator graphs with a parallel temporal relationship can mean that the dependencies of at least two operator graphs on the same data are simultaneous; one input data is input into two operator graphs for computation. For operator graphs with temporal relationships, data flows sequentially from beginning to end. When a parallel temporal relationship is encountered, the data is simultaneously delivered to all operator graphs with parallel temporal relationships.

[0072] Two operator graphs with a temporal relationship have data dependencies. If at least two operator graphs with a temporal relationship run in different time periods, intermediate data from the previous time period needs to be retained until the next time period or more. This results in storing a large amount of intermediate data, consuming excessive storage resources, and wasting storage resources. Therefore, placing operator graphs with a temporal relationship in the same time period or in two adjacent time periods can reduce the storage time of intermediate data, release storage resources for intermediate data in a timely manner, and improve the utilization rate of storage resources.

[0073] It should be noted that the serial timing relationship between two operator graphs with a serial timing relationship corresponds to the timing of the running time period. For example, the operator graph with the earlier timing relationship runs in the running time period with the earlier timing relationship, while the operator graph with the later timing relationship runs in the running time period with the later timing relationship.

[0074] By placing operator graphs with temporal relationships in the same runtime period or in two adjacent runtime periods, the storage time of intermediate data can be reduced, storage resources for intermediate data can be released in a timely manner, and the utilization rate of storage resources can be improved.

[0075] Optionally, the operation demand information includes the operation demand speed, and the segment demand information includes the segment demand speed; determining the segment demand information of the current operator graph within the divided operation time period includes: calculating the ratio of the operation cycle to the duration corresponding to the divided operation time period; calculating the product of the operation demand speed and the ratio to determine the segment demand speed.

[0076] The running data is the average speed of the current operator graph within the divided running time period, and the running requirement information is the running requirement speed. The intra-segment requirement information is the intra-segment requirement speed. The average speed of the current operator graph is the speed at which the operator graph calculates the output data based on the received random data. Running requirement information can be divided into running requirement information for a single image and running requirement information for multiple images. The latency in the running requirement information for a single image is not negligible, but it is negligible for multiple images. The running requirement information in the above scheme is the running requirement information over a period of time, not for a single image. The ratio of the intra-segment requirement speed to the total running requirement speed is equal to the ratio of the running cycle to the duration corresponding to the divided running time period.

[0077] By configuring the content of the runtime data and the corresponding calculation methods, the runtime performance of the required operator graph can be accurately determined, and the runtime time of the operator graph can be allocated in the direction of meeting performance requirements. This can meet diverse performance requirements, flexibly configure the runtime mode of the operator graph, and enrich the application scenarios of the operator graph.

[0078] Optionally, determining that the current operator graph meets the performance conditions includes: if it is determined that the running speed of the current operator graph is greater than or equal to the required speed within the segment, then the current operator graph is determined to meet the performance conditions.

[0079] If it is determined that the running speed of the current operator graph is greater than or equal to the demand speed within the segment, then the current operator graph meets the performance conditions, that is, the running data within the running time period meets the running demand information, and the current operator graph is a target demand operator graph running within the running time period; if it is determined that the running speed of the current operator graph is less than the demand speed within the segment, and it is determined that the current operator graph does not meet the performance conditions, that is, the running data within the running time period does not meet the running demand information, then the current operator graph is not a target demand operator graph running within the running time period.

[0080] By analyzing the actual running speed of the current operator graph and the required speed within the segment, it is possible to detect whether the current operator graph matches the running time period. This allows for precise control of the running cycle of each operator graph, flexible configuration of time-sharing reuse of core resources, and improved utilization of core resources.

[0081] Example 3

[0082] Figure 3 This is a flowchart of a resource allocation method for operator graphs according to Embodiment 3 of the present invention. Based on the above embodiments, this embodiment determines each target demand operator graph running within a defined running time period according to the running requirement information of each demand operator graph to be allocated. This can be achieved by: determining whether each of the currently to-be-allocated demand operator graphs includes a target operator graph group, wherein the target operator graph group includes multiple first operator graphs, each first operator graph is configured with running requirement information, and there is a temporal relationship between the multiple first operator graphs in the target operator graph group; when a target operator graph group is determined to exist, the running time period for each first operator graph in the target operator graph group to run in the many-core system is determined according to the running requirement information of each first operator graph in the target operator graph group. Optionally, the method of this embodiment may include:

[0083] S310: Obtain the required operator graph with runtime requirement information from the set of operator graphs to be run on the many-core system.

[0084] For embodiments not detailed in the present invention, please refer to the foregoing description.

[0085] S320, alternately executes operations that are divided into a runtime period within the runtime cycle; and

[0086] S330, in each of the currently to-be-allocated demand operator graphs, determine whether each of the currently to-be-allocated demand operator graphs includes a target operator graph group, the target operator graph group includes multiple first operator graphs, each first operator graph is configured with running demand information, and there is a temporal relationship between the multiple first operator graphs in the target operator graph group.

[0087] In the target operator graph group, each first operator graph has a temporal relationship with at least one first operator graph in the group, and each first operator graph is configured with runtime requirement information. In some optional embodiments, the target operator graph group can be formed by multiple first operator graphs that have a temporal relationship and are all configured with runtime requirement information.

[0088] S340, when it is determined that a target operator graph group exists, the operation of each first operator graph in the target operator graph group to be run in the many-core system is determined according to the operation requirement information of each first operator graph in the target operator graph group, until a matching operation time period is allocated for all the demanding operator graphs in the operation cycle.

[0089] The first operator graph in the target operator graph group is the demand operator graph. The execution time period to be run is determined sequentially for each first operator graph in each target operator graph group. If the first operator graph in any target operator graph group cannot run within the currently processed execution time period, it is verified whether the demand operator graphs other than the first operator graph in the target operator graph group are the target demand operator graphs for the execution time period.

[0090] S350, based on the resource allocation type and the operational requirement information of each of the demand operator graphs, determine the target core resources for running each of the demand operator graphs within each operational time period; wherein, the operational data of the demand operator graph within the allocated operational time period satisfies the operational requirement information under the operational cycle.

[0091] Optionally, determining the target core resources for running the demanded operator graphs within each running time period based on the resource allocation type and the running requirement information of each demanded operator graph includes: determining the target core resources for running each first operator graph in the target operator graph group within each running time period based on the resource allocation type and the running requirement information of each first operator graph in the target operator graph group.

[0092] This invention, through its embodiments, determines the execution time period for each demand operator graph when it includes a graph with execution requirements and a temporal relationship with other demand operator graphs, as well as the target core resources used to run each demand operator graph within each execution time period. This allows demand operator graphs to be placed in different time periods, providing a method for allocating time and core resources. It enables the rational allocation of resources required by operator graphs and the targeted allocation of resources, thereby improving resource utilization and reducing resource waste.

[0093] Optionally, determining the running time period of each first operator graph in the target operator graph group to be run in the many-core system based on the running requirement information of each first operator graph in the target operator graph group includes: for the currently processed running time period, selecting the current operator graph from the currently unassigned first operator graphs in the target operator graph group; if it is determined that the running data of the current operator graph in the currently processed running time period meets the performance conditions, then the currently processed running time period is determined as the running time period of the current operator graph to be run in the many-core system; returning to the operation of selecting the current operator graph from the currently unassigned first operator graphs in the target operator graph group, until it is determined that the current operator graph does not meet the performance conditions; if it is determined that the current operator graph does not meet the performance conditions, and / or it is determined that there are no remaining core resources other than the target core resources, then the verification of the target operator graph group for the currently processed running time period ends.

[0094] The runtime cycle can be divided into runtime periods, and once a runtime period is determined, that runtime period is designated as the currently processed runtime period. The first operator graphs currently to be assigned in the target operator graph group refer to the first operator graphs that are not running within the already divided runtime periods (including the currently processed runtime period). Selecting the current operator graph can mean choosing the first operator graph with the highest priority among the currently to be assigned first operator graphs. In the currently processed target operator graph group, the first operator graphs with assigned runtime periods (belonging to the same target operator graph group) and the currently to be assigned first operator graphs (belonging to the same target operator graph group) have a temporal relationship. Therefore, the current operator graph can be selected sequentially according to the temporal order among the first operator graphs in the target operator graph group.

[0095] Performance conditions are used to determine whether the running data of the current operator graph meets the configured running requirements. If the running data of the current operator graph meets the performance conditions, it means that the current operator graph can meet the configured running requirements within the current processing time period, and therefore, the current operator graph can be placed for execution within the current processing time period. If the current operator graph does not meet the performance conditions, it means that the current operator graph does not meet the configured running requirements within the current processing time period, and therefore, the current operator graph cannot be placed for execution within the current processing time period. Regardless of whether the current operator graph meets the performance conditions, the next current operator graph is selected after the determination. If the current operator graph does not meet the performance conditions, it means that the current operator graph cannot meet the configured running requirements within the current processing time period. The current processing time period verifies and allocates resources to the first operator graph in sequence. If a higher-priority first operator graph cannot meet the configured running requirements, a lower-priority first operator graph cannot be verified or allocated resources. If there are no remaining core resources besides the target core resources, it indicates that the unallocated remaining core resources for the current runtime are insufficient to run the remaining first operator graph. In this case, the current runtime cannot support the first operator graph. If the current operator graph does not meet the performance requirements, and / or it is determined that there are no remaining core resources besides the target core resources, it indicates that the remaining first operator graph cannot be verified. Therefore, the verification of any first operator graph in the target operator graph group for the current runtime ends. If the current operator graph does not meet the performance requirements, the verification of any first operator graph in the next target operator graph group can begin for the current runtime; if it is determined that there are no remaining core resources besides the target core resources, the verification of any target operator graph group for the current runtime ends.

[0096] By selecting the first operator graph in the target operator graph group according to the current processing time period, and checking whether the performance conditions can be met, the goal is to place as many first operator graphs as possible while taking into account the running requirements, so as to rationally allocate resources and improve the resource utilization of the many-core system.

[0097] Optionally, selecting the current operator graph from the current first operator graphs to be assigned in the first operator graph group includes: selecting the first operator graph with the earlier timing according to the timing relationship of the current first operator graphs to be assigned in the first operator graph group, and determining it as the current operator graph.

[0098] In a serial timing relationship, if the output of one first operator graph is the input of another first operator graph, then the first operator graph with the earlier timing is the first operator graph of the output result. If the two first operator graphs are dependent on the same data, the first operator graph with the earlier timing can be either of the two first operator graphs.

[0099] It should be noted that the aforementioned determination that the current operator graph does not meet the performance conditions includes: determining that the first operator graph with a preceding time sequence does not meet the performance conditions. In some optional embodiments, in the current first operator graph to be assigned, the second-sequence first operator graph depends on the output of the first-sequence first operator graph. If the second-sequence first operator graph runs during the current processing time period, while the first-sequence first operator graph does not run during the current processing time period, the second-sequence first operator graph cannot obtain an output result and therefore cannot run correctly. Thus, when it is determined that the first-sequence first operator graph does not meet the performance conditions, the verification of the first operator graph for the current processing time period can be terminated. Furthermore, in parallel timing relationships, the number of first-sequence first operator graphs includes at least two, and correspondingly, the number of current operator graphs includes at least two.

[0100] By prioritizing the allocation of the first operator graph with the earlier timing sequence, the first operator graph with a later timing sequence can obtain the output results of the first operator graph with the earlier timing sequence, thereby improving the accurate operation of the first operator graph and enhancing the stability of the many-core system.

[0101] Optionally, the method further includes: for any given running time period, when it is determined that there are remaining core resources other than the target core resources, determining a second operator graph from the demand operator graph, so as to determine the core resources for running the second operator graph based on the remaining core resources, wherein the second operator graph has no temporal relationship with any operator graph.

[0102] The sum of remaining core resources and at least one target core resource constitutes the allocatable core resources of the many-core system. Target core resources are the core resources allocated to the first runnable operator graph within the runtime period. The number of target core resources is the same as the number of first operator graphs. The existence of remaining core resources other than the target core resources indicates that all runnable first operator graphs within the runtime period have been determined, and the remaining core resources are insufficient to allocate to the first operator graphs to meet their configured runtime requirements. The second operator graph differs from the first operator graph; the second operator graph can be an operator graph that has no temporal relationship with any other operator graph and is configured with runtime requirements information.

[0103] In some optional embodiments, a first operator graph that can run during a given runtime is prioritized. If the remaining first operator graphs cannot run during the runtime and there are remaining core resources available during that runtime, then a second operator graph that can run during that runtime is determined. During the matching process between runtimes and operator graphs, the first operator graph has a higher priority than the second operator graph. If there are no remaining core resources available during the runtime, then a second operator graph that can run during that runtime is not detected.

[0104] By allocating core resources to the second operator graph when it is determined that there are remaining core resources, and determining that the second operator graph is an operator graph that runs on a running time period, a resource allocation method is provided to determine the running time period of the operator graph based on the priority of the operator graph. This improves the flexibility of resource allocation and can meet diverse allocation needs.

[0105] It should be noted that, for the current processing runtime, after the verification of each target operator graph group for the current processing runtime ends, if it is determined that at least one second operator graph exists, then the current operator graph is selected from the currently assigned second operator graphs. If it is determined that the running data of the current operator graph within the current processing runtime meets the performance conditions, then the current processing runtime is determined as the runtime to be run for the current operator graph in the many-core system. The process then returns to the operation of selecting the current operator graph from the currently assigned second operator graphs until the verification of each currently assigned second operator graph is completed and / or it is determined that there are no remaining core resources other than the target core resources, and the verification of the demand operator graphs for the current processing runtime ends.

[0106] Optionally, the method further includes: for any given running time period, when it is determined that there are remaining core resources other than the target core resources, determining a no-demand operator graph from the set of operator graphs, so as to determine the core resources for running the no-demand operator graph based on the remaining core resources, wherein the no-demand operator graph is not configured with running demand information.

[0107] Since the no-demand operator graph does not contain runtime requirement information, it can run within the current processing runtime period as long as there are remaining core resources (e.g., the number of remaining core resources includes at least one). For example, the number of remaining core resources is at least one. If the no-demand operator graph does not exist or the current remaining core resources are empty, it cannot run within the current processing runtime period.

[0108] By determining whether each demand-free operator graph is running within the current processing time period based on the demand information, the running time period of each demand-free operator graph can be precisely controlled. This maximizes the number of operator graphs running within the current processing time period, rationally allocates the running time period of the many-core system, improves the utilization and flexibility of time resources, and reduces the waste of many-core system resources.

[0109] Optionally, determining the no-demand operator graph from the set of operator graphs includes: when there is at least one third operator graph, determining the third operator graph as a no-demand operator graph, wherein the third operator graph is not configured with runtime requirement information and has a temporal relationship with at least one operator graph; when there is no third operator graph or after the determination of each third operator graph is completed, the current remaining core resources are not empty and there is at least one fourth operator graph, determining the fourth operator graph as a no-demand operator graph, wherein the fourth operator graph is not configured with runtime requirement information and has no temporal relationship with any operator graph.

[0110] To effectively utilize and promptly release resources, operator graphs with temporal relationships can be optionally placed in the same or adjacent runtime periods. For the current processing runtime period, in the operator graphs without demand, the third operator graph with temporal relationships is verified first. After the verification of all third operator graphs is completed, the fourth operator graph without temporal relationships is then verified.

[0111] Multiple third operator graphs with temporal relationships are grouped into a demand-free but time-sequential operator graph group, and the current operator graph group is selected. For the current processing runtime, among the currently unassigned third operator graphs in the current operator graph group, the current operator graph is selected. If it is determined that the running data of the current operator graph meets the performance requirements within the current processing runtime, then the current processing runtime is determined as the runtime to be run for the current operator graph in the many-core system. The process returns to selecting the current operator graph among the currently unassigned but time-sequential operator graphs in the demand-free but time-sequential operator graph group, until it is determined that the current operator graph does not meet the performance requirements. If it is determined that the current operator graph does not meet the performance requirements, and / or it is determined that there are no remaining core resources other than the target core resource, then the verification of the current operator graph group for the current processing runtime ends, and the process returns to selecting the current operator graph group, until the verification of each demand-free but time-sequential operator graph group for the current processing runtime ends. After completing the verification of each demand-free time-series operator graph group for the current processing runtime, in the fourth operator graph, select the current operator graph. If it is determined that the running data of the current operator graph meets the performance conditions within the current processing runtime, then the current processing runtime is determined as the runtime to be run for the current operator graph in the many-core system. Return to the operation of selecting the current operator graph in the fourth operator graph until it is determined that the verification of all fourth operator graphs is completed.

[0112] By configuring the verification sequence of demand-free operator graphs, it is possible to determine one by one whether a demand-free operator graph is running in the current processing time period based on the requirements information and timing relationships. This allows for fine-grained control over the running time period of each demand-free operator graph, enabling reasonable configuration of the running time period of the many-core system, improving the utilization and flexibility of time resources, and reducing the waste of many-core system resources.

[0113] Optionally, the resource allocation method for the operator graph further includes: when it is determined that the target operator graph group does not exist, determining whether the demand operator graph includes a second operator graph; when at least one second operator graph exists, determining the running time period of each second operator graph to be run in the many-core system and the target core resources used to run each second operator graph in each running time period, based on the running requirement information of each second operator graph.

[0114] If the first operator graph group does not exist, the existence of the second operator graph is determined first. If the second operator graph exists, the runtime period for each second operator graph in the many-core system is determined based on the runtime requirements information, as well as the target core resources used to run each second operator graph within each runtime period.

[0115] By configuring the allocation of runtime periods and core resources for the remaining operator graphs in the absence of a first operator graph group, the application scenarios of operator graph resource allocation can be enriched, adapting to different application needs, meeting diverse resource allocation requirements, and making resource allocation more flexible.

[0116] Example 4

[0117] Figure 4 This is a flowchart of a resource allocation method for an operator graph according to Embodiment 4 of the present invention. Based on the above embodiments, this embodiment determines the target core resources for running each demanding operator graph within each running time period according to the resource allocation type and the running requirement information of each demanding operator graph. This can be achieved by: determining the remaining core resources for the currently processed running time period based on the core resources available for allocation in the many-core system and the core resources already allocated for the currently processed running time period; and allocating target core resources to the current operator graph that meets the performance conditions from the remaining core resources of the currently processed running time period, according to the resource allocation type. Optionally, the method of this embodiment may include:

[0118] S410: Obtain the required operator graph with runtime requirement information from the set of operator graphs to be run on the many-core system.

[0119] For embodiments not detailed in the present invention, please refer to the foregoing description.

[0120] S420, alternately executes operations that are divided into a runtime period within the runtime cycle; and

[0121] S430, in each of the currently to-be-allocated demand operator graphs, determine whether each of the currently to-be-allocated demand operator graphs includes a target operator graph group, the target operator graph group includes multiple first operator graphs, each first operator graph is configured with running demand information, and there is a temporal relationship between the multiple first operator graphs in the target operator graph group.

[0122] S440, for the current processing time period, select the current operator graph from the first operator graphs to be assigned in the target operator graph group.

[0123] S450, if it is determined that the running data of the current operator graph within the running time period of the current processing meets the performance conditions, then the running time period of the current processing is determined as the running time period of the current operator graph to be run in the many-core system.

[0124] S460, return to the operation of selecting the current operator graph in each of the first operator graphs to be assigned in the target operator graph group, until it is determined that the current operator graph does not meet the performance conditions.

[0125] S470, if it is determined that the current operator graph does not meet the performance conditions, and / or it is determined that there are no remaining core resources other than the target core resources, then the verification operation of the target operator graph group for the current processing time period ends, until a matching running time period is allocated to all demand operator graphs within the running cycle.

[0126] S480, based on the core resources that can be allocated by the many-core system and the core resources already allocated for the current processing time period, determine the remaining core resources for the current processing time period.

[0127] Allocable core resources are the cores that the many-core system can allocate to operator graph computation. The core resources already allocated for the current processing runtime refer to the sum of the target core resources for the first operator graph running in the current processing runtime. Remaining core resources refer to the core resources that can be allocated to a new first operator graph allocated for the current processing runtime. Remaining core resources equal the difference between the allocable core resources and the core resources already allocated for the current processing runtime.

[0128] S490, in the remaining core resources of the current processing runtime, according to the resource allocation type, allocate target core resources to the current operator graph that meets the performance conditions; wherein, the running data of the demand operator graph in the allocated runtime satisfies the running demand information under the running cycle.

[0129] At this point, the current operator graph that meets the performance conditions refers to the new first operator graph running during the current processing time period.

[0130] This invention provides an accurate, flexible and controllable core resource allocation method by calculating the remaining core resources and allocating core resources to the current operator graph that meets the performance conditions. This method can accurately allocate resources to the first operator graph newly allocated during the current processing time period, and can accurately allocate time resources and core resources to the first operator graph.

[0131] Optionally, the resource allocation type includes high-performance type, energy-saving type, or balanced type.

[0132] High-performance resource allocation methods can be understood as maximizing chip computing performance. Throughput, timing, and serial-parallel scheduling are all configured to maximize the utilization of core computing power. Performance can be expressed as chip computing performance. Energy-saving resource allocation methods can be understood as maintaining extreme energy efficiency under certain performance conditions. In this case, power loss due to frequent data transfer becomes a constraint, so data transfer should be minimized. Related scheduling instructions, core computing, throughput, latency, timing, and serial-parallel relationships are all configured to reduce the amount of data transferred over a period of time to meet the power reduction requirements under certain performance conditions. Balanced allocation can be seen as an intermediate type between the two, aiming to obtain the optimal power consumption ratio under certain conditions. It requires comprehensive consideration of the above factors and a measurement of the core computing power and data transfer scheduling power consumption of the above resource allocation methods to obtain the optimal energy consumption ratio. The energy consumption ratio is used to evaluate the ratio of performance to power consumption.

[0133] In this scenario, the on-chip storage space is greater than or equal to the space occupied by the operator graph set. In this case, the on-chip storage can hold the data associated with that operator graph set, and all operator graphs can form an operator graph group, reducing the impact of data movement on chip computing performance. Any of the high-performance, energy-saving, or balanced resource allocation methods can be used to achieve this.

[0134] If the on-chip storage space is smaller than the space occupied by the operator graph set, then the on-chip storage can hold a portion of the operator graphs associated with that set. This portion of the operator graphs constitutes an operator graph group. After the operator graphs in the operator graph group have finished running, the remaining data needs to be moved to the on-chip storage to run the remaining operator graphs, requiring data transfer. In this case, it is incompatible with the energy-saving resource allocation method. Therefore, when the on-chip storage space is smaller than the space occupied by the operator graph set, the energy-saving resource allocation method is not configured.

[0135] By configuring resource allocation types and the application scenarios applicable to each resource allocation type, resource allocation methods can be flexibly configured, and the flexibility of resource allocation methods can be improved to adapt to the application scenarios of the chip's executable operator graph, thereby increasing the rationality of resource allocation.

[0136] Optionally, the resource allocation type includes: high-performance type; the allocation of target core resources to the current operator graph that meets the performance conditions in the remaining core resources of the current processing runtime according to the resource allocation type includes: in the remaining core resources of the current processing runtime, determining the target core resources that meet the fastest processing speed condition for the current operator graph that meets the performance conditions through a bisection method.

[0137] The binary search method refers to repeatedly dividing a resource range in half until it is narrowed down to a specific core resource, ensuring that the running operator graph meets the fastest processing speed condition. This fastest processing speed condition identifies the target core resource that yields the best performance. It specifies that when the operator graph is run with a certain number of core resources, its processing speed is faster than when run with any other core resource. The fastest processing speed condition can be that running the operator graph with the target core resource results in the fastest chip processing speed for that operator graph.

[0138] For example, multiple core resources can be identified within the core resources. For instance, there may be four core resources, and the number of cores in a core resource can be 1, 2, 3, or 4. The target core resource that satisfies the condition of fastest processing speed indicates that, compared to other core resources, the chip processes the operator graph fastest when using this target core resource.

[0139] By identifying the core resources that meet the conditions for the fastest processing speed as the target core resources, the core resources that meet the operational requirements for high performance can be accurately determined, thereby maximizing the chip's computing performance and satisfying the resource allocation method for high performance types.

[0140] Optionally, determining the target core resources that satisfy the condition of the fastest processing speed of the current operator graph using the binary search method includes: determining a range of core quantities based on the current remaining core resources and a preset minimum core resource, and calculating the median of the core quantity range, where the current remaining core resources, the minimum core resource, and the median are all integers; running the current operator graph using the current remaining core resources, the minimum core resource, and the median respectively, eliminating the slowest processing quantities, and determining the remaining two quantities as target quantities; redetermining the median and target quantities based on the two target quantities until there is no median within the core quantity range, and determining the fastest processing quantity within the current core quantity range as the target core resources that satisfy the condition of the fastest processing speed of the current operator graph.

[0141] The current remaining core resources can be understood as the core resources that can be allocated to the current operator graph. In some optional embodiments, the current remaining core resources are the maximum number of core resources that can be allocated to the current operator graph. The minimum core resources are the minimum number of core resources that can be allocated to the current operator graph; for example, the minimum core resource is 1 core resource. When the current remaining core resources are equal to the minimum core resources, the number of core resources with the fastest processing speed is either the current remaining core resources or the minimum core resources, which is the target core resource of the current operator graph. If the current remaining core resources are greater than or equal to the minimum core resources, the current remaining core resources and the minimum core resources determine the core quantity range. This means that the current remaining core resources and the minimum core resources are respectively the endpoints of the core quantity range, with the current remaining core resources being the upper limit of the core quantity range in the bisection method, and the minimum core resources being the lower limit of the core quantity range in the bisection method. The median of the core quantity range in the bisection method can refer to the median between the current remaining core resources and the minimum core resources.

[0142] The current operator graph is run using three different amounts of core resources. The slowest processing quantity is removed, and the two remaining quantities are the two fastest processing quantities, which are then determined as the target quantities. The core quantity range is redefined based on these two target quantities. The larger of the two target quantities is taken as the upper limit of the redefined core quantity range, and the smaller of the two target quantities is taken as the lower limit of the redefined core quantity range. Optionally, the target quantities can be the sum of the current remaining core resources and the median, or the sum of the minimum core resources and the median. This results in a redefined core quantity range smaller than the range determined by the current remaining core resources and the minimum core resources, thus narrowing the core quantity range. If there is no integer median within the core quantity range, it means there are no integers between the two endpoints of the current core quantity range; in this case, the two endpoints are adjacent integers. The fastest processing quantity among the two endpoints is then selected as the target core resource.

[0143] For example, the resource range corresponding to a core resource can be the range of core quantities between 1 (or 0) and the core quantity corresponding to the core resource. Since a core is the smallest allocatable core resource unit and cannot be further divided, the core quantity can only take integer values. The resource range is continuously narrowed using a binary search method, and the quantity with the fastest processing speed is determined as the target core resource that satisfies the condition of the fastest processing speed of the current operator graph. This can be achieved by: presetting a second quantity, such as 0 or 1; setting the core quantity corresponding to the core resource as the first quantity; and using the median of the core quantity range determined by the first and second quantities as the third quantity. The operator graph group is then run using the first, second, and third quantities respectively, selecting the two quantities with the fastest processing speed, redetermining the resource range, and redetermining the two ends of the resource range as the first quantity (upper limit) and the second quantity (lower limit), and using the median of the redetermined resource range as the third quantity. The operator graph group is then run using the three quantities respectively, selecting the two quantities with the fastest processing speed, and redetermining the resource range again. This process is repeated until the resource range includes at most two quantities, and the quantity with the fastest processing speed is taken as the target core resource that satisfies the condition of the fastest processing speed of the current operator graph. At this point, the fastest processing quantity among the two quantities is also the fastest processing quantity within the initial resource range corresponding to the core resource.

[0144] For example, first allocate 1 core, 1 / 2 of all cores (round up if not an integer), and all cores respectively to determine the processing speed of the operator graph group. For instance, if the processing speed of 1 / 2 of all cores and all cores is faster than that of 1 core, then a number can be selected between 1 / 2 of all cores and all cores, such as 3 / 4 of all cores, to determine the processing speed. This process continues until the target number of cores that is fastest to process the above multiple operator graphs is determined.

[0145] Furthermore, regardless of whether the on-chip storage can hold the data associated with the operator graph group, the target core resource matching the maximum processing speed can be determined using the binary search method.

[0146] By using the bisection method, the operating cost of running operator graph groups one by one can be reduced, the target core resources can be quickly determined, the determination cost of target core resources can be reduced, and the determination efficiency of target core resources can be improved.

[0147] Optionally, the resource allocation type includes: energy-saving type; the allocation of target core resources to the current operator graph that meets the performance conditions based on the resource allocation type in the remaining core resources of the current processing runtime includes: calculating the minimum sub-core resource corresponding to the current operator graph that meets the performance conditions; accumulating resources at least once in the corresponding minimum sub-core resource to obtain at least one candidate sub-core resource, wherein the candidate sub-core resource is less than or equal to the remaining core resources of the current processing runtime; selecting the candidate sub-core resource that meets the condition of fastest reduction in processing time from each candidate sub-core resource, and determining it as the target core resource of the current operator graph that meets the performance conditions.

[0148] In energy-saving resource allocation methods, the number of data transfers is minimized. In this case, on-chip storage can hold all the operator graphs to be run. The minimum sub-core resource can be the minimum core resource allocated to the current operator graph while meeting its operational requirements.

[0149] For example, the minimum sub-core resource of the current operator graph is determined as follows: based on the occupied space of the operator graph set (such as the size of the total configuration data) and the core storage size of the current operator graph, the quotient of the occupied space divided by the storage size of the current operator graph is calculated, and the smallest integer greater than or equal to the quotient is determined as the minimum sub-core resource corresponding to the current operator graph.

[0150] A candidate sub-core resource refers to the number of cores greater than the minimum sub-core resource and less than or equal to the remaining core resources. The minimum sub-core resource can be copied, and the same resource can be added multiple times to each minimum sub-core resource to obtain different candidate sub-core resources. For example, adding a set number of resources once results in one candidate sub-core resource, and adding the set number of resources twice results in another candidate sub-core resource. Different candidate sub-core resources have different numbers of cores. For example, by gradually increasing resources on the minimum core resource, multiple candidate sub-core resources can be obtained. For instance, if the minimum core resource has 3 cores, gradually adding 1 core will result in 4, 5, 6, and 7 cores, all of which can be used as candidate sub-core resources.

[0151] The core resource that achieves the fastest reduction in processing time for the current operator graph is selected based on this condition. For example, a curve showing the relationship between the number of cores and processing time can be established. The core resource with the fastest reduction in processing time identified within this curve is then designated as the target core resource.

[0152] In some optional embodiments, in the energy-saving resource allocation method, based on the total configuration data size of the operator graph set and the size of the on-chip storage, it is determined whether the on-chip storage can accommodate the total configuration of all operator graphs in the operator graph set. If it can, the target core resource under the energy-saving resource allocation method is determined. The target core resource determined by the energy-saving method is the minimum number of cores required without disassembling the configuration information of the operator graph set.

[0153] By identifying the candidate sub-core resources that minimize processing time as the target core resources, the core resources that meet the energy-saving operation requirements can be accurately determined, thereby minimizing chip power consumption and satisfying the energy-saving resource allocation method.

[0154] Optionally, the step of accumulating resources at least once in the corresponding minimum sub-core resources to obtain at least one candidate sub-core resource, and selecting the candidate sub-core resource that meets the condition of fastest reduction in processing time from each candidate sub-core resource, and determining it as the target core resource of the current operator graph that meets the performance conditions, includes: accumulating unit resources in the minimum sub-core resources to obtain candidate sub-core resources; running the current operator graph using the candidate sub-core resources and the minimum sub-core resources respectively, and obtaining the matching processing time; calculating the matching processing time of the candidate sub-core resources. The difference between the processing time of the current sub-core resource and the processing time of the minimum sub-core resource is determined as the reduction value of the processing time of the candidate sub-core resource. The unit resource is then added to the minimum sub-core resource to obtain the next candidate sub-core resource, and the reduction value of the processing time of the next candidate sub-core resource is calculated until the difference between the reduction values ​​of the processing time of two adjacent candidate sub-core resources is less than a set threshold. Among the two adjacent candidate sub-core resources, the candidate sub-core resource with the larger number of resources is determined as the candidate sub-core resource that meets the condition of the fastest reduction in processing time.

[0155] Each accumulation can increase the set unit quantity, such as 10% or 20% of the core resources. The processing time for core resource matching refers to the time required to run the current operator graph using that core resource and calculate the set input data. The processing time reduction value is used to evaluate the extent to which the processing time decreases as the core resources increase. The processing time reduction value can be negative, representing an increase in processing time as the core resources increase.

[0156] Continuing to accumulate resources within the minimum core resource means adding resources on top of those already accumulated. This means the number of candidate sub-core resources gradually increases, and in the generation sequence, the next candidate sub-core resource is greater than the previous one. If the difference in processing time reduction between two adjacent candidate sub-core resources in the generation sequence is less than a set threshold, it indicates a significant reduction in processing time as core resources increase. The candidate sub-core resource with the largest number of resources can be identified as the one that satisfies the condition of the fastest reduction in processing time. The candidate sub-core resource with the largest number of resources is the next candidate sub-core resource in the generation sequence.

[0157] By accumulating resources multiple times within the minimum core resource, multiple candidate sub-core resources are obtained. During the accumulation process, candidate sub-core resources with a sharp reduction in processing time are queried and identified as those that meet the condition of the fastest reduction in processing time. This reduces the running cost of running operator graph groups for each candidate sub-core resource, quickly determines the target core resource, lowers the cost of determining the target core resource, and improves the efficiency of determining the target core resource.

[0158] Optionally, the resource allocation type includes: a balanced type; the step of allocating target core resources to the current operator graph that meets the performance conditions from the remaining core resources in the current processing runtime, according to the resource allocation type, includes: determining at least one sub-core resource corresponding to the current operator graph that meets the performance conditions from the remaining core resources in the current processing runtime, wherein the number of each sub-core resource is less than or equal to the number of remaining core resources in the current processing runtime; and calculating the energy consumption ratio matched by each sub-core resource according to the following formula:

[0159]

[0160] The sub-core resource that matches the maximum energy consumption ratio is determined as the target core resource of the current operator graph that meets the performance conditions.

[0161] In this context, "balanced allocation" refers to the resource allocation method that yields the best computational performance per unit of power consumption. Sub-core resources are the number of cores less than or equal to the remaining core resources; the number of cores varies between different sub-core resources. Determining the target core resource can be achieved by finding the target core resource that maximizes the energy efficiency ratio of the current operator graph. The variable in the formula is the core resource itself. Different core resources are used to calculate the energy efficiency ratio of the current operator graph, and the core resource with the highest energy efficiency ratio is selected as the target core resource for that current operator graph.

[0162] Energy efficiency ratio (EER) represents computational performance per unit of power consumption. The processing time of core resources multiplied by their computational speed is used to evaluate computational load, while the power consumption for data transfer plus the power consumption for core resource computation is used to evaluate overall power consumption. The processing time of core resources multiplied by their computational speed equals the product of the core's clock speed and the power consumption of the sub-core resources. The power consumption for data transfer is calculated by considering the space occupied by the data associated with the operator graph group, the bandwidth, and the power consumption required for data transfer per unit time. For example, dividing the space occupied by the bandwidth yields the transfer time, and the product of the transfer time and the power consumption required for data transfer per unit time is the power consumption for data transfer. The power consumption for core resource computation is calculated by considering the computational load, sub-core resources, and the power consumption required for computation per unit time. For example, dividing the computational load by the sub-core resources yields the computation time, and the product of the computation time and the power consumption required for computation per unit time is the power consumption for core resource computation. The power consumption required for data transfer and computation per unit time are related to the hardware of the many-core system and can be determined experimentally.

[0163] Therefore, the energy consumption ratio formula only has the variable of sub-core resources. By inputting multiple sub-core resources into the formula, multiple energy consumption ratios can be obtained. The largest energy consumption ratio can be selected from these, and the sub-core resource used as input can be determined as the target core resource.

[0164] By identifying the sub-core resource with the highest energy consumption ratio as the target core resource, the core resources that meet the balance requirements can be accurately determined, thereby maximizing the computing performance per unit power consumption of the chip and satisfying the resource allocation method of the balance type.

[0165] Example 5

[0166] Figure 5 This is a schematic diagram of a resource allocation device for an operator graph according to Embodiment 5 of the present invention. Embodiment 2 is a corresponding device for implementing the resource allocation method for an operator graph provided in the above embodiments of the present invention. This device can be implemented in software and / or hardware, and can generally be integrated into computer equipment, such as many-core systems.

[0167] The demand operator graph acquisition module 510 is used to acquire demand operator graphs with configuration of running demand information from the set of operator graphs to be run on the many-core system.

[0168] The running time period allocation module 520 is used to divide the running cycle into multiple running time periods and allocate running time periods to each of the demand operator graphs according to the running demand information of each demand operator graph.

[0169] The target core resource allocation module 530 is used to determine the target core resources for running each demand operator graph in each running time period based on the resource allocation type and the running demand information of each demand operator graph; wherein, the running data of the demand operator graph in the allocated running time period satisfies the running demand information under the running cycle.

[0170] This invention addresses the problem in related technologies where full resource allocation for each operator graph leads to wasted core resources. By allocating runtime periods to demanding operator graphs and determining the target core resources for each graph to run within those periods, this invention provides a method for allocating time and core resources. This method allows demanding operator graphs to run in a time-sharing manner and allocates appropriate core resources to meet runtime requirements. This enables the rational allocation of resources required by the operator graphs and targeted resource allocation, thereby improving resource utilization and reducing waste.

[0171] Furthermore, the running time period allocation module 520 includes: a cyclic allocation time period unit, used to alternately execute the operation of dividing a running time period within the running cycle, and to determine the operation of each target demand operator graph running within the divided running time period according to the running demand information of each demand operator graph to be allocated, until a matching running time period is allocated to all demand operator graphs within the running cycle.

[0172] Furthermore, the cyclic allocation time period unit includes: a running demand information conversion calculation subunit, used to determine each target demand operator graph running in the divided running time period based on the segment demand information obtained by converting the running demand information of the currently to-be-allocated demand operator graph into the divided running time period, and the running data of the currently to-be-allocated demand operator graph in the divided running time period.

[0173] Furthermore, the running time period allocation module 520 includes: a running time period division unit, used to divide the first running time period within the running cycle according to the time start point of the running cycle and a preset duration; or to divide the currently to-be-allocated demand operator graphs to determine the number of groups formed by the division; to determine the remaining duration according to the running cycle and the duration corresponding to each of the divided running time periods; to divide the remaining duration according to the number of groups to obtain the sub-durations; and to divide a running time period within the running cycle according to the end point of the last running time period in the time sequence and the sub-durations.

[0174] Furthermore, the cyclic allocation time period unit includes: a target operator graph group determination subunit, used to determine whether each of the currently to-be-allocated demand operator graphs includes a target operator graph group, wherein the target operator graph group includes multiple first operator graphs, each first operator graph is configured with running requirement information, and there is a temporal relationship between the multiple first operator graphs in the target operator graph group; when it is determined that a target operator graph group exists, the running time period of each first operator graph in the target operator graph group to be run in the many-core system is determined according to the running requirement information of each first operator graph in the target operator graph group.

[0175] Furthermore, the target operator graph group determination subunit can be used to: select the current operator graph from the currently assigned first operator graphs in the target operator graph group for the current processing runtime; if it is determined that the running data of the current operator graph meets the performance conditions within the current processing runtime, then the current processing runtime is determined as the runtime to be run for the current operator graph in the many-core system; return to the operation of selecting the current operator graph from the currently assigned first operator graphs in the target operator graph group until it is determined that the current operator graph does not meet the performance conditions; if it is determined that the current operator graph does not meet the performance conditions, and / or it is determined that there are no remaining core resources other than the target core resources, then the verification of the target operator graph group for the current processing runtime ends.

[0176] Furthermore, the device also includes: a second operator graph resource allocation module, used to determine a second operator graph from the demand operator graph when it is determined that there are remaining core resources other than the target core resources for any given running time period, so as to determine the core resources for running the second operator graph based on the remaining core resources, wherein the second operator graph has no temporal relationship with any operator graph.

[0177] Furthermore, the device also includes: a demand-free operator graph resource allocation module, used to determine a demand-free operator graph from the operator graph set for any given running time period when it is determined that there are remaining core resources other than the target core resources, so as to determine the core resources for running the demand-free operator graph based on the remaining core resources, wherein the demand-free operator graph is not configured with running requirement information.

[0178] Furthermore, the no-demand operator graph resource allocation module includes: a no-demand or no-timing operator graph allocation unit, used to determine that the third operator graph is a no-demand operator graph when there is at least one third operator graph, wherein the third operator graph has no configured runtime requirement information and has a timing relationship with at least one operator graph; and to determine that the fourth operator graph is a no-demand operator graph when there is no third operator graph or when the determination of each third operator graph is completed, the current remaining core resources are not empty, and there is at least one fourth operator graph, wherein the fourth operator graph has no configured runtime requirement information and has no timing relationship with any operator graph.

[0179] Furthermore, the target core resource allocation module 530 includes: a remaining core determination unit, used to determine the remaining core resources of the current processing time period based on the core resources that can be allocated by the many-core system and the core resources already allocated during the current processing time period; and to allocate target core resources to the current operator graph that meets the performance conditions from the remaining core resources of the current processing time period according to the resource allocation type.

[0180] Furthermore, the resource allocation type includes: high-performance type; the remaining core determination unit includes a high-performance allocation subunit, which is used to determine the target core resource that satisfies the fastest processing speed condition among the remaining core resources in the current processing runtime period, using a binary search method, for the current operator graph that meets the performance conditions.

[0181] Furthermore, the resource allocation type includes: energy-saving type; the remaining core determination unit includes an energy-saving allocation subunit, used to calculate the minimum sub-core resource corresponding to the current operator graph that meets the performance conditions; accumulate resources at least once in the corresponding minimum sub-core resource to obtain at least one candidate sub-core resource, the candidate sub-core resource being less than or equal to the remaining core resources of the current processing time period; and select the candidate sub-core resource that meets the condition of fastest reduction in processing time from each of the candidate sub-core resources, and determine it as the target core resource of the current operator graph that meets the performance conditions.

[0182] Furthermore, the resource allocation type includes: a balanced type; the remaining core determination unit includes a balanced allocation subunit, used to determine at least one sub-core resource corresponding to the current operator graph that meets the performance conditions from the remaining core resources of the current processing runtime, wherein the number of each sub-core resource is less than or equal to the number of remaining core resources of the current processing runtime; and to calculate the energy consumption ratio matched by each sub-core resource according to the following formula:

[0183]

[0184] The sub-core resource that matches the maximum energy consumption ratio is determined as the target core resource of the current operator graph that meets the performance conditions.

[0185] The image generation apparatus described above can execute the resource allocation method of the operator graph provided in any of the embodiments of the present invention, and has the corresponding functional modules and beneficial effects of the executed image generation method.

[0186] Example 6

[0187] Figure 6 This is a schematic diagram of the structure of a computer device provided in Embodiment Six of the present invention. Figure 6 A block diagram of an exemplary computer device 12 suitable for implementing embodiments of the present invention is shown. Figure 6 The computer device 12 shown is merely an example and should not impose any limitation on the functionality and scope of use of the embodiments of the present invention.

[0188] like Figure 6 As shown, the computer device 12 is represented in the form of a general-purpose computing device. Components of the computer device 12 may include, but are not limited to: one or more processors or processing units 16, system memory 28, and a bus 18 connecting different system components (including system memory 28 and processing units 16). The computer device 12 may be a device connected to a bus.

[0189] Bus 18 represents one or more of several bus architectures, including a memory bus or memory controller, a peripheral bus, a graphics acceleration port, a processor, or a local bus using any of the various bus architectures. Examples of these architectures include, but are not limited to, the Industry Standard Architecture (ISA) bus, the Micro Channel Architecture (MCA) bus, the Enhanced ISA bus, the Video Electronics Standards Association (VESA) local bus, and the Peripheral Component Interconnect (PCI) bus.

[0190] Computer device 12 typically includes a variety of computer system readable media. These media can be any available media that can be accessed by computer device 12, including volatile and non-volatile media, removable and non-removable media.

[0191] System memory 28 may include computer system readable media in the form of volatile memory, such as random access memory (RAM) 30 and / or cache memory 32. Computer device 12 may further include other removable / non-removable, volatile / non-volatile computer system storage media. By way of example only, storage system 34 may be used to read and write non-removable, non-volatile magnetic media (…). Figure 6 Not shown; optional, referred to as "hard drive mechanic"). Although Figure 6 Not shown, a disk drive may be provided for reading and writing to removable non-volatile disks (e.g., "floppy disks"), and an optical disc drive may be provided for reading and writing to removable non-volatile optical discs (e.g., compact disc read-only memory (CD-ROM), digital video disc read-only memory (DVD-ROM), or other optical media). In these cases, each drive may be connected to bus 18 via one or more data media interfaces. System memory 28 may include at least one program product having a set (e.g., at least one) of program modules configured to perform the functions of the embodiments of the present invention.

[0192] A program / utility 40 having a set (at least one) of program modules 42 may be stored, for example, in system memory 28. Such program modules 42 include—but are not limited to—an operating system, one or more application programs, other program modules, and program data. Each or some combination of these examples may include an implementation of a network environment. Program modules 42 may optionally perform the functions and / or methods described in the embodiments of the present invention.

[0193] Computer device 12 can also communicate with one or more external devices 14 (e.g., keyboard, pointing device, display 24, etc.), and with one or more devices that enable a user to interact with the computer device 12, and / or with any device that enables the computer device 12 to communicate with one or more other computing devices (e.g., network card, modem, etc.). This communication can be performed via input / output (I / O) interface 22. Furthermore, computer device 12 can also communicate with one or more networks (e.g., local area network (LAN) or wide area network (WAN)) via network adapter 20. As shown, network adapter 20 communicates with other modules of computer device 12 via bus 18. It should be understood that although... Figure 6As not shown, other hardware and / or software modules may be used in conjunction with computer device 12, including but not limited to: microcode, device movers, redundant processing units, external disk RAID (Redundant Arrays of Inexpensive Disks) systems, tape movers, and data backup storage systems.

[0194] The processing unit 16 executes various functional applications and data processing by running programs stored in the system memory 28, such as implementing a resource allocation method for an operator graph provided in any embodiment of the present invention.

[0195] Example 7

[0196] Embodiment 7 of the present invention provides a computer-readable storage medium storing a computer program thereon, which, when executed by a processor, implements the resource allocation method for operator graphs as provided in all embodiments of the present application:

[0197] That is, when the program is executed by the processor, it performs the following: In the set of operator graphs to be run on the many-core system, it obtains demand operator graphs configured with running requirement information; it divides the running cycle into multiple running time periods, and allocates running time periods to each demand operator graph according to the running requirement information of each demand operator graph; based on the resource allocation type and the running requirement information of each demand operator graph, it determines the target core resources used to run each demand operator graph within each running time period; wherein, the running data of the demand operator graph within the allocated running time period satisfies the running requirement information under the running cycle.

[0198] The computer storage medium of this invention can be any combination of one or more computer-readable media. The computer-readable medium can be a computer-readable signal medium or a computer-readable storage medium. For example, a computer-readable storage medium can be—but is not limited to—an electrical, magnetic, optical, electromagnetic, infrared, or semiconductor system, apparatus, or device, or any combination thereof. More alternative examples of computer-readable storage media (a non-exhaustive list) include: an electrical connection having one or more wires, a portable computer disk, a hard disk, RAM, read-only memory (ROM), erasable programmable read-only memory (EPROM), flash memory, optical fiber, portable CD-ROM, optical storage device, magnetic storage device, or any suitable combination thereof. In this document, a computer-readable storage medium can be any tangible medium that contains or stores a program that can be used by or in conjunction with an instruction execution system, apparatus, or device.

[0199] Computer-readable signal media may include data signals propagated in baseband or as part of a carrier wave, carrying computer-readable program code. Such propagated data signals may take various forms, including—but not limited to—electromagnetic signals, optical signals, or any suitable combination thereof. Computer-readable signal media may also be any computer-readable medium other than computer-readable storage media, capable of transmitting, propagating, or transmitting programs for use by or in connection with an instruction execution system, apparatus, or device.

[0200] Program code contained on a computer-readable medium may be transmitted using any suitable medium, including—but not limited to—wireless, wire, optical fiber, radio frequency (RF), etc., or any suitable combination thereof.

[0201] Computer program code for performing the operations of this invention can be written in one or more programming languages ​​or a combination thereof, including object-oriented programming languages ​​such as Java, Smalltalk, and C++, and conventional procedural programming languages ​​such as "C" or similar languages. The program code can be executed entirely on the user's computer, partially on the user's computer, as a standalone software package, partially on the user's computer and partially on a remote computer, or entirely on a remote computer or server. In cases involving remote computers, the remote computer can be connected to the user's computer via any type of network—including LANs or WANs—or can be connected to an external computer (e.g., via the Internet using an Internet service provider).

[0202] Note that the above description is merely a preferred embodiment of the present invention and the technical principles employed. Those skilled in the art will understand that the present invention is not limited to the specific embodiments described herein, and various obvious changes, readjustments, and substitutions can be made without departing from the scope of protection of the present invention. Therefore, although the present invention has been described in detail through the above embodiments, the present invention is not limited to the above embodiments, and may include many other equivalent embodiments without departing from the concept of the present invention, the scope of which is determined by the scope of the appended claims.

Claims

1. A method for resource allocation of an operator graph, characterized in that, Applied to a many-core system including allocable core resources, the method comprises: In a set of operator graphs to be run on the many-core system, obtaining demanded operator graphs configured with running demand information; Dividing a running period into multiple running time periods, and allocating running time periods to each of the demanded operator graphs according to the running demand information of each of the demanded operator graphs; According to the resource allocation type and the running demand information of each of the demanded operator graphs, determining target core resources for running each of the demanded operator graphs in each running time period; Wherein, the running data of the demanded operator graphs in the allocated running time period meets the running demand information under the running period; For any running time period, when it is determined that there are remaining core resources other than the target core resources, a non-demanded operator graph is determined from the set of operator graphs to determine core resources for running the non-demanded operator graph according to the remaining core resources, wherein the non-demanded operator graph is not configured with running demand information.

2. The method of claim 1, wherein, The dividing of the running period into multiple running time periods, and the allocation of running time periods to each of the demanded operator graphs according to the running demand information of each of the demanded operator graphs, comprises: Alternately performing the operation of dividing one running time period in the running period, and the operation of determining each target demanded operator graph running in the divided running time period according to the running demand information of each demanded operator graph currently to be allocated, until all demanded operator graphs are allocated matching running time periods in the running period.

3. The method of claim 2, wherein, The operation of determining each target demanded operator graph running in the divided running time period according to the running demand information of each demanded operator graph currently to be allocated, comprises: According to the segment demand information obtained by converting the running demand information of the demanded operator graph currently to be allocated to the divided running time period, and the running data of the demanded operator graph currently to be allocated in the divided running time period, determining each target demanded operator graph running in the divided running time period.

4. The method of claim 2, wherein, The operation of dividing one running time period in the running period, comprises: In the running period, according to the time start point of the running period and the preset time length, dividing a first running time period in the running period; or Dividing the current to-be-allocated demanded operator graphs to determine the number of groups formed by the division; According to the running period and the time length corresponding to each of the divided running time periods, determining a remaining time length; According to the number of groups, dividing the remaining time length to obtain a division time length; According to the end point of the running time period at the end of the time sequence in the running period and the division time length, dividing one running time period in the running period.

5. The method of claim 2, wherein, The operation of determining each target demanded operator graph running in the divided running time period according to the running demand information of each demanded operator graph currently to be allocated, comprises: In each of the current to-be-allocated demand operator graph, determine whether the target operator graph group is included in each of the current to-be-allocated demand operator graph, the target operator graph group includes a plurality of first operator graphs, each first operator graph is configured with running requirement information, and there is a time sequence relationship between the plurality of first operator graphs in the target operator graph group; When it is determined that the target operator graph group exists, according to the running requirement information of each first operator graph in the target operator graph group, the running time period of each first operator graph in the target operator graph group to be run in the many-core system is determined.

6. The method of claim 5, wherein, According to the running requirement information of each first operator graph in the target operator graph group, the running time period of each first operator graph in the target operator graph group to be run in the many-core system is determined. For the current processing running time period, in each of the first operator graph to be allocated in the target operator graph group, a current operator graph is selected; If it is determined that the running data of the current operator graph in the current processing running time period meets the performance condition, the current processing running time period is determined as the running time period of the current operator graph to be run in the many-core system; Return to perform the operation of selecting a current operator graph in each of the first operator graph to be allocated in the target operator graph group until it is determined that the current operator graph does not meet the performance condition; If it is determined that the current operator graph does not meet the performance condition, and / or it is determined that there is no remaining core resource except the target core resource, the verification of the target operator graph group for the current processing running time period is ended.

7. The method of claim 5, wherein, The method further comprises: For any running time period, when it is determined that there is a remaining core resource except the target core resource, a second operator graph is determined from the demand operator graph to determine the core resource for running the second operator graph according to the remaining core resource, wherein the second operator graph has no time sequence relationship with any operator graph.

8. The method of claim 1, wherein, The determining of the demandless operator graph from the operator graph set comprises: When there is at least one third operator graph, the third operator graph is determined as a demandless operator graph, the third operator graph is not configured with running requirement information, and has a time sequence relationship with at least one operator graph; When there is no third operator graph or each of the third operator graphs is determined, the current remaining core resource is not empty, and there is at least one fourth operator graph, the fourth operator graph is determined as a demandless operator graph, the fourth operator graph is not configured with running requirement information, and has no time sequence relationship with any operator graph.

9. The method of claim 6, wherein, According to the resource allocation type and the running requirement information of each of the demand operator graph, the target core resource for running each of the demand operator graph in each running time period is determined, comprising: According to the core resource that can be allocated by the many-core system, and the core resource that has been allocated in the current processing running time period, the remaining core resource of the current processing running time period is determined; In the remaining core resource of the current processing running time period, according to the resource allocation type, the target core resource is allocated to the current operator graph that meets the performance condition.

10. The method of claim 9, wherein, The resource allocation type includes a high-performance type. The allocating the target core resource for the current operator graph satisfying the performance condition in the remaining core resource of the current processing runtime period according to the resource allocation type includes: The allocating the target core resource for the current operator graph satisfying the performance condition in the remaining core resource of the current processing runtime period according to the resource allocation type includes:

11. The method of claim 9, wherein, The resource allocation type includes an energy-saving type. The allocating the target core resource for the current operator graph satisfying the performance condition in the remaining core resource of the current processing runtime period according to the resource allocation type includes: The allocating the target core resource for the current operator graph satisfying the performance condition in the remaining core resource of the current processing runtime period according to the resource allocation type includes: The allocating the target core resource for the current operator graph satisfying the performance condition in the remaining core resource of the current processing runtime period according to the resource allocation type includes: The resource allocation type includes a balanced type.

12. The method of claim 9, wherein, The allocating the target core resource for the current operator graph satisfying the performance condition in the remaining core resource of the current processing runtime period according to the resource allocation type includes: The allocating the target core resource for the current operator graph satisfying the performance condition in the remaining core resource of the current processing runtime period according to the resource allocation type includes: The allocating the target core resource for the current operator graph satisfying the performance condition in the remaining core resource of the current processing runtime period according to the resource allocation type includes: The allocating the target core resource for the current operator graph satisfying the performance condition in the remaining core resource of the current processing runtime period according to the resource allocation type includes: The device is configured in a many-core system including allocatable core resources, and is used to execute the resource allocation method of the operator graph in any one of claims 1-12, and the device includes: A demand operator graph obtaining module is configured to obtain demand operator graphs with running demand information from a set of operator graphs to be run in a many-core system.

13. An apparatus for resource allocation of an operator graph, the apparatus comprising: A runtime period allocation module is configured to divide a running cycle into multiple runtime periods and allocate runtime periods to the demand operator graphs according to running demand information of the demand operator graphs. A target core resource allocation module is configured to determine target core resources for running the demand operator graphs in each runtime period according to resource allocation types and running demand information of the demand operator graphs; wherein running data of the demand operator graphs in the allocated runtime periods meets the running demand information in the running cycle. The processor implements the resource allocation method of the operator graph in any one of claims 1-12 when executing the program. The processor implements the resource allocation method of the operator graph in any one of claims 1-12 when executing the program.

14. A computer device comprising a memory, a processor, and a computer program stored on the memory and executable on the processor, characterized in that, ​ 15. A computer readable storage medium having stored thereon a computer program, characterized in that, The program, when executed by the processor, implements the resource allocation method of the operator graph according to any one of claims 1-12.

Citation Information

Patent Citations

  • Processing computational graphs

    CN108292241A

  • Resource allocation method and device, computer equipment and storage medium

    CN112068957A

  • A method and system for resource planning

    WO2007090410A1