Resource allocation method, apparatus, processing core, device, and computer readable medium

CN115878309BActive Publication Date: 2026-08-21LYNXI TECH CO LTD
View PDF 1 Cites 0 Cited by

Patent Information

Application Number
CN202111153693.4
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2021-09-29
Publication Date
2026-08-21
Estimated Expiration
2041-09-29

AI Technical Summary

Technical Problem

[0003]在对多个处理核的任务处理分配芯片资源时,通常是对所处理的任务无差别的进行资源分配,容易造成资源分配不合理

Benefits of technology

[0010] The resource allocation method, apparatus, processing core, device, and computer-readable medium provided in this disclosure can obtain the priorities of tasks to be processed by multiple processing cores in a chip, and allocate resources matching the priorities of different users' tasks according to the priorities and resource allocation strategies. In the resource allocation method of the embodiments of this disclosure, the user to which the task belongs can be identified by the user information of the task. Different users' tasks have different priorities, so the resources of the many-core chip can be allocated according to the different priorities of the tasks of different users, so as to obtain the resource allocation result matching the task priorities of different users. The resource allocation method is more reasonable and can improve the resource utilization of high-priority tasks.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN115878309B_ABST
    Figure CN115878309B_ABST
Patent Text Reader

Abstract

The present disclosure provides a resource allocation method applied to a many-core chip, comprising: obtaining a priority of a task to be processed in the many-core chip; wherein the priority of the task is different in the case that the task has different home user information, and the home user information is used to identify a user to which the task belongs; and performing resource allocation matching the priority on the task of different users according to the priority and a preset resource allocation strategy. The present disclosure also provides a resource allocation device, a processing core, an equipment and a computer readable medium. According to the scheme of the present disclosure, a resource allocation result matching the priority of the task of different users can be obtained, the resource allocation manner is more reasonable, and the resource utilization rate of the task with high priority is improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This disclosure relates to the field of processor technology, and in particular to a resource allocation method, apparatus, processing core, device, and computer-readable medium. Background Technology

[0002] Many-core chips (such as artificial intelligence chips) can have multiple computing units. The smallest computing unit in a many-core chip that can be independently scheduled and has complete computing capabilities is called a processing core. Multiple processing cores can work together to complete tasks.

[0003] When allocating chip resources for tasks across multiple processing cores, resources are often allocated indiscriminately to the tasks being processed, which can easily lead to unreasonable resource allocation. Summary of the Invention

[0004] This disclosure provides a resource allocation method, apparatus, processing core, device, and computer-readable medium.

[0005] In a first aspect, this disclosure provides a resource allocation method applied to a many-core chip. The resource allocation method includes: obtaining the priority of tasks to be processed in the many-core chip; wherein, when tasks have different user information, the priorities of the tasks are different, and the user information is used to identify the user to which the task belongs; and allocating resources to the tasks of different users in accordance with the priorities and a preset resource allocation strategy.

[0006] Secondly, this disclosure provides a resource allocation device applied to a many-core chip. The resource allocation device includes: an acquisition module for acquiring the priority of tasks to be processed in the many-core chip; wherein, when tasks have different user information, the priorities of the tasks are different, and the user information is used to identify the user to which the task belongs; and an allocation module for allocating resources to tasks of different users in accordance with the priority and a preset resource allocation strategy.

[0007] Thirdly, this disclosure provides a processing core that includes the resource allocation device described above.

[0008] Fourthly, this disclosure provides an electronic device comprising: a plurality of processing cores; and an on-chip network configured to interact with data between the plurality of processing cores and external data; wherein one or more processing cores store one or more instructions, and the one or more instructions are executed by the one or more processing cores to enable the one or more processing cores to perform the resource allocation method described above.

[0009] Fifthly, this 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 allocation method described above.

[0010] The resource allocation method, apparatus, processing core, device, and computer-readable medium provided in this disclosure can obtain the priorities of tasks to be processed by multiple processing cores in a chip, and allocate resources matching the priorities of different users' tasks according to the priorities and resource allocation strategies. In the resource allocation method of the embodiments of this disclosure, the user to which the task belongs can be identified by the user information of the task. Different users' tasks have different priorities, so the resources of the many-core chip can be allocated according to the different priorities of the tasks of different users, so as to obtain the resource allocation result matching the task priorities of different users. The resource allocation method is more reasonable and can improve the resource utilization of high-priority tasks.

[0011] It should be understood that the description in this section is not intended to identify key or essential features of the embodiments of this disclosure, nor is it intended to limit the scope of this disclosure. Other features of this disclosure will become readily apparent from the following description. Attached Figure Description

[0012] The accompanying drawings are provided to further illustrate the present disclosure and form part of the specification. They are used together with the embodiments of the present disclosure to explain the disclosure and do not constitute a limitation thereof. The above and other features and advantages will become more apparent to those skilled in the art from the detailed description of exemplary embodiments with reference to the accompanying drawings, in which:

[0013] Figure 1 This is a schematic diagram of the architecture provided for an embodiment of the present disclosure;

[0014] Figure 2 A flowchart of a resource allocation method provided in an embodiment of this disclosure;

[0015] Figure 3 A flowchart illustrating resource allocation for a routing allocation strategy provided in this embodiment of the disclosure;

[0016] Figure 4 A flowchart illustrating resource allocation for a memory bandwidth allocation strategy provided in this embodiment of the disclosure;

[0017] Figure 5 A flowchart illustrating resource allocation for in-core job task strategies provided in this embodiment of the disclosure;

[0018] Figure 6 A flowchart illustrating resource allocation for a redundant resource strategy provided in this embodiment of the disclosure;

[0019] Figure 7 A flowchart illustrating resource allocation for a resource preemption strategy provided in this embodiment of the disclosure;

[0020] Figure 8 A flowchart illustrating the process of setting a fifth predetermined task as provided in embodiments of this disclosure, allowing the use of at least a portion of the resources of a sixth predetermined task;

[0021] Figure 9 This is a block diagram of a resource allocation device provided in an embodiment of the present disclosure;

[0022] Figure 10 This is a block diagram of an electronic device provided in an embodiment of the present disclosure. Detailed Implementation

[0023] To enable those skilled in the art to better understand the technical solutions of this disclosure, exemplary embodiments of this disclosure are described below with reference to the accompanying drawings, including various details of the embodiments of this disclosure to aid understanding. These 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 this disclosure. Similarly, for clarity and conciseness, descriptions of well-known functions and structures are omitted in the following description.

[0024] Where there is no conflict, the various embodiments of this disclosure and the features thereof in the embodiments may be combined with each other.

[0025] As used herein, the term “and / or” includes any and all combinations of one or more related enumerated entries.

[0026] The terminology used herein is for the purpose of describing particular embodiments only and is not intended to limit this disclosure. As used herein, the singular forms “a” and “the” are intended to include the plural forms as well, 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, they specify the presence of features, integrals, steps, operations, elements, and / or components, but do not exclude the presence or addition of one or more other features, integrals, steps, operations, elements, components, and / or groups thereof. Words such as “connected” or “linked” are not limited to physical or mechanical connections but can include electrical connections, whether direct or indirect.

[0027] Unless otherwise specified, all terms used herein (including technical and scientific terms) 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 this disclosure, and will not be interpreted as having an idealized or overly formal meaning, unless expressly so defined herein.

[0028] Figure 1 This is a schematic diagram of an architecture provided for an embodiment of this disclosure.

[0029] like Figure 1 As shown, the architecture may include computer device 10, many-core chip 20, virtualization environment 1, virtualization environment 2, ..., virtualization environment n, where n is an integer greater than 1.

[0030] The virtualization environment can be understood as an environment created on computer device 10 using virtualization technology for running virtual machine clients. Each virtual machine client can run its own independent operating system, which can have various applications (Apps) installed, and the operating system can generate tasks that the corresponding user needs to process during its operation.

[0031] In this embodiment of the disclosure, each virtualization environment can correspond to one user. Therefore, as can be seen from the description of the above embodiments, the operation of each virtualization environment generates tasks that the corresponding user needs to process.

[0032] For example, in Figure 1 In this context, virtualization environment 1 corresponds to user 1. The operation of virtualization environment 1 can generate tasks that user 1 needs to process, such as task 11, task 12, ..., task 1k, where k is an integer greater than or equal to 1.

[0033] Virtualization environment 2 corresponds to user 2. The operation of virtualization environment 2 can generate tasks that user 2 needs to process, such as: task 21, task 22, ..., task 2m, where m is an integer greater than or equal to 1; ...

[0034] The virtualization environment n corresponds to the user n. The operation of the virtualization environment n can generate tasks that user n needs to process, such as: task n1, task n2, ..., task nt, where t is an integer greater than or equal to 1.

[0035] exist Figure 1 In this embodiment, the operating systems running independently in different virtualization environments can be the same or different, and no specific limitation is made in this disclosure.

[0036] In this embodiment of the disclosure, through chip virtualization technology, the computer device 10 can map or allocate the user's tasks corresponding to each virtualization environment to multiple processing cores included in the many-core chip 20. The multiple processing cores can work together to complete the tasks. The computer device 10 can allocate the resources required for task processing to the multiple processing cores.

[0037] The many-core chip 20 of this embodiment includes a plurality of processing cores 201. The many-core can be a collection of processing cores of a large number and various types connected together in a preset manner, possessing high-performance parallel processing capabilities.

[0038] It should be understood that the computer device in the embodiments of this disclosure may include, but is not limited to, personal computers, smartphones, tablets, personal digital assistants, servers, etc.; for example, the computer device may be composed of a single service device or a server cluster composed of multiple service devices.

[0039] Figure 2 A flowchart of a resource allocation method provided in an embodiment of this disclosure.

[0040] Reference Figure 2 This disclosure provides a resource allocation method applied to many-core chips; such as Figure 2 As shown, the resource allocation method may include the following steps.

[0041] S210, obtain the priority of the tasks to be processed in the many-core chip; wherein, when the tasks have different user information, the priority of the tasks is different, and the user information is used to identify the user to which the task belongs.

[0042] S220 allocates resources to different users' tasks according to their priorities and preset resource allocation strategies.

[0043] According to the resource allocation method of this disclosure, the priorities of tasks to be processed by multiple processing cores in a many-core chip can be obtained, and resources matching the priorities of different users' tasks can be allocated according to the priorities and resource allocation strategies. In this method, the user information of the task can be used to identify the user to which the task belongs. Different users' tasks have different priorities, so the resources of multiple processing cores can be allocated according to the different priorities of the tasks of different users to obtain resource allocation results matching the priorities. This resource allocation method is more reasonable and can improve the resource utilization of tasks with high priorities.

[0044] In some embodiments, each core in the many-core chip can allocate resources to the tasks it processes; or, the many cores in the many-core chip can include a control core, which can be used to allocate resources to the tasks processed by each core that processes tasks.

[0045] In some embodiments, in step S210, the tasks that need to be processed in the many-core chip are tasks generated by the operation of one or more virtualization environments. Each virtualization environment corresponds to one user, and different virtualization environments share the resources of multiple processing cores.

[0046] After using chip virtualization technology, virtualization clients running in various virtual environments on a computer device can share the resources of the same many-core chip or multiple many-core chips to process tasks, making the task processing safe and efficient.

[0047] In this embodiment of the disclosure, the priorities of the tasks that multiple processing cores need to process can be preset, providing available task priority data in advance for subsequent resource allocation.

[0048] In some embodiments, before step S210, the method may further include: S11, determining the user to which the task to be processed belongs based on the acquired user information of the task to be processed in the many-core chip; S12, setting priorities for tasks with different user information based on the user level of the user to which the task belongs, or based on the user level of the user to which the task belongs and the attribute information of the task to be processed. Specifically, the priority of a task with user information of a higher-level user is higher than the priority of a task with user information of a lower-level user, and the user level of a higher-level user is higher than the user level of a lower-level user.

[0049] For example, the attribute information of a task may include at least one of the following: task complexity, task execution time, and task receiving order. For example, to prevent tasks with longer execution times from affecting the execution of other tasks with shorter execution times, the priority of tasks with shorter execution times can be set to be higher than that of tasks with longer execution times.

[0050] It should be understood that in practical applications, when setting the priority of a task based on the user level of the user to which the task belongs and the attribute information of the task, one or more of the information items contained in the above-mentioned task attribute information can be used according to actual needs. For example, the priority of tasks with the same user information can be set by weighted averaging of the task complexity, task execution time and task receiving order.

[0051] In this embodiment, the priority of a task can be set based on the user level of the user to which the task belongs; alternatively, the priority can be set based on the user level of the user to which the task belongs and the attribute information of the task. The higher the user level of the user to which the task belongs, the higher the priority of the corresponding task, and tasks with the same user information can have different priorities. In practical application scenarios, these priorities can be preset according to actual needs, and this embodiment does not impose specific limitations.

[0052] After prioritizing tasks with different user affiliation information, resources can be allocated to tasks of different users according to the priority and the preset resource allocation strategy. This is conducive to more reasonable allocation of many-core resources and improves the resource utilization of high-priority tasks.

[0053] In some embodiments, in step S210, the resource allocation strategy may include at least one of the following strategy items: routing allocation strategy, memory bandwidth allocation strategy, in-core job task strategy, redundant resource strategy, and resource preemption strategy.

[0054] The routing allocation strategy includes at least one of the following strategies: time allocation strategy, space allocation strategy, and routing node buffering strategy.

[0055] In this embodiment of the disclosure, allocable resources include routing resources, memory resources, and in-core computing resources. In some embodiments, in routing resources, routing nodes can be used to send and receive data for data communication within each processing core or between different processing cores; routing paths can be used for data connection and communication between different routing nodes; routing node buffers can be used to cache data received from the previous routing node and send the cached data to the next routing node according to a sorting rule (e.g., first-in-first-out rule); in memory resources, the memory interface is the necessary path for each processing core to access memory data during task processing; in some application scenarios, if a single processing core needs to process tasks with different user affiliation information, then in-core computing resources need to be allocated to tasks belonging to different users according to the priority of the tasks processed within the processing core (hereinafter referred to as "within the core").

[0056] In this embodiment of the disclosure, by using a pre-set resource allocation strategy and combining the priorities of tasks with different user affiliation information, resource allocation can be carried out according to the task priorities of different users, resulting in a resource allocation result that matches the task priorities of different users. This makes the resource allocation method more reasonable and meets the different requirements of different users for task processing efficiency.

[0057] To better understand this disclosure, the corresponding resource allocation methods are described in detail below for different resource allocation strategies. It should be understood that among the multiple resource allocation strategies pre-set in the embodiments of this disclosure, all pre-set resource allocation strategies can be enabled according to the needs of the actual application scenario, or only a portion of the resource allocation strategies can be enabled. The embodiments of this disclosure do not impose specific limitations.

[0058] The routing allocation strategy of the embodiments of this disclosure is described below. Figure 3A flowchart illustrating resource allocation for a routing allocation strategy in an embodiment of this disclosure is shown.

[0059] In this embodiment of the disclosure, the routing allocation strategy may include one or more of the following: time allocation strategy, space allocation strategy, and routing node buffering strategy.

[0060] exist Figure 3 In this process, resource allocation for the routing allocation strategy may include steps S31-S33. Step S31 relates to a time allocation strategy, step S32 to a space allocation strategy, and step S33 to a routing node buffering strategy; however, this disclosure is not limited to the above descriptions, and may also include... Figure 3 The specific steps are illustrated below. In some embodiments, the resource allocation strategy may include only some of the strategies and correspond to some of the steps. That is, the resource allocation strategy can be flexibly set according to the actual application scenario, as described below with reference to specific embodiments.

[0061] In some embodiments, the resource allocation strategy includes a time allocation strategy; step S220 may include: S31, allocating a predetermined usage time period of at least a portion of the routing paths involved in task processing in the many-core chip to the first predetermined task, so as to use at least a portion of the routing paths to transmit data for the first predetermined task within the predetermined usage time period.

[0062] The first predetermined task is one of the following tasks that need to be processed in the many-core chip: a task with a priority greater than or equal to a first priority threshold, and a task with a priority greater than or equal to the first priority threshold and having predetermined user information.

[0063] In this embodiment, according to the time allocation strategy, some or all of the routing paths within a specified time period can be reserved for one or more tasks with a priority greater than or equal to the first priority threshold; or, some or all of the routing paths within a specified time period can be reserved for a user's tasks with a priority greater than or equal to the first priority threshold, thereby achieving resource allocation that matches the task priorities of different users in the time dimension of the routing path for routing resources.

[0064] In some embodiments, the resource allocation strategy includes a space allocation strategy; step S220 may include: S32, allocating a portion of the equivalent routing paths involved in at least two equivalent routing paths in each inter-core communication for task processing in the many-core chip to a second predetermined task, so as to use the portion of the equivalent routing paths to perform data transmission for the second predetermined task.

[0065] The second predetermined task is one of the following tasks that need to be processed in the many-core chip: a task with a priority greater than or equal to the second priority threshold, and a task with a priority greater than or equal to the second priority threshold and having predetermined user information.

[0066] In this embodiment, according to the space allocation strategy, a specified route path among all the route paths involved by multiple processing cores can be allocated to tasks with a priority greater than or equal to the second priority threshold through resource reservation. Thus, for route resources, resource allocation matching the task priorities of different users can be achieved in the spatial dimension of the route path.

[0067] In some embodiments, the resource allocation strategy includes a routing node buffering strategy; step S220 may include: S33, for tasks cached in the routing node buffer of the many-core chip, prioritizing the data transmission of a third predetermined task; wherein, the third predetermined task is one of the following tasks that need to be processed in the many-core chip: a task with a priority greater than or equal to a third priority threshold, and a task with a priority greater than or equal to a third priority threshold and having predetermined home user information.

[0068] For example, tasks with a priority lower than the third priority threshold can be processed sequentially according to the original sorting rules. The original sorting rules may include, for example, the first-in-first-out principle, the last-in-first-out principle, or other pre-set specified task sorting, etc., which are not specifically limited in this embodiment.

[0069] In this embodiment, according to the routing node buffering strategy, tasks with a specified priority that are cached by the current routing node can be sent to the next routing node for subsequent processing. This allows for resource allocation in the routing node's buffer that matches the task priorities of different users.

[0070] The memory bandwidth allocation strategy of embodiments of this disclosure is described below. Figure 4 A flowchart illustrating resource allocation for a memory bandwidth allocation strategy in an embodiment of this disclosure is shown.

[0071] In some embodiments, the resource allocation strategy includes a memory bandwidth allocation strategy.

[0072] like Figure 4 As shown, step S220 may include: S41, obtaining time slices obtained by pre-dividing the interface access time of the memory accessed by the many-core chip; S42, allocating the allocated time slices to the fourth predetermined task to use the allocated time slices for data transmission of the fourth predetermined task.

[0073] The fourth predetermined task is one of the following tasks that need to be processed in the many-core chip: a task with a priority greater than or equal to the fourth priority threshold, and a task with a priority greater than or equal to the fourth priority threshold and having predetermined user information.

[0074] In this embodiment, according to the memory bandwidth allocation strategy, the access time of the memory interface can be divided into M time slices, where M is an integer greater than 1. Using the resource allocation method of this embodiment, tasks with a priority greater than or equal to the fourth priority threshold can pre-occupy p time slices, where P is greater than or equal to 1 and less than M. Thus, for memory resources, in the dimension of memory interface access time, resource allocation is achieved that matches the task priorities of different users.

[0075] It should be understood that the values ​​of the first priority threshold, second priority threshold, third priority threshold, and fourth priority threshold involved in the above embodiments may be the same or different. In practical applications, user-defined settings can be made according to the actual needs of the application scenario, and no specific limitations are made in this disclosure embodiment.

[0076] The following describes the in-core job task strategy of embodiments of this disclosure. Figure 5 A flowchart illustrating resource allocation for in-core job task strategies in an embodiment of this disclosure is shown.

[0077] In some embodiments, when the number of tasks to be processed in a many-core chip is greater than 1, the resource allocation strategy includes an in-core job task strategy.

[0078] like Figure 5 As shown, step S220 may include: S51, obtaining the user information of each task to be processed to determine the user to which each task belongs; S52, determining the priority of each task matching the user level according to the user level of the user to which each task belongs; S53, allocating computing resources matching the user level for tasks with different user information to process tasks according to the priority matching the user level.

[0079] In this embodiment, for the in-core job task strategy, if a single processing core is also assigned tasks with different user affiliation information, priorities can be set for the tasks of different users, thereby achieving resource allocation that matches the task priorities of different users for the in-core job tasks.

[0080] The redundancy resource strategy of embodiments of this disclosure is described below. Figure 6 A flowchart illustrating resource allocation for a redundant resource strategy in an embodiment of this disclosure is shown.

[0081] like Figure 6As shown, in some embodiments, step S220 may specifically include: S61, determining the user to which the task to be processed belongs based on the user information of the task to be processed in the many-core chip; S62, reserving redundant resources for the task to be processed based on the user level of the user to which the task belongs.

[0082] Redundant resources are additional resources that are directly proportional to the resources required for the maximum load operation of the task to be processed. Furthermore, the ratio of redundant resources reserved for tasks with higher-level user affiliation information to the maximum load operation resources of that task (i.e., tasks with higher-level user affiliation information) is greater than the ratio of redundant resources reserved for tasks with lower-level user affiliation information to the maximum load operation resources of that task (i.e., tasks with lower-level user affiliation information). In addition, the user level of higher-level users is higher than that of lower-level users.

[0083] In some alternative embodiments, non-redundant resources and redundant resources for running each task can be determined separately. For example, the resources required for a task to operate at maximum load can be determined as non-redundant resources. Redundant resources can be determined based on the resources required for a task to operate at maximum load. For example, a target ratio for each task can be determined, and the product of the resources required for a task to operate at maximum load and the target ratio can be determined as the redundant resources for that task.

[0084] The target proportions differ for tasks of different priorities, with higher priority tasks having a higher target proportion than lower priority tasks.

[0085] In some alternative embodiments, the resources allocated to higher priority tasks may be less than the resources allocated to higher priority tasks.

[0086] For example, task A has a higher priority and its maximum load operation requires resources a, while task B has a lower priority and its maximum load operation requires resources b. The total resources of a are much smaller than the total resources of b, that is, the absolute value of the difference between the total resources of a and b is greater than or equal to a predetermined difference threshold. This predetermined difference threshold can be customized according to actual needs.

[0087] When allocating resources for task A and task B, the target proportions for task A and task B can be determined separately. For example, if the target proportion for task A is 100% and the target proportion for task B is 10%, then the resources allocated to task A are 2a, and the resources allocated to task B are 1.1b. It should be understood that in some embodiments, the total amount of resource 2a is less than the total amount of resource 1.1b.

[0088] In this embodiment, considering that some tasks have priority but process relatively small amounts of data, allocating too many resources would be wasteful. Therefore, more redundant resources can be reserved for higher-level users, thereby optimizing resource allocation. This improves resource utilization while effectively ensuring processing efficiency when the amount of data pending for high-priority tasks increases.

[0089] The resource preemption strategy of embodiments of this disclosure is described below. Figure 7 A flowchart illustrating resource allocation for a resource preemption strategy in an embodiment of this disclosure is shown.

[0090] like Figure 7 As shown, in some embodiments, step S220 may specifically include: S71, in the tasks that the acquired many-core chip needs to process, setting the processing of the fifth predetermined task to allow the use of at least some of the resources of the sixth predetermined task; S72, setting the execution of the sixth predetermined task to be postponed; wherein, the user level of the task owner of the fifth predetermined task is higher than the user level of the task owner of the sixth predetermined task.

[0091] In this embodiment, higher-priority users can use at least some of the resources of other lower-priority users. At this time, lower-priority users pause or slow down the execution of their current jobs, thereby effectively ensuring the priority execution of tasks for higher-priority users.

[0092] Figure 8 Show Figure 7 The flowchart shows the process of setting up the fifth pre-defined task, which allows the use of at least some of the resources of the sixth pre-defined task.

[0093] like Figure 8 As shown, in some embodiments, the step S71 above, which sets the processing procedure of the fifth predetermined task to allow the use of at least a portion of the resources of the sixth predetermined task, may specifically include: S81, releasing at least a portion of the resources pre-allocated to the sixth predetermined task; S82, allocating the released at least a portion of the resources to the fifth predetermined task.

[0094] In this embodiment, for tasks belonging to lower-priority users, some resources can be released to allow higher-priority users to utilize those resources. For example, taking memory resources as an example, a portion of the content stored in memory for tasks belonging to lower-priority users can be dumped to external Double Data Rate Random Access Memory (DDR) or a hard disk, thereby releasing some of the memory resources used by the tasks belonging to lower-priority users.

[0095] According to the resource allocation method of this disclosure, the user to which a task belongs can be identified by the user information to which the task belongs. Since different users' tasks have different priorities, the resources of multiple processing cores can be allocated according to the different priorities of the tasks of different users. This realizes that the resource allocation is allocated according to the task priorities of different users, and the resource allocation result matches the task priorities of different users. The resource allocation method is more reasonable and can improve the resource utilization rate of high-priority tasks.

[0096] Figure 9 This is a block diagram of the resource allocation device provided in an embodiment of the present disclosure.

[0097] Reference Figure 9 This disclosure provides a resource allocation device 900, which includes an acquisition module 910 and an allocation module 920.

[0098] The acquisition module 910 is used to acquire the priority of the tasks to be processed in the many-core chip; wherein, when the tasks have different user information, the priority of the tasks is different, and the user information is used to identify the user to which the task belongs.

[0099] The allocation module 920 is used to allocate resources to different users' tasks according to their priorities and preset resource allocation strategies.

[0100] In some embodiments, the tasks that the multiple processing cores need to process are tasks generated by the operation of one or more virtualization environments. Each virtualization environment corresponds to one user, and different virtualization environments share the resources of multiple processing cores.

[0101] In some embodiments, the resource allocation device 900 further includes: a user information determination module, configured to determine the user to which a task belongs based on the acquired user information of the task to be processed, before obtaining the priority of the task to be processed in the many-core chip; and a priority setting module, configured to set the priority of tasks with different user information based on the user level of the user to which the task belongs, or based on the user level of the user to which the task belongs and the attribute information of the task; wherein, the priority of a task with user information of a higher-level user is higher than the priority of a task with user information of a lower-level user, and the user level of a higher-level user is higher than the user level of a lower-level user.

[0102] In some embodiments, the resource allocation strategy includes at least one of the following: a routing allocation strategy, a memory bandwidth allocation strategy, and an in-kernel job task strategy; wherein the routing allocation strategy includes at least one of the following: a time allocation strategy, a space allocation strategy, and a routing node buffering strategy.

[0103] In some embodiments, the resource allocation strategy includes a time allocation strategy; the allocation module 920 is specifically configured to: allocate a predetermined usage time period of at least a portion of the routing paths involved in task processing in the many-core chip to a first predetermined task, so as to use at least a portion of the routing paths to transmit data for the first predetermined task within the predetermined usage time period; wherein, the first predetermined task is one of the following tasks that need to be processed in the many-core chip: a task with a priority greater than or equal to a first priority threshold, and a task with a priority greater than or equal to the first priority threshold and having predetermined attribution user information.

[0104] In some embodiments, the resource allocation strategy includes a space allocation strategy; the allocation module 920 is specifically configured to: reserve a portion of the equivalent routing paths in at least two equivalent routing paths involved in each inter-core communication for task processing in the many-core chip for a second predetermined task, so as to use the portion of the equivalent routing paths for data transmission of the second predetermined task; wherein the second predetermined task is one of the following tasks that need to be processed in the many-core chip: a task with a priority greater than or equal to a second priority threshold, and a task with a priority greater than or equal to the second priority threshold and having predetermined home user information.

[0105] In some embodiments, the resource allocation strategy includes a routing node buffering strategy; the allocation module 920 is specifically used to: prioritize data transmission of a third predetermined task for tasks cached in the routing node buffer of the many-core chip; wherein the third predetermined task is one of the following tasks that need to be processed in the many-core chip: a task with a priority greater than or equal to a third priority threshold, and a task with a priority greater than or equal to a third priority threshold and having predetermined home user information.

[0106] In some embodiments, the resource allocation strategy includes a memory bandwidth allocation strategy; the resource allocation device may further include: a time allocation module, configured to obtain time slices obtained by pre-dividing the interface access time of the memory accessed by the many-core chip; allocate the allocated time slices to a fourth predetermined task, so as to use the allocated time slices for data transmission of the fourth predetermined task; wherein the fourth predetermined task is one of the following tasks that need to be processed in the many-core chip: a task with a priority greater than or equal to a fourth priority threshold, and a task with a priority greater than or equal to the fourth priority threshold and having predetermined user information.

[0107] In some embodiments, when the number of tasks to be processed in the many-core chip is greater than 1, the resource allocation strategy includes an in-core job task strategy; the resource allocation device may further include: a user determination module, used to obtain the user information of each task to be processed, so as to determine the user to which each task belongs; a priority determination module, used to determine the priority of each task matching the user level according to the user level of the user to which each task belongs; the allocation module 920 is specifically used to: allocate computing resources matching the user level for tasks with different user information, so as to process the tasks according to the priority matching the user level.

[0108] In some embodiments, the resource allocation strategy includes a redundancy resource strategy; the resource allocation device may further include: a user information determination module, configured to determine the user to which the task to be processed belongs based on the user information of the task to be processed in the many-core chip; and a redundancy resource reservation module, configured to reserve redundant resources for the task to be processed based on the user level of the user to which the task belongs; wherein, the redundant resources are additional resources that are proportional to the resources required for the maximum load operation of the task to be processed, and the ratio of the redundant resources reserved for the task with the user information of a higher-level user to the resources required for the maximum load operation of that task is greater than the ratio of the redundant resources reserved for the task with the user information of a lower-level user to the resources required for the maximum load operation of that task; wherein, the user level of the higher-level user is higher than the user level of the lower-level user.

[0109] In some embodiments, the resource allocation strategy includes a resource preemption strategy; the resource allocation device may further include: a preemption setting module, configured to set the processing of the fifth predetermined task to allow the use of at least a portion of the resources of the sixth predetermined task among the acquired tasks to be processed; and a postponement setting module, configured to postpone the execution of the sixth predetermined task; wherein the user level of the task owner of the fifth predetermined task is higher than the user level of the task owner of the sixth predetermined task.

[0110] In some embodiments, the preemption setting module includes: a resource release unit for releasing at least a portion of the resources pre-allocated to a sixth predetermined task; and a resource allocation device for allocating the released at least a portion of the resources to a fifth predetermined task.

[0111] According to the resource allocation device of the present disclosure, the user to which a task belongs can be identified by the user information of the task. Since different users' tasks have different priorities, the resources of multiple processing cores can be allocated according to the different priorities of the tasks of different users. This realizes that the resource allocation is allocated according to the task priorities of different users, and the resource allocation result matches the task priorities of different users. The resource allocation method is more reasonable and can improve the resource utilization rate of high-priority tasks.

[0112] Figure 10 This is a block diagram of an electronic device provided in an embodiment of the present disclosure.

[0113] Reference Figure 10 This disclosure provides an electronic device that includes multiple processing cores 1001 and an on-chip network 1002. The multiple processing cores 1001 are all connected to the on-chip network 1002, and the on-chip network 1002 is used to exchange data between the multiple processing cores and external data.

[0114] One or more processing cores 1001 store one or more instructions, which are executed by one or more processing cores 1001 to enable one or more processing cores 1001 to perform the resource allocation method described above.

[0115] Figure 10 The processing core 1001 in the middle is combined with the above. Figures 1-9 The processing cores in the described embodiments have the same structure and working principle. For the sake of convenience and brevity, the specific working process of the resource allocation method of this processing core can be referred to the corresponding process of the resource allocation method in the foregoing method embodiments, and will not be repeated here.

[0116] In this embodiment of the disclosure, a processing core is also provided, including the resource allocation device in the above embodiments.

[0117] Furthermore, this disclosure also provides a computer-readable medium having a computer program stored thereon, wherein the computer program implements the above-described resource allocation method when executed by a processing core.

[0118] It will be understood by those skilled in the art that all or some of the steps, systems, or apparatuses disclosed above, and their functional modules / units, can be implemented as software, firmware, hardware, or suitable combinations thereof. In hardware implementations, the division between 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 collaboratively by several physical components. Some or all physical components may be implemented as software executed by a processor, such as a central processing unit, digital signal processor, or microprocessor, or as hardware, or as an integrated circuit, such as an application-specific integrated circuit (ASIC). Such software may be distributed on a computer-readable medium, which may include computer storage media (or non-transitory media) and communication media (or transient media). As is known to those skilled in the art, the term computer storage media 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 technologies, CD-ROM, digital versatile disc (DVD) or other optical disc storage, magnetic cartridges, magnetic tape, disk storage or other magnetic storage devices, or any other medium that can be used to store desired information and can be accessed by a computer. Furthermore, it is well known to those skilled in the art that communication media typically contain computer-readable instructions, data structures, program modules, or other data in modulated data signals such as carrier waves or other transmission mechanisms, and may include any information delivery medium.

[0119] Example embodiments have been disclosed herein, and while specific terminology has been used, it is for illustrative purposes only and should be construed as such, and is not intended to be limiting. In some instances, it will be apparent to those skilled in the art that features, characteristics, and / or elements described in connection with particular embodiments may be used alone, or in combination with features, characteristics, and / or elements described in connection with other embodiments, unless otherwise expressly indicated. Therefore, those skilled in the art will understand that various changes in form and detail may be made without departing from the scope of this disclosure as set forth by the appended claims.

Claims

1. A resource allocation method, the method being applied to many-core chips, the method comprising: Obtain the priority of the tasks to be processed in the many-core chip; wherein, when the tasks have different user information, the priorities of the tasks are different, and the user information is used to identify the user to which the task belongs; According to the stated priority and the preset resource allocation strategy, resources are allocated to the tasks of different users in a manner that matches the stated priority. The resource allocation strategy includes at least one of the following: Routing allocation strategy, memory bandwidth allocation strategy, in-kernel job task strategy, redundancy resource strategy, and resource preemption strategy; among them, The routing allocation strategy includes at least one of the following strategies: time allocation strategy, space allocation strategy, and routing node buffering strategy; The resource allocation strategy includes a space allocation strategy. The step of allocating resources to different users' tasks according to the priority and a preset resource allocation strategy, matching the priority with the available resources, includes: In each inter-core communication involved in task processing in the many-core chip, a portion of the equivalent routing path is allocated to a second predetermined task to use the portion of the equivalent routing path for data transmission of the second predetermined task. The second predetermined task is one of the following tasks that need to be processed in the many-core chip: a task with a priority greater than or equal to the second priority threshold, and a task with a priority greater than or equal to the second priority threshold and having predetermined user information.

2. The resource allocation method according to claim 1, wherein, The tasks to be processed are generated by the operation of one or more virtualization environments, each virtualization environment corresponds to one user, and different virtualization environments share the resources of the many-core chip.

3. The resource allocation method according to claim 1, wherein, Before obtaining the priority of the tasks to be processed in the many-core chip, the method further includes: Based on the user information of the task to be processed in the acquired many-core chip, determine the user to whom the task to be processed belongs. Based on the user level of the user to which the task belongs, or based on the user level of the user to which the task belongs and the attribute information of the task to be processed, the priority of tasks with different user affiliation information is set; Among them, tasks with the attribution information of higher-level users have a higher priority than tasks with the attribution information of lower-level users, and the user level of higher-level users is higher than the user level of lower-level users.

4. The resource allocation method according to any one of claims 1-3, wherein, The resource allocation strategy includes a time allocation strategy. The process of allocating resources to different users' tasks according to the priority and a preset resource allocation strategy, matching the priority with the actual priority, includes: Of all the routing paths involved in task processing within the many-core chip, a predetermined usage time period for at least a portion of the routing paths is allocated to a first predetermined task, so that data transmission for the first predetermined task is performed using the at least a portion of the routing paths within the predetermined usage time period; wherein... The first predetermined task is one of the following tasks that need to be processed in the many-core chip: a task with a priority greater than or equal to a first priority threshold, and a task with a priority greater than or equal to the first priority threshold and having predetermined user information.

5. The resource allocation method according to any one of claims 1-3, wherein, The resource allocation strategy includes a routing node buffering strategy; the process of allocating resources to different users' tasks according to the priority and the preset resource allocation strategy, matching the priority with the priority, includes: For tasks cached in the routing node buffer of the many-core chip, the third predetermined task is given priority for data transmission; The third predetermined task is one of the following tasks that need to be processed in the many-core chip: a task with a priority greater than or equal to the third priority threshold, and a task with a priority greater than or equal to the third priority threshold and having predetermined user information.

6. The resource allocation method according to any one of claims 1-3, wherein, The resource allocation strategy includes a memory bandwidth allocation strategy. The step of allocating resources to different users' tasks according to the priority and a preset resource allocation strategy, matching the priority with the available resources, includes: For the memory accessed by the many-core chip, obtain time slices obtained by pre-dividing the interface access time of the memory; The allocated time slices are assigned to the fourth predetermined task for data transmission of the fourth predetermined task using the allocated time slices. The fourth predetermined task is one of the following tasks that need to be processed in the many-core chip: a task with a priority greater than or equal to the fourth priority threshold, and a task with a priority greater than or equal to the fourth priority threshold and having predetermined user information.

7. The resource allocation method according to any one of claims 1-3, wherein, When the number of tasks to be processed is greater than 1, the resource allocation strategy includes an in-core job task strategy; the step of allocating resources to different users' tasks according to the priority and the preset resource allocation strategy, matching the priority with the priority, includes: Obtain the user information to which each task needs to be processed belongs, so as to determine the user to which each task belongs; Based on the user level of the user to whom each task belongs, determine the priority of each task that matches the user level; For tasks with different user affiliation information, computing resources matching the user level are allocated to process the tasks according to the priority matching the user level.

8. The resource allocation method according to any one of claims 1-3, wherein, The resource allocation strategy includes a redundancy resource strategy; the process of allocating resources to different users' tasks according to the priority and the preset resource allocation strategy, matching the priority with the priority, includes: Based on the user information of the task to be processed in the many-core chip, determine the user to whom the task to be processed belongs; Based on the user level of the user to which the task belongs, reserve redundant resources for the task to be processed. The redundant resources are additional resources that are directly proportional to the resources required for the maximum load operation of the task to be processed. Furthermore, the ratio of the redundant resources reserved for tasks with higher-level user affiliation information to the resources required for the maximum load operation of that task is greater than the ratio of the redundant resources reserved for tasks with lower-level user affiliation information to the resources required for the maximum load operation of that task. The user level of the higher-level user is higher than the user level of the lower-level user.

9. The resource allocation method according to any one of claims 1-3, wherein, The resource allocation strategy includes a resource preemption strategy; the process of allocating resources to different users' tasks according to the priority and the preset resource allocation strategy, matching the priority with the priority, includes: In the acquired tasks that need to be processed, the processing procedure for the fifth predetermined task is set to allow the use of at least a portion of the resources of the sixth predetermined task; And set the execution of the sixth predetermined task to be temporarily suspended; The user level of the user to whom the fifth predetermined task is assigned is higher than the user level of the user to whom the sixth predetermined task is assigned.

10. The resource allocation method according to claim 9, wherein, The process of setting the fifth predetermined task allows the use of at least a portion of the resources of the sixth predetermined task, including: Release at least a portion of the resources pre-allocated to the sixth predetermined task; The released resources will be allocated to the fifth predetermined task.

11. A resource allocation device, the device being applied to a many-core chip, comprising: The acquisition module is used to acquire the priority of the tasks to be processed in the many-core chip; wherein, when the tasks have different user information, the priorities of the tasks are different, and the user information is used to identify the user to which the task belongs. The allocation module is used to allocate resources to different users' tasks according to the priority and the preset resource allocation strategy, matching the priority. The resource allocation strategy includes at least one of the following: Routing allocation strategy, memory bandwidth allocation strategy, in-kernel job task strategy, redundancy resource strategy, and resource preemption strategy; among them, The routing allocation strategy includes at least one of the following strategies: time allocation strategy, space allocation strategy, and routing node buffering strategy; The resource allocation strategy includes a time allocation strategy, and the allocation module is specifically used for: Of all the routing paths involved in task processing within the many-core chip, a predetermined usage time period for at least a portion of the routing paths is allocated to a first predetermined task, so that data transmission for the first predetermined task is performed using the at least a portion of the routing paths within the predetermined usage time period; wherein... The first predetermined task is one of the following tasks that need to be processed in the many-core chip: a task with a priority greater than or equal to a first priority threshold, and a task with a priority greater than or equal to the first priority threshold and having predetermined user information.

12. A processing core comprising the resource allocation device of claim 11.

13. An electronic device, comprising: Multiple processing cores; as well as The on-chip network is configured to interact with data between multiple processing cores and external data; One or more of the processing cores store one or more instructions, which are executed by one or more of the processing cores to enable the one or more processing cores to perform the resource allocation method of any one of claims 1-10.

14. A computer-readable medium having a computer program stored thereon, wherein, The computer program, when executed by the processing core, implements the resource allocation method as described in any one of claims 1-10.

Citation Information

Patent Citations

  • Priority-based deep learning task scheduling method and device

    CN110780991A