Resource scheduling method and scheduling device, processing core
By acquiring the load rate and computational overhead of task processing branches, and dynamically scheduling processing resources, the problem of low efficiency in dynamic graph task processing is solved, achieving more efficient resource allocation and task processing.
Patent Information
- Application Number
- CN202210380179.2
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2022-04-12
- Publication Date
- 2025-10-21
- Estimated Expiration
- 2042-04-12
AI Technical Summary
The lack of effective methods for dynamically scheduling processing resources in existing technologies leads to low efficiency in task processing based on dynamic graphs.
By obtaining the current load rate and computational overhead of the task processing branch, processing resources are dynamically scheduled, including determining the number and location of processing cores, in order to optimize resource allocation, reduce imbalances, and improve task processing efficiency.
It effectively reduces the uneven distribution of processing resources and improves the efficiency of task processing based on dynamic graphs.
Smart Images

Figure CN114721802B_ABST
Abstract
Description
Technical Field
[0001] The present disclosure relates to the field of computer technology, and in particular to a resource scheduling method and scheduling device, a processing core, an electronic device, and a computer-readable medium. Background Art
[0002] Deep learning frameworks generally use computational graphs as the primary data structure for describing neural network models. Computational graphs can be further divided into static graphs and dynamic graphs.
[0003] However, in the current task processing process based on dynamic graphs, there is a lack of methods for dynamically scheduling processing resources, resulting in low efficiency of the current task processing process based on dynamic graphs. Summary of the Invention
[0004] The present disclosure provides a resource scheduling method and scheduling device, a processing core, an electronic device, and a computer-readable medium.
[0005] In a first aspect, the present disclosure provides a resource scheduling method, the resource scheduling method comprising:
[0006] Obtain the current load rate and branch computing overhead corresponding to each predetermined task processing branch;
[0007] According to the current load rate and branch calculation overhead corresponding to each task processing branch, processing resources are scheduled for each task processing branch, and the processing resources are used to process the tasks corresponding to the task processing branch.
[0008] In some embodiments, before obtaining the predetermined current load rate and branch computing overhead corresponding to each task processing branch, the following steps are included:
[0009] At least two task processing branches are determined based on a calculation result of the current task processing node on the current input data.
[0010] In some embodiments, the step of scheduling processing resources for each task processing branch based on the current load rate and branch calculation overhead corresponding to each task processing branch includes:
[0011] Determine the branch calculation evaluation parameter according to the product of the current load rate of each task processing branch and the branch calculation overhead;
[0012] Determining the number of processing cores corresponding to each task processing branch based on a branch calculation evaluation parameter of each task processing branch and the number of processing cores schedulable in the many-core system, so that a difference between a maximum resource adjustment measurement parameter and a minimum resource adjustment measurement parameter is less than a preset value; wherein the resource adjustment measurement parameter is a ratio of the branch calculation evaluation parameter of the task processing branch to the number of corresponding processing cores; and the sum of the numbers of processing cores corresponding to each task processing branch is less than or equal to the number of processing cores schedulable in the many-core system;
[0013] Based on the number of processing cores corresponding to each task processing branch, a corresponding number of processing cores are scheduled for each task processing branch to serve as the processing resources corresponding to each task processing branch.
[0014] In some embodiments, the step of scheduling a corresponding number of processing cores for each task processing branch based on the number of processing cores corresponding to each task processing branch includes:
[0015] Determining a plurality of processing core scheduling strategies based on the number of processing cores corresponding to each of the task processing branches; the processing core scheduling strategies including physical location identifiers of the processing cores corresponding to each of the task processing branches;
[0016] For each task processing branch in each processing core scheduling strategy, determine a branch transmission cost parameter corresponding to the task processing branch in the processing core scheduling strategy according to the physical location identifiers of the processing cores corresponding to the task processing branch;
[0017] Determining a total transmission cost parameter corresponding to the processing core scheduling strategy according to the branch transmission cost parameter corresponding to each task processing branch in the processing core scheduling strategy;
[0018] Based on the processing core scheduling strategy with the minimum total transmission cost parameter, the corresponding number of processing cores and corresponding physical location identifiers are scheduled for each of the task processing branches. In some embodiments, the step of determining the branch transmission cost parameter corresponding to the task processing branch in the processing core scheduling strategy based on the physical location identifiers of the processing cores corresponding to the task processing branch includes:
[0019] According to the physical location identifiers of the processing cores corresponding to the task processing branch, obtaining the branch routing transmission cost parameter and the branch data transmission cost parameter corresponding to the task processing branch;
[0020] The branch transmission cost parameter corresponding to the task processing branch is determined according to the sum of the branch routing transmission cost parameter and the branch data transmission cost parameter corresponding to the task processing branch.
[0021] In some embodiments, the step of obtaining the branch routing transmission cost parameter and the branch data transmission cost parameter corresponding to the task processing branch according to the physical location identifier of the processing core corresponding to the task processing branch includes:
[0022] According to the physical location identifiers of the processing cores corresponding to the task processing branch, the transmission distance value between the processing cores corresponding to the task processing branch is obtained;
[0023] Determine the branch routing transmission cost parameter corresponding to the task processing branch according to the transmission distance value between the processing cores corresponding to the task processing branch;
[0024] Obtaining a data read delay corresponding to each processing core corresponding to the task processing branch according to the physical location identifiers of the processing cores corresponding to the task processing branch;
[0025] Based on the data access delay corresponding to each processing core corresponding to the task processing branch, a branch data transmission cost parameter corresponding to the task processing branch is determined.
[0026] In some embodiments, the step of determining a total transmission cost parameter corresponding to the processing core scheduling strategy based on the branch transmission cost parameters corresponding to each task processing branch in the processing core scheduling strategy includes:
[0027] The branch transmission cost parameters corresponding to each task processing branch are weighted and summed to obtain the total transmission cost parameter corresponding to the processing core scheduling strategy.
[0028] In some embodiments, the current load rate corresponding to the task processing branch is obtained by:
[0029] For each task processing branch, the current load rate corresponding to the task processing branch is obtained based on the ratio of the number of times the task processing branch executes the task within the preset time period to the sum of the number of times each task processing branch executes the task.
[0030] In some embodiments, the branch calculation overhead is obtained by:
[0031] For each task processing branch, based on the service flow data and service load characteristics corresponding to the task processing branch within a preset time period, the branch computing overhead corresponding to the task processing branch is obtained.
[0032] In some embodiments, the process of executing any task by the many-core system includes at least one task processing process;
[0033] The obtaining of the current load rate and branch computing overhead corresponding to each predetermined task processing branch includes:
[0034] For any task processing process corresponding to at least two task processing branches, the current load rate and branch computing overhead of each task processing branch corresponding to the task processing process are obtained.
[0035] In a second aspect, the present disclosure provides a resource scheduling device, the resource scheduling device comprising:
[0036] An acquisition module is used to obtain the current load rate and branch computing overhead corresponding to each predetermined task processing branch;
[0037] The scheduling module is used to schedule processing resources for each task processing branch according to the current load rate and branch calculation overhead corresponding to each task processing branch, and the processing resources are used to process the tasks corresponding to the task processing branch.
[0038] In a third aspect, the present disclosure provides a processing core, which includes the above-mentioned resource scheduling device.
[0039] In a fourth aspect, the present disclosure provides an electronic device comprising: a plurality of processing cores; and an on-chip network configured to exchange data between the plurality of processing cores and external data; wherein one or more instructions are stored in one or more of the processing cores, and one or more of the instructions are executed by one or more of the processing cores, so that one or more of the processing cores can execute the above-mentioned resource scheduling method.
[0040] In a fifth aspect, the present disclosure provides a computer-readable medium having a computer program stored thereon, wherein the computer program implements the above-mentioned resource scheduling method when executed by a processing core.
[0041] It should be understood that the content described in this section is not intended to identify the key or important features of the embodiments of the present disclosure, nor is it intended to limit the scope of the present disclosure. Other features of the present disclosure will become easily understood through the following description. BRIEF DESCRIPTION OF THE DRAWINGS
[0042] The accompanying drawings are used to provide a further understanding of the present disclosure and constitute a part of the specification. Together with the embodiments of the present disclosure, they are used to explain the present disclosure and do not constitute a limitation of the present disclosure. The above and other features and advantages will become more apparent to those skilled in the art by describing detailed example embodiments with reference to the accompanying drawings. In the accompanying drawings:
[0043] Figure 1 A flowchart of a resource scheduling method provided in an embodiment of the present disclosure;
[0044] Figure 2 A schematic diagram of a dynamic graph provided in an embodiment of the present disclosure;
[0045] Figure 3 A schematic diagram of the structure of a many-core system provided in an embodiment of the present disclosure;
[0046] Figure 4 A flowchart of a specific implementation of step S102 provided in an embodiment of the present disclosure;
[0047] Figure 5 A flowchart of a specific implementation of step S403 provided in an embodiment of the present disclosure;
[0048] Figure 6 A block diagram of a resource scheduling device provided in an embodiment of the present disclosure;
[0049] Figure 7 A block diagram of the composition of an electronic device provided in an embodiment of the present disclosure. DETAILED DESCRIPTION
[0050] To enable those skilled in the art to better understand the technical solutions of the present disclosure, exemplary embodiments of the present disclosure are described below in conjunction with the accompanying drawings, including various details of the embodiments of the present disclosure to facilitate understanding. These details should be considered merely exemplary. Therefore, those skilled in the art should recognize that various changes and modifications can be made to the embodiments described herein without departing from the scope and spirit of the present disclosure. Similarly, for the sake of clarity and conciseness, descriptions of well-known functions and structures are omitted in the following description.
[0051] In the absence of conflict, the various embodiments of the present disclosure and the various features therein may be combined with each other.
[0052] As used herein, the term "and / or" includes any and all combinations of one or more of the associated listed items.
[0053] The terms used herein are only used to describe specific embodiments and are not intended to limit the present disclosure. As used herein, the singular forms "a" and "the" are also intended to include the plural forms, unless the context clearly indicates otherwise. It will also be understood that when the terms "comprising" and / or "made of" are used in this specification, the presence of the features, wholes, steps, operations, elements and / or components is specified, but the presence or addition of one or more other features, wholes, steps, operations, elements, components and / or groups thereof is not excluded. Similar words such as "connected" or "connected" are not limited to physical or mechanical connections, but can include electrical connections, whether direct or indirect.
[0054] Unless otherwise defined, all terms (including technical and scientific terms) used herein have the same meaning as commonly understood by one of ordinary skill in the art. It will also be understood that terms such as those defined in commonly used dictionaries should be interpreted as having a meaning consistent with their meaning in the context of the relevant art and the present disclosure, and will not be interpreted as having an idealized or overly formal meaning unless expressly defined as such herein.
[0055] Figure 1 A flowchart of a resource scheduling method provided in an embodiment of the present disclosure.
[0056] Reference Figure 1 The present disclosure provides a resource scheduling method, which includes the following steps:
[0057] Step S101: Obtain the current load rate and branch computing overhead corresponding to each predetermined task processing branch.
[0058] The current load rate of the task processing branch is the ratio of the number of times the task processing branch executes the task within a preset time period to the sum of the number of times each task processing branch executes the task. The branch computation overhead is the estimated computation delay parameter corresponding to the task processing branch.
[0059] Figure 2 A schematic diagram of a dynamic graph provided by an embodiment of the present disclosure. Figure 2 As shown, the dynamic graph can be divided into at least one serial execution subgraph from top to bottom, wherein the division principle is: the node that separates the branch (edge) is used as the division node, and the node where multiple branches (edges) converge is used as the division node. Each serial execution subgraph corresponds to a task processing process. The task processing branch is a data structure used to describe the task processing process in the dynamic graph, and the data structure consists of data nodes and directed edges. Any task processing process can correspond to multiple task processing branches. For example, the second task processing process corresponds to task processing branches I1, I2, and I3. The dynamic graph also includes a first task processing process, which is a preceding processing process of the second task processing process, and the second task processing process is connected to the first task processing process.
[0060] Step S102: Schedule processing resources for each task processing branch according to the current load rate and branch calculation overhead corresponding to each task processing branch.
[0061] The processing resources are used to process the tasks corresponding to the task processing branches.
[0062] It should be noted that scheduling the processing resources of each task processing branch based on the current load rate and branch calculation overhead corresponding to each task processing branch can enable each task processing branch to obtain processing resources corresponding to its own current load rate and processing capacity, effectively reducing the imbalance in processing resource allocation and improving the task processing efficiency based on dynamic graphs.
[0063] An embodiment of the present disclosure provides a resource scheduling method. First, a current load rate corresponding to each predetermined task processing branch is obtained. Then, processing resources are scheduled for each task processing branch based on the current load rate corresponding to each task processing branch. The processing resources are used to process the tasks corresponding to the task processing branches to achieve dynamic scheduling of processing resources, which can effectively reduce the imbalance in the allocation of processing resources and improve the task processing efficiency based on the dynamic graph.
[0064] In one embodiment, before obtaining the predetermined current load rate corresponding to each task processing branch (step S101), the method further includes: determining at least two task processing branches based on the calculation result of the current task processing node on the current input data.
[0065] Among them, the current task processing node is Figure 2 The dynamic graph shown includes a first task processing process mapped to a processing node in the processor. The current task processing node executes the first task processing process on the current input data, obtaining a calculation result. This calculation result corresponds to the second task processing process. Different calculation results correspond to different second task processing processes, thereby determining different task processing branches.
[0066] In one embodiment, the processor may be a many-core system, and the current task processing node may be one or more processing cores in the many-core system.
[0067] In one embodiment, Figure 2 As shown, the calculation results of the current task processing node for the current input data include three calculation results: i=1, i=2 and i=3. The three task processing branches determined are the first task processing branch I1 corresponding to the calculation result of i=1, the second task processing branch I2 corresponding to the calculation result of i=2, and the third task processing branch I3 corresponding to the calculation result of i=3.
[0068] In one implementation scenario, the current input data consists of multiple images, the first task processing process is an image content classification process, and the second task processing process is an image content color grading process. The current task processing node then executes the first task processing process on the current input data. The resulting calculation results are: i = 1 indicates the image content is a person, i = 2 indicates the image content is an animal, i = 3 indicates the image content is a landscape, and so on. Because the color grading processes for different image contents generally differ, these different calculation results correspond to different second task processing processes, thereby determining different task processing branches.
[0069] Figure 3 This is a structural diagram of a multi-core system provided by an embodiment of the present disclosure. Figure 3 As shown, the many-core system 300 includes multiple processing cores 301 , and the current task processing node 302 includes two processing cores 301 .
[0070] In one embodiment, the current load rate corresponding to the task processing branch is obtained by:
[0071] For each task processing branch, the current load rate corresponding to the task processing branch is obtained based on the ratio of the number of times the task processing branch executes the task within the preset time period to the sum of the number of times each task processing branch executes the task.
[0072] The preset duration can be set according to the actual application scenario, for example, it can be 10 seconds, and this embodiment does not specifically limit it.
[0073] In an implementation scenario, such as Figure 2 As shown, it is predetermined that there are three task processing branches: the first task processing branch I1, the second task processing branch I2, and the third task processing branch I3. The first task processing branch I1 executes tasks 70 times within the preset duration, the second task processing branch I2 executes tasks 20 times within the preset duration, and the third task processing branch I3 executes tasks 10 times within the preset duration. That is, the sum of the number of times each task processing branch executes tasks is 100. Therefore, the current load rates of the first task processing branch I1, the second task processing branch I2, and the third task processing branch I3 are 70%, 20%, and 10%, respectively.
[0074] In one embodiment, the branch computation overhead corresponding to the task processing branch is obtained by:
[0075] For each task processing branch, based on the service flow data and service load characteristics corresponding to the task processing branch within a preset time period, the branch computing overhead corresponding to the task processing branch is obtained.
[0076] The service flow data refers to the task data that needs to be processed by the task processing branch within a preset duration. Service load characteristics include parameters such as the load and computational complexity of the service flow. In some embodiments, the service load characteristics may also include the number of multiplications and additions, neural network structure parameters, etc. The preset duration can be set according to the actual application scenario, for example, 10 seconds, and is not specifically limited in this embodiment.
[0077] In one implementation scenario, for a task processing branch used to process images of a preset category, the business flow data corresponding to the task processing branch can be a batch of images of a preset category, and the business load characteristics are parameters such as the number of frames of the batch of images of the preset category, the amount of calculation per frame, etc. The branch computing overhead corresponding to the task processing branch is then: the product of the number of image frames processed within the preset time length, the amount of calculation per frame, and the efficiency coefficient, where the efficiency coefficient is a parameter used to represent the processing capacity of the task processing branch and can be adaptively set according to the actual application scenario. For example, if the number of image frames processed within the preset time length is 100, the amount of calculation per frame is 5G, and the efficiency coefficient is 1.5, then the branch computing overhead of the task processing branch is 100*5G*1.5=750G.
[0078] In one embodiment, the task processing branch includes a task processing branch that is pre-set as a pre-adjusted processing resource and a task processing branch that does not adjust the processing resource. For example, the task processing branch that pre-adjusts the processing resource is a task processing branch whose current load rate is not zero, and the task processing branch that does not adjust the processing resource is a task processing branch whose current load rate is zero. Then, the above-mentioned step of scheduling the processing resources of each task processing branch according to the current load rate and branch calculation overhead corresponding to each task processing branch includes: scheduling the processing resources of each task processing branch that is pre-set as a processing resource to be adjusted according to the current load rate and branch calculation overhead corresponding to each task processing branch that is pre-set as a processing resource to be adjusted.
[0079] Figure 4 Flowchart of a specific implementation of step S102 provided in the embodiment of the present disclosure. In one embodiment, Figure 4 As shown, in order to further improve the task processing efficiency, the step of scheduling the processing resources of each task processing branch according to the current load rate and branch calculation overhead corresponding to each task processing branch (step S102) includes:
[0080] Step S401: Determine a branch calculation evaluation parameter according to the product of the current load rate of each task processing branch and the branch calculation overhead.
[0081] Step 402: Based on the branch calculation evaluation parameters of each task processing branch and the number of processing cores that can be scheduled in the many-core system, determine the number of processing cores corresponding to each task processing branch so that the difference between the maximum resource adjustment measurement parameter and the minimum resource adjustment measurement parameter is less than a preset value.
[0082] The resource adjustment measurement parameter is a ratio of a branch calculation evaluation parameter of a task processing branch to the number of corresponding processing cores.
[0083] In one embodiment, a maximum resource adjustment measurement parameter and a minimum resource adjustment measurement parameter are determined based on the resource adjustment measurement parameters corresponding to each task processing branch. The maximum resource adjustment measurement parameter is the maximum value of the resource adjustment measurement parameters corresponding to each task processing branch, and the minimum resource adjustment measurement parameter is the minimum value of the resource adjustment measurement parameters corresponding to each task processing branch.
[0084] The sum of the numbers of processing cores corresponding to the task processing branches is less than or equal to the number of schedulable processing cores in the many-core system.
[0085] The number of processing cores corresponding to a task processing branch is the number of processing cores used to process the task corresponding to the task processing branch.
[0086] In one embodiment, the schedulable processing cores in the many-core system include idle processing cores in the many-core system, and may also include processing cores that have been assigned to task processing branches but have not processed any tasks within a preset time period.
[0087] In one implementation scenario, after executing step S402, the branch calculation evaluation parameters of the n task processing branches are D1, D2, ..., Dm, respectively, and the number of processing cores corresponding to each task processing branch is R1, R2, ..., Rm, respectively, with a preset value of K. Therefore, max(Dn / Rn)-min(Dn / Rn)<K, n∈[1,m]. Thus, after executing step S402, the branch calculation evaluation parameters corresponding to each task processing branch, i.e., the task processing capabilities of each task processing branch, are similar. This can avoid low task processing efficiency due to insufficient processing capability of one task processing branch, which in turn leads to a backlog of tasks in the cache.
[0088] Step S403: Based on the number of processing cores corresponding to each task processing branch, a corresponding number of processing cores are scheduled for each task processing branch to serve as processing resources corresponding to each task processing branch.
[0089] In one embodiment, based on the number of processing cores corresponding to each task processing branch, the step of scheduling a corresponding number of processing cores for each task processing branch includes: for any task processing branch, randomly selecting multiple processing cores from the schedulable processing cores in the many-core system as the processing resources corresponding to the scheduling of the task processing branch, wherein the number of selected processing cores is equal to the number of processing cores corresponding to the task processing branch.
[0090] In an implementation scenario, such as Figure 2 As shown, it is predetermined that there are three task processing branches: the first task processing branch I1, the second task processing branch I2, and the third task processing branch I3. The number of processing cores corresponding to the first task processing branch I1, the second task processing branch I2, and the third task processing branch I3 are 6, 4, and 2, respectively. Figure 3 As shown, the 6 processing cores included in the first processing core area 303 are the corresponding number of processing cores scheduled for the task processing branch I1, the 4 processing cores included in the second processing core area 304 are the corresponding number of processing cores scheduled for the task processing branch I2, and the 2 processing cores included in the third processing core area 305 are the corresponding number of processing cores scheduled for the task processing branch I3.
[0091] Figure 5 This is a flowchart of a specific implementation of step S403 provided in an embodiment of the present disclosure. In one implementation, Figure 5 As shown, the step of scheduling a corresponding number of processing cores for each task processing branch based on the number of processing cores corresponding to each task processing branch includes:
[0092] Step S501: Determine multiple processing core scheduling strategies based on the number of processing cores corresponding to each task processing branch, wherein the processing core scheduling strategies include physical location identifiers of the processing cores corresponding to each task processing branch.
[0093] The physical location identifier of the processing core corresponding to each task processing branch can be represented by coordinates. For example, if the physical location identifier of the processing core is (1, 1), it means that the processing core is the processing core in the first row and first column.
[0094] by Figure 2 and Figure 3 As an example, the scheduling strategy of any processing core is described. In an implementation scenario, such as Figure 2 As shown in FIG, it is predetermined that there are three task processing branches: the first task processing branch I1, the second task processing branch I2, and the third task processing branch I3. Then, in a processing core scheduling strategy determined, the number of processing cores corresponding to the first task processing branch I1, the second task processing branch I2, and the third task processing branch I3 are 6, 4, and 2, respectively. Figure 3As shown, the first processing core region 303 includes six processing cores, which are the corresponding number of processing cores scheduled for task processing branch I1. The physical location identifiers of these six processing cores are (1, 1), (1, 2), (2, 1), (2, 2), (3, 1), and (3, 2). The second processing core region 304 includes four processing cores, which are the corresponding number of processing cores scheduled for task processing branch I2. The identifiers of these four processing cores are (5, 1) and (5, 2). The third processing core region 305 includes two processing cores, which are the corresponding number of processing cores scheduled for task processing branch I3. The identifiers of these two processing cores are (1, 3) and (2, 3). The physical location identifiers of the processing cores in this example are for illustrative purposes only. In actual application scenarios, the physical location identifiers of the processing cores are set according to specific implementation requirements.
[0095] It should be noted that, for any two of the multiple processing core scheduling strategies determined in step 501, the number of processing cores corresponding to the task processing branches contained in the two are exactly the same, but the physical location identifiers of the processing cores corresponding to the task processing branches contained in the two are inconsistent. Figure 3 Taking an example to illustrate, in the first processing core scheduling strategy, the six processing cores included in the first processing core area 303 are the corresponding number of processing cores scheduled for the task processing branch I1, and the identifiers of the six processing cores are (1, 1), (1, 2), (2, 1), (2, 2), (3, 1), and (3, 2); while in the second processing core scheduling strategy, the six processing cores included in the fourth processing core area 306 are the corresponding number of processing cores scheduled for the task processing branch I1, and the identifiers of the six processing cores are (5, 3), (5, 4), (5, 5), (6, 3), (6, 4), and (6, 5).
[0096] Step S502: for each task processing branch in each processing core scheduling strategy, determine the branch transmission cost parameter corresponding to the task processing branch in the processing core scheduling strategy according to the physical location identifiers of the processing cores corresponding to the task processing branch.
[0097] In one embodiment, the step of determining the branch transmission cost parameter corresponding to the task processing branch in the processing core scheduling strategy according to the physical location identifier of each processing core corresponding to the task processing branch includes the following steps 1 and 2:
[0098] Step 1: According to the physical location identifiers of the processing cores corresponding to the task processing branch, the branch routing transmission cost parameters and the branch data transmission cost parameters corresponding to the task processing branch are obtained.
[0099] In one embodiment, based on the physical location identifiers of each processing core corresponding to the task processing branch, the transmission distance value between the processing cores corresponding to the task processing branch is obtained, and based on the transmission distance value between the processing cores corresponding to the task processing branch, the branch routing transmission cost parameter corresponding to the task processing branch is determined.
[0100] Among them, the branch routing transmission cost parameter corresponding to the task processing branch is positively correlated with the sum of the transmission distance values between the processing cores corresponding to the task processing branch. The smaller the sum of the transmission distance values between the processing cores corresponding to the task processing branch, the smaller the branch routing transmission cost parameter corresponding to the task processing branch.
[0101] In one embodiment, based on the physical location identifiers of each processing core corresponding to the task processing branch, the data reading delay corresponding to each processing core corresponding to the task processing branch is obtained, and based on the data access delay corresponding to each processing core corresponding to the task processing branch, the branch data transmission cost parameter corresponding to the task processing branch is determined.
[0102] Among them, according to the physical location identification of each processing core corresponding to the task processing branch, the interaction relationship of these processing cores can be determined, and the data read delay corresponding to each processing core can be determined through the interaction relationship. The data read delay includes data read delay and data storage delay. Among them, the data read delay includes one or more of the delay of the processing core reading data stored in the storage area of other processing cores on the chip, the delay of reading data stored in the storage area of the core itself, and the delay of reading data stored in the off-chip storage area. The data storage delay includes one or more of the delay of storing data from the off-chip to the storage area of the core itself, the delay of other processing cores on the chip storing data to the storage area of the core itself, and the delay of storing data from other areas of the core itself to the storage area of the core itself.
[0103] The branch data transmission cost parameter corresponding to the task processing branch is positively correlated with the sum of the data access delays corresponding to the processing cores corresponding to the task processing branch. The smaller the sum of the data access delays corresponding to the processing cores corresponding to the task processing branch, the smaller the branch data transmission cost parameter corresponding to the task processing branch.
[0104] Step 2: Determine the branch transmission cost parameter corresponding to the task processing branch according to the sum of the branch routing transmission cost parameter and the branch data transmission cost parameter corresponding to the task processing branch.
[0105] Step S503: Determine a total transmission cost parameter corresponding to the processing core scheduling strategy according to the branch transmission cost parameter corresponding to each task processing branch in the processing core scheduling strategy.
[0106] In one embodiment, the step of determining a total transmission cost parameter corresponding to the processing core scheduling policy based on branch transmission cost parameters corresponding to each task processing branch in the processing core scheduling policy includes: performing a weighted summation of the branch transmission cost parameters corresponding to each task processing branch to obtain the total transmission cost parameter corresponding to the processing core scheduling policy. The weight of each task processing branch may be the current load rate of the task processing branch.
[0107] Step S504: Based on the processing core scheduling strategy with the minimum total transmission cost parameter, schedule the processing cores corresponding to the corresponding number and physical location identifiers for each task processing branch.
[0108] Among them, the processing core scheduling strategy with the smallest total transmission cost parameter among all processing core scheduling strategies is determined as the target processing core scheduling strategy, and based on the target processing core scheduling strategy, the processing cores corresponding to the corresponding number and physical location identifiers are scheduled for each task processing branch. This can shorten the processing time of the processing core for processing the tasks corresponding to the task processing branch, shorten the transmission distance in the process of the processing core processing the tasks corresponding to the task processing branch, reduce the required routing transmission time, and ultimately improve the task processing efficiency.
[0109] In one implementation scenario, the process of executing any task in a many-core system includes at least one task processing process. The processes for scheduling processing resources for each task processing process are independent of each other to improve the efficiency of the task processing process. The step of obtaining the current load rate and branch computation overhead corresponding to each predetermined task processing branch (step S101) includes: for any task processing process corresponding to at least two task processing branches, obtaining the current load rate and branch computation overhead of each task processing branch corresponding to the task processing process.
[0110] Figure 6 This is a block diagram of a resource scheduling device provided by an embodiment of the present disclosure. Figure 6 As shown, a resource scheduling device provided by an embodiment of the present disclosure includes: an acquisition module 61 and a scheduling module 62.
[0111] The acquisition module 61 is used to acquire the current load rate and branch computing overhead corresponding to each predetermined task processing branch.
[0112] The scheduling module 62 is used to schedule processing resources for each task processing branch according to the current load rate and branch calculation overhead corresponding to each task processing branch.
[0113] The processing resources are used to process the tasks corresponding to the task processing branches.
[0114] In one embodiment, the resource scheduling device further includes a processing module, wherein the processing module is configured to determine at least two task processing branches based on calculation results of current input data by the current task processing node before obtaining the current load rate and branch calculation overhead corresponding to each predetermined task processing branch.
[0115] Each module in the resource scheduling device provided in the embodiment of the present disclosure corresponds to each step in the resource scheduling method. Therefore, the detailed working method of each module in the resource scheduling device can refer to the resource scheduling method provided in the embodiment of the present disclosure.
[0116] An embodiment of the present disclosure provides a resource scheduling device, wherein an acquisition module is used to obtain a current load rate and branch calculation overhead corresponding to each predetermined task processing branch, and a scheduling module is used to schedule processing resources for each task processing branch according to the current load rate and branch calculation overhead corresponding to each task processing branch, wherein the processing resources are used to process tasks corresponding to the task processing branches to realize dynamic scheduling of processing resources, which can effectively reduce the imbalance in processing resource allocation and improve the task processing efficiency based on the dynamic graph.
[0117] The embodiment of the present disclosure further provides a processing core, which includes the resource scheduling device in the above embodiment.
[0118] Figure 7 A block diagram of the composition of an electronic device provided in an embodiment of the present disclosure.
[0119] Reference Figure 7 An embodiment of the present disclosure provides an electronic device, which includes multiple processing cores 701 and an on-chip network 702, wherein the multiple processing cores 701 are connected to the on-chip network 702, and the on-chip network 702 is used to exchange data between the multiple processing cores and external data.
[0120] One or more instructions are stored in one or more processing cores 701 , and the one or more instructions are executed by one or more processing cores 701 , so that one or more processing cores 901 can execute the resource scheduling method provided in the above embodiment.
[0121] An embodiment of the present disclosure provides a computer-readable medium having a computer program stored thereon, wherein the computer program, when executed by a processing core, implements the resource scheduling method provided in the above embodiment.
[0122] It will be appreciated by those skilled in the art that all or some of the steps, systems, and functional modules / units in the methods disclosed above may be implemented as software, firmware, hardware, and appropriate combinations thereof. In hardware implementations, the division between the functional modules / units mentioned in the above description does not necessarily correspond to the division of physical components; for example, a physical component may have multiple functions, or a function or step may be performed by several physical components in cooperation. Some or all physical components may be implemented as software executed by a processor, such as a central processing unit, a digital signal processor, or a microprocessor, or implemented as hardware, or implemented as an integrated circuit, such as an application-specific integrated circuit. Such software may be distributed on a computer-readable medium, which may include a computer storage medium (or non-transitory medium) and a communication medium (or temporary medium). As is well known to those skilled in the art, the term computer storage medium includes volatile and non-volatile, removable, and non-removable media implemented in any method or technology for storing information (such as computer-readable instructions, data structures, program modules, or other data). Computer storage media include, but are not limited to, RAM, ROM, EEPROM, flash memory or other memory technology, CD-ROM, digital versatile disks (DVD) or other optical disk storage, magnetic cassettes, magnetic tape, magnetic disk storage or other magnetic storage devices, or any other medium that can be used to store the desired information and can be accessed by a computer. In addition, it is well known to those skilled in the art that communication media generally embodies computer-readable instructions, data structures, program modules, or other data in a modulated data signal such as a carrier wave or other transport mechanism, and may include any information delivery media.
[0123] Example embodiments have been disclosed herein, and although specific terms are employed, they are used and should be interpreted only in a general illustrative sense and not for purposes of limitation. In some instances, it will be apparent to those skilled in the art that, unless otherwise expressly indicated, features, characteristics, and / or elements described in conjunction with a particular embodiment may be used alone or in combination with features, characteristics, and / or elements described in conjunction with other embodiments. Therefore, it will be understood by those skilled in the art that various changes in form and detail may be made without departing from the scope of the present disclosure as set forth in the appended claims.
Claims
1. A resource scheduling method, comprising: Obtain the current load rate and branch computing overhead corresponding to each predetermined task processing branch; Determine the branch calculation evaluation parameter according to the product of the current load rate of each task processing branch and the branch calculation overhead; Determining the number of processing cores corresponding to each task processing branch based on a branch calculation evaluation parameter of each task processing branch and the number of processing cores schedulable in the many-core system, so that a difference between a maximum resource adjustment measurement parameter and a minimum resource adjustment measurement parameter is less than a preset value; wherein the resource adjustment measurement parameter is a ratio of the branch calculation evaluation parameter of the task processing branch to the number of corresponding processing cores; and the sum of the numbers of processing cores corresponding to each task processing branch is less than or equal to the number of processing cores schedulable in the many-core system; Based on the number of processing cores corresponding to each task processing branch, a corresponding number of processing cores are scheduled for each task processing branch to serve as processing resources corresponding to each task processing branch, and the processing resources are used to process the tasks corresponding to the task processing branch.
2. The resource scheduling method according to claim 1, wherein: Before obtaining the current load rate and branch calculation overhead corresponding to each predetermined task processing branch, the following steps are included: At least two task processing branches are determined based on a calculation result of the current task processing node on the current input data.
3. The resource scheduling method according to claim 1, wherein: The step of scheduling a corresponding number of processing cores for each task processing branch based on the number of processing cores corresponding to each task processing branch includes: Determining a plurality of processing core scheduling strategies based on the number of processing cores corresponding to each of the task processing branches; the processing core scheduling strategies including physical location identifiers of the processing cores corresponding to each of the task processing branches; For each task processing branch in each processing core scheduling strategy, determine a branch transmission cost parameter corresponding to the task processing branch in the processing core scheduling strategy according to the physical location identifiers of the processing cores corresponding to the task processing branch; Determining a total transmission cost parameter corresponding to the processing core scheduling strategy according to the branch transmission cost parameter corresponding to each task processing branch in the processing core scheduling strategy; Based on the processing core scheduling strategy with the minimum total transmission cost parameter, the processing cores corresponding to the corresponding number and physical location identifiers are scheduled for each task processing branch.
4. The resource scheduling method according to claim 3, wherein: The step of determining the branch transmission cost parameter corresponding to the task processing branch in the processing core scheduling strategy according to the physical location identifiers of the processing cores corresponding to the task processing branch includes: According to the physical location identifiers of the processing cores corresponding to the task processing branch, obtaining the branch routing transmission cost parameter and the branch data transmission cost parameter corresponding to the task processing branch; The branch transmission cost parameter corresponding to the task processing branch is determined according to the sum of the branch routing transmission cost parameter and the branch data transmission cost parameter corresponding to the task processing branch.
5. The resource scheduling method according to claim 4, wherein: The step of obtaining the branch routing transmission cost parameter and the branch data transmission cost parameter corresponding to the task processing branch according to the physical location identifier of the processing core corresponding to the task processing branch includes: According to the physical location identifiers of the processing cores corresponding to the task processing branch, the transmission distance value between the processing cores corresponding to the task processing branch is obtained; Determine the branch routing transmission cost parameter corresponding to the task processing branch according to the transmission distance value between the processing cores corresponding to the task processing branch; Obtaining a data read delay corresponding to each processing core corresponding to the task processing branch according to the physical location identifiers of the processing cores corresponding to the task processing branch; Based on the data access delay corresponding to each processing core corresponding to the task processing branch, a branch data transmission cost parameter corresponding to the task processing branch is determined.
6. The resource scheduling method according to claim 3, wherein: The step of determining a total transmission cost parameter corresponding to the processing core scheduling strategy according to branch transmission cost parameters corresponding to each task processing branch in the processing core scheduling strategy includes: The branch transmission cost parameters corresponding to each task processing branch are weighted and summed to obtain the total transmission cost parameter corresponding to the processing core scheduling strategy.
7. The resource scheduling method according to claim 1, wherein: The current load rate corresponding to the task processing branch is obtained in the following way: For each task processing branch, the current load rate corresponding to the task processing branch is obtained based on the ratio of the number of times the task processing branch executes the task within the preset time period to the sum of the number of times each task processing branch executes the task.
8. The resource scheduling method according to claim 1, wherein: The branch calculation cost is obtained by the following method: For each task processing branch, based on the service flow data and service load characteristics corresponding to the task processing branch within a preset time period, the branch computing overhead corresponding to the task processing branch is obtained.
9. The resource scheduling method according to claim 1, wherein: The process of executing any task in a many-core system includes at least one task processing process; The obtaining of the current load rate and branch computing overhead corresponding to each predetermined task processing branch includes: For any task processing process corresponding to at least two task processing branches, the current load rate and branch computing overhead of each task processing branch corresponding to the task processing process are obtained.
10. A resource scheduling device, comprising: An acquisition module is used to obtain the current load rate and branch computing overhead corresponding to each predetermined task processing branch; The scheduling module is used to determine the branch calculation evaluation parameter according to the product of the current load rate of each task processing branch and the branch calculation overhead; Based on the branch calculation evaluation parameters of each task processing branch and the number of processing cores that can be scheduled in the many-core system, the number of processing cores corresponding to each task processing branch is determined so that the difference between the maximum resource adjustment measurement parameter and the minimum resource adjustment measurement parameter is less than a preset value; wherein the resource adjustment measurement parameter is the ratio of the branch calculation evaluation parameter of the task processing branch to the number of corresponding processing cores; the sum of the number of processing cores corresponding to each task processing branch is less than or equal to the number of processing cores that can be scheduled in the many-core system; based on the number of processing cores corresponding to each task processing branch, a corresponding number of processing cores is scheduled for each task processing branch as the processing resources corresponding to each task processing branch, and the processing resources are used to process the tasks corresponding to the task processing branches.
11. A processing core comprising the resource scheduling device according to claim 10.
12. An electronic device comprising: Multiple processing cores; as well as an on-chip network configured to exchange data between the plurality of processing cores and external data; One or more instructions are stored in one or more of the processing cores, and the one or more instructions are executed by the one or more of the processing cores, so that the one or more of the processing cores can execute the resource scheduling method according to any one of claims 1 to 9.
13. A computer-readable medium having a computer program stored thereon, wherein: When the computer program is executed by the processing core, the computer program implements the resource scheduling method according to any one of claims 1 to 9.
Citation Information
Patent Citations
Method for optimizing memory access distance on many-core processor
CN109857562A