Static relay-based neuron operating system task resource configuration method and device
By using a static relay scheme for task resource allocation, the problem of uneven resource distribution in neural computers is solved, achieving efficient resource management and multi-task parallel processing, and improving resource utilization.
Patent Information
- Application Number
- CN202211612049.3
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2022-12-15
- Publication Date
- 2026-11-24
- Estimated Expiration
- 2042-12-15
AI Technical Summary
Existing technologies struggle to effectively manage task resource allocation for large-scale computing resources in neural computers, resulting in uneven resource distribution and high fragmentation rates, which fails to meet the demands of multi-task parallel processing.
A task resource allocation method based on static relays for the neural operating system is adopted. Through task queue classification management, static relay configuration, computing resource allocation and reclamation, combined with hardware constraints, efficient allocation and reclamation of resources are achieved.
Under hardware constraints, timely task allocation and efficient resource recycling were achieved, reducing resource fragmentation, supporting multi-task parallel processing, and improving resource utilization.
Smart Images

Figure CN116225689B_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of neural computer operating system technology, and in particular to a method and apparatus for configuring task resources in a neural operating system based on static relays. Background Technology
[0002] In recent years, artificial intelligence (AI) applications, such as facial recognition, autonomous driving, machine translation, and video processing, have gradually become more widespread. A significant characteristic of AI applications is the massive processing and computation of large-scale data. Ordinary general-purpose CPUs have limited computing power, making it difficult to support AI applications that require powerful processing capabilities. Therefore, various specialized hardware for AI have emerged, such as GPGPUs, TPUs, and neural network computers.
[0003] Chinese patent CN102629218A discloses a method for preventing reconfigurable hardware tasks based on task aspect ratio. This method places tasks according to the aspect ratio information of the resources they occupy, reducing the probability of task-task conflicts and improving resource utilization. Based on the aforementioned patent and related prior art, current resource management inventions are mainly applied to reconfigurable hardware such as FPGAs. This type of hardware is generally a single chip with a relatively fixed number and layout of resources. In contrast, neural network computers possess large-scale computing resources, with scalable resource quantity and flexible resource layout, while also being limited by the maximum number of communication nodes between neurons.
[0004] Neuronal computing is a major research direction in the field of artificial intelligence computing. The human brain is composed of a large number of neurons connected by synapses, enabling complex information processing. Neuronal computing combines research in neuroscience and bionics, applying the characteristics of the biological brain's neural network to computer systems, using the computing power provided by neuromorphic chips to support the operation of the neural network. The operation of the neural network in the neuronal computer operating system can be abstracted as the execution of tasks. As the manager of computing resources, the neuronal computer operating system needs to provide resource allocation methods based on the characteristics of the chip's computing resources and the task to meet the task requirements.
[0005] A single neuromorphic chip consists of an m*n core two-dimensional mesh structure. Each core can simulate multiple neurons. Several chips are connected together in a two-dimensional array via an on-chip network to form a single computing node. Multiple computing nodes are connected together via Ethernet or other means to form a neuronal computer, creating a larger-scale two-dimensional mesh structure. However, the chip is subject to specific hardware constraints.
[0006] Neuron computers possess massive computing resources. Furthermore, as multitasking systems, each task requires a certain amount of neuron computing resources (chip cores). Each task has its own lifecycle, comprising three phases: creation, execution, and destruction. After task creation, computing resources are allocated; after task destruction, the operating system releases the computing resources used by the task; during task execution, tasks can also actively request or release computing resources. Therefore, a task resource allocation method that satisfies hardware constraints is needed to improve resource allocation efficiency. Summary of the Invention
[0007] To address the shortcomings of existing technologies and achieve the goals of task resource allocation, reclamation, and idle resource management based on a static relay scheme, this invention adopts the following technical solution: A task resource allocation method for a neuromorphic operating system based on static relays uses the core as the basic computing unit and constructs a two-dimensional mesh structure for the neuromorphic chip as an on-chip network. The cores are connected through the on-chip network to communicate with each other. External data reaches the edge cores of the neuromorphic chip through pins, and the edge cores send data to the internal cores through the on-chip network. The computing resources of the neuromorphic chip are abstracted into a two-dimensional matrix based on the two-dimensional mesh, including the following steps: Step S1: Classify and manage the task queue; Step S2: Static relay configuration. Based on the maximum number of relay entries supported by a single core, relay units are divided on a two-dimensional matrix. Relay paths are selected for each relay unit using reverse paths. The state of the relay core is only used for relay forwarding. Step S3: Calculate resource allocation, divide available resources into non-overlapping empty rectangles, and maintain a list of empty rectangles. Resource allocation selects the empty rectangle with the largest adjacency value with other tasks to place tasks, reducing the gap between tasks and reducing fragmentation rate. Step S4: Calculate resource recovery.
[0008] Furthermore, in step S1, since the main users of the computing resources in this invention are tasks, and the arrival time, execution time, required resources, and number of tasks are all uncertain, there may be situations where tasks cannot be allocated available resources when resources are limited. This invention requires all tasks to run even when the task start execution time is delayed to a certain extent. Multi-task parallelism requires classifying and managing tasks according to their status, and also requires the support of a task scheduler. To achieve this classification and management, this invention maintains four types of task queues based on task status: a new queue (new list), a delayed queue (delay list), a ready queue (ready list), and a running queue (running list). The new queue, new list, is used to place newly added tasks; The delay list is used to place tasks to be scheduled and processed; The ready queue is used to place ready tasks, which is the sum of the new queue and the delayed queue. The running list is used to store running tasks, that is, tasks allocated to resources; Upon arrival of a new task, it is first added to a new queue (new list). Changes to the new queue (new list) update the ready queue. Resources matching the criteria are searched from the largest empty list in the two-dimensional matrix. If resource allocation is successful, the task is added to the running queue (running list); if allocation fails, it is added to the ready queue (ready list). Based on the time the task was added to the running queue and its runtime, upon task completion, the task is removed from the running queue (running list). Simultaneously, the delayed queue (delay list) is checked, the ready queue (ready list) is updated, and resource allocation is performed.
[0009] Furthermore, in step S2, the following hardware constraints exist during data transmission through the chip: 1. The distance of a single data packet transmission is limited, with the maximum relative node coordinate range ≤ ±n, where n ≤ N; 2. If the distance of a single data packet transmission exceeds m, it needs to be forwarded via a relay. 3. The cores on the chip can be used as relays to forward data. Cores configured as relays cannot be used as computing cores. That is, each core can only be used as a computing core or a relay core. 4. After the core acts as a relay, due to memory limitations, the routing table size is limited, and the maximum number of core destination addresses that can be calculated and forwarded through the relay core is N.
[0010] Further, in step S2, external data is input into a two-dimensional matrix from the left. The basic relay unit is a matrix composed of m*m cores. Cores within a range of m hops from the left input do not require relaying. Starting from the right side of the two-dimensional matrix in the opposite direction of the input, a reverse relay path is specified hop by hop. The determination of the relay path includes the following steps: Step S2.1: Starting from the opposite direction of the two-dimensional matrix input, from right to left and from top to bottom, divide the relay units into m*m units until no relay units are needed. Step S2.2: For a relay unit where some cores are relays and some cores are not relays, the m*m region is still treated as a relay unit, consistent with other relay units, so that the same algorithm can be used when performing calculations and searching paths. Step S2.3: After the relay unit is divided, find the reverse relay path for each relay unit and take the upper right corner core of the adjacent relay unit as the first relay core of this relay unit. Step S2.4: After selecting the first relay core, search for other relay cores based on the maximum number of relay entries supported by a single core, until the last relay core is within the range of the maximum number of relay entries from the edge; Step S2.5: After steps S2.1 to S2.4, a relay path is assigned to each relay unit. When a data packet arrives at the core of the relay unit, the data is forwarded along the relay path. Step S2.6: Change the relay core status to non-resource allocation status.
[0011] Furthermore, in step S3, when adding or deleting tasks, the available area of resources changes, and the empty rectangle list is updated; when adding a task, a rectangle whose size meets the task requirements is found from the rectangle list, the task is placed, the resource status is updated, and the rectangle list is updated; when deleting a task, resources are released, and if multiple small rectangles can be merged into a large rectangle, they are merged to avoid fragmentation.
[0012] Further, step S3 includes the following steps: Step S3.1: Based on the relay unit, cut the region of the computing core into overlapping rectangles and maintain an initial list of maximum empty rectangles; Step S3.2: Find the first available empty rectangle, and determine whether the height and width of the empty rectangle meet the requirements of the task rectangle. If they do, proceed to step S3.3; otherwise, proceed to step S3.4. Step S3.3: Place the task rectangle at the four vertices of the empty rectangle in sequence, and calculate the adjacency value between the task rectangle and the running task, that is, the adjacency value with the edge of the two-dimensional matrix. Step S3.4: Select the vertex with the largest adjacency value in step S3.3 as the point where the task rectangle is expected to be placed, and record it. Determine whether the largest adjacency value in step S3.3 is greater than the existing largest adjacency value. If it is greater, update the adjacency value and the corresponding largest empty rectangle; if it is less than or equal to, proceed to step S3.5. Step S3.5: Determine if there exists a maximum empty rectangle with the largest adjacency value. If it exists, the resource allocation is successful, and the list of maximum empty rectangles is updated; otherwise, the resource allocation fails.
[0013] Furthermore, in step S3.4, after updating the adjacency value and the corresponding maximum empty rectangle, it is then determined whether there is a next maximum empty rectangle. If there is, the next maximum empty rectangle is found and step S3.2 is executed again; otherwise, step S3.5 is executed.
[0014] Furthermore, in step S1, a running queue and a delay queue are maintained according to the task status; in step S3.5, if the resource allocation is successful, the resource is added to the running queue; otherwise, if the resource allocation fails, the resource is added to the delay queue.
[0015] Further, step S4 includes the following steps: Step S4.1: Locate the resources used by the task; Step S4.2: Reclaim the resources occupied by the task and update the status of the resources occupied by the task; Step S4.3: If new free resources are added in step S4.2, update the list of maximum empty rectangles; Step S4.4: Remove completed tasks from the running list; Step S4.5: After resource reclamation, the idle resources change. There are tasks that failed to allocate resources before or new tasks have arrived. Therefore, it is necessary to update the ready queue according to the new queue new list and the delayed queue delayed list, and wait for the scheduler to schedule tasks and allocate resources.
[0016] A task resource configuration device for a neural operating system based on static relays includes a memory and one or more processors. The memory stores executable code, and when the one or more processors execute the executable code, they implement the task resource configuration method for a neural operating system based on static relays.
[0017] The advantages and beneficial effects of this invention are as follows: The present invention relates to a method and apparatus for configuring task resources in a neural operating system based on static relay. According to the resource hardware constraints provided by the neural computer, a static relay scheme is used to specify data paths for all cores in the chip, solving the problem that data packets cannot reach the destination if they exceed a certain distance. Based on the static relay scheme, idle resources are managed by maintaining a list of maximum empty rectangles, realizing the functions of resource allocation when a task is woken up by the scheduler and resource reclamation when a task reaches its deadline. Attached Figure Description
[0018] Figure 1 This is a schematic diagram illustrating the switching of tasks between different queues in an embodiment of the present invention.
[0019] Figure 2 This is a schematic diagram illustrating the abstraction of computing resources in an embodiment of the present invention.
[0020] Figure 3 This is a diagram of a static relay scheme in an embodiment of the present invention.
[0021] Figure 4 This is a flowchart illustrating the resource allocation process in an embodiment of the present invention.
[0022] Figure 5a This is a schematic diagram illustrating the maintenance of multiple empty rectangles with remaining available resources after placing two tasks in an embodiment of the present invention.
[0023] The process of selecting an empty rectangle to place the vertices of the task is shown in the diagram.
[0024] Figure 5b This is a schematic diagram of selecting an empty rectangle to place the task in an embodiment of the present invention.
[0025] Figure 5c This is a schematic diagram of task T3 placed at the top left corner of an empty rectangle in an embodiment of the present invention.
[0026] Figure 5d This is a schematic diagram of task T3 placed at the lower left corner vertex of an empty rectangle in an embodiment of the present invention.
[0027] Figure 5e This is a schematic diagram of task T3 placed at the upper right corner vertex of an empty rectangle in an embodiment of the present invention.
[0028] Figure 5f This is a schematic diagram of task T3 placed at the lower right corner vertex of an empty rectangle in an embodiment of the present invention.
[0029] Figure 6 This is a flowchart illustrating the resource recycling process in an embodiment of the present invention.
[0030] Figure 7 This is a schematic diagram of the device in an embodiment of the present invention. Detailed Implementation
[0031] The specific embodiments of the present invention will be described in detail below with reference to the accompanying drawings. It should be understood that the specific embodiments described herein are for illustration and explanation only and are not intended to limit the present invention.
[0032] The task resource allocation method for the neural operating system based on static relay mainly includes: allocating computing resources to tasks, reclaiming resources after task execution, and managing idle resources. Considering hardware limitations, it is necessary to solve the problem of reaching core computing data packets. Furthermore, considering multi-task scenarios, task classification management is required. Therefore, this invention divides the resource allocation method for computing tasks into five parts for classified management, as follows: Part 1: Task Queue Classification and Management; Part Two: Static Relay Configuration; Part Three: Allocation of Computing Resources; Part Four: Computational Resource Recovery.
[0033] Part 1: Task Queue Classification and Management.
[0034] In this invention, the primary users of computing resources are tasks. However, the arrival time, execution time, required resources, and number of tasks are all uncertain. Therefore, under limited resource conditions, situations may arise where tasks cannot be allocated available resources. This invention requires all tasks to run, even with a certain degree of delay in task start execution time. Multi-task parallelism requires task classification and management based on task status, and also necessitates the support of a task scheduler. Task classification and management is a prerequisite for resource allocation; therefore, task classification and management will be explained first to illustrate the resource allocation process. The scheduler is the decision-maker for applying the resource allocation process to specific tasks but does not affect the resource allocation process itself; therefore, the scheduler will not be discussed in detail.
[0035] To achieve categorized management of tasks, this invention maintains four types of task queues based on task status. The descriptions of the four types of task queues are as follows: New list: Used to store newly added tasks. New tasks arrive and are added to the new list. Delay list: Used to store tasks awaiting scheduling and processing. Tasks in the ready list are added to the delay list due to resource shortages or other reasons while processing. The ready list is used to store ready tasks. It is the sum of tasks in the new list and the delay list. Running list: Used to store running tasks, that is, tasks allocated to resources.
[0036] When a new task arrives, it is first added to the new list queue. If the new list queue changes, the ready queue is updated, and a resource matching the criteria is searched from the current largest empty matrix list. If resource allocation is successful, the task is added to the running queue; if allocation fails, it is added to the ready queue. Based on the time the task was added to the running queue and its runtime, the task is removed from the running list upon completion. Simultaneously, the delay list is checked, the ready list is updated, and resource allocation is performed. Tasks switch between different queues, such as... Figure 1 As shown.
[0037] Part Two: Static Relay Configuration
[0038] In this invention, the resources used for computational tasks refer to the computational resources provided by the neuromorphic chip. The neuromorphic chip consists of an m*n core two-dimensional grid structure, with each core containing a certain number of neurons and synapses, serving as the basic physical unit for neural network computation. Based on the two-dimensional distribution characteristics of the neuromorphic chip, the core is used as the basic unit, and the computational resources provided by the chip are abstracted into a two-dimensional matrix, such as... Figure 2 The image shows the abstracted resource.
[0039] The cores within the chip are interconnected via an on-chip network, enabling communication between them. External data reaches the chip's edge cores via pins, and the edge cores then transmit the data to the internal cores via the on-chip network. During data transmission within the chip, the following hardware constraints apply: 1. The distance of a single data packet transmission is limited, with the maximum relative node coordinate range ≤ ±15; 2. If the distance of a single data packet transmission exceeds 15, it needs to be forwarded via a relay. 3. Cores on the chip can be used as relays to forward data. Cores configured as relays cannot be used as computing cores. That is, each core can only be used as a computing core or a relay core. 4. After the core acts as a relay, due to memory limitations, the routing table size is limited, and the maximum number of target addresses that can be calculated by routing through the relay core is 64.
[0040] During computation, all computing nodes need to receive external data packets. However, the distance for sending data packets is limited by the hardware design; beyond this distance, data packets need to be forwarded through relay nodes. Therefore, it is necessary to design externally reachable relay paths for all running computing nodes while meeting hardware limitations.
[0041] This patent uses a static relay scheme to overcome hardware limitations. Figure 3 The diagram shows a static relay scheme. Based on the relay capability of neuron nodes, i.e., the maximum number of computational core target addresses forwarded through the relay core routing is 64, an 8*8 two-dimensional core area is used as a basic relay unit. A specific relay path is selected for each relay unit using a reverse path approach. Relay nodes are only used for communication between nodes and do not participate in dynamic resource allocation. Figure 3 For example, external data is input from the left. Cores within 15 hops of the left input do not require relays. Therefore, starting from the right in the opposite direction of the input, a reverse relay path is specified hop by hop. The steps to determine the relay path are as follows, combined with... Figure 3 illustrate. Figure 3The small squares represent the core, and the large squares represent the relay units. Each relay unit consists of 8*8 core squares. The black squares represent the cores used for relaying.
[0042] Step S2.1: First, divide the relay units along the opposite direction of the horizontal axis X (to the left), and then along the positive direction of the vertical axis Y (downward), using an 8*8 grid, until no relays are needed; Step S2.2: In step S2.1, when approaching the 15-hop range of an edge, there may be a situation where some cores within a relay unit require relaying, while others do not. In this case, the 8*8 area is still treated as a basic unit, consistent with other relay units, to facilitate using the same algorithm during computation and path finding. Step S2.3: After dividing the relay units, find the reverse relay path for each relay unit. Select the top right corner core of the adjacent relay unit as the first relay core of this relay unit. For example... Figure 3 As shown; Step S2.4: After selecting the first relay core, search for other relay cores within a maximum range of 15 hops until the last relay core is within a range of 15 hops from the edge. Step S2.5: Following steps S2.1 to S2.4 above, a specific relay path is assigned to each relay unit. When a data packet needs to reach the core of the relay unit, the data is forwarded along the relay path. Step S2.6: Change the relay core status to unavailable, meaning it cannot be used for resource allocation.
[0043] Part Three: Allocation of Computing Resources.
[0044] After relay nodes are assigned, resource allocation is performed. The resources required for the computation task are represented by a rectangle containing multiple computational cores. The resources of a neuron computer are also abstracted as a two-dimensional matrix. Therefore, allocating resources to the task involves finding the resource blocks that satisfy the computational task's requirements within the two-dimensional core matrix. This invention utilizes the maximum empty rectangle algorithm to achieve resource allocation and recycling.
[0045] Available resources are divided into non-overlapping empty rectangles, and a list of empty rectangles is maintained. When a task is added or deleted, the available area of the resource changes, and the list of empty rectangles is updated. When a task is added, a rectangle whose size meets the task requirements is found from the rectangle list, the task is placed, the resource status is updated, and the rectangle list is updated. When a task is deleted, the resource is released. If multiple small rectangles can be merged into one large rectangle, they are merged to avoid fragmentation.
[0046] Each empty rectangle is identified using the following quadruple: [ , , ] The parameters are described as follows: : Represents the x-coordinate of the top-left vertex of the empty rectangle; : Represents the y-coordinate of the top-left vertex of the empty rectangle; : Represents the x-coordinate of the bottom right vertex of the empty rectangle; : Represents the y-coordinate of the bottom right vertex of the empty rectangle.
[0047] Resource allocation selects empty rectangles with the largest adjacency values to other tasks, placing tasks to reduce gaps between tasks and thus reduce fragmentation. Figure 4 As shown, the specific process is as follows: (1) Based on the relay core reserved in Part 2, the calculation core region is cut into overlapping rectangles in the x and y directions respectively, and an initial list of maximum empty rectangles is maintained. Figures 5a to 5f As shown, the small black squares represent relay cores, the small white squares represent computing cores, and the rectangle outlined by the black lines is the largest empty rectangle. (2) Find the first available empty rectangle; (3) Determine whether the height and width of the empty rectangle meet the requirements of the task. If the conditions are met, execute (4); if the conditions are not met, execute (6). (4) Place the task rectangles at the four vertices of the empty rectangle in sequence, and calculate the adjacency values with the running task, i.e., the adjacency values with the edges. (5) Select the vertex with the largest adjacency value in (4) as the point where the task is to be placed, and record it; (6) Determine whether the adjacency value in (4) is greater than the existing maximum adjacency value. If it is greater, execute (7); if it is less than or equal to, execute (8). (7) Update the adjacency values and the corresponding maximum empty rectangle; (8) Determine if the next largest empty rectangle exists. If it exists, execute (9); if it does not exist, execute (10). (9) Find the next largest empty rectangle and repeat (3); (10) Does the empty rectangle with the maximum adjacent value exist? If it does, then execute (11); if it does not exist, then execute (12). (11) Resource allocation successful, update the list of largest empty rectangles and add it to the running queue; (12) Resource allocation failed, add to delay queue.
[0048] In this embodiment of the invention, the vertex selection process for the empty rectangle placement task is as follows: Figures 5a to 5f As shown: Step 1: Figure 5a After placing two tasks in a 2D resource region, the remaining available resources are managed according to the maximum empty rectangle rule, and maintained as multiple empty rectangles. In the diagram, the small black squares represent relay cores, which cannot be used as computing cores allocated to tasks; the areas enclosed by dashed rectangles represent the maximum overlappable empty matrices; areas filled with other patterns indicate that tasks are running in that area.
[0049] Step 2: The scheduler schedules task T3 and selects an empty rectangle that meets the criteria to place the task. The empty rectangles marked by dashed lines in Figure 5-b illustrate how to select an empty rectangle to place the vertices of the task. Step 3: In Figure 5-c, task T3 is placed at the top left vertex of the empty rectangle ( , T3 is adjacent to task T1, with an adjacency value of 3.
[0050] Step 4: In Figure 5-d, task T3 is placed at the bottom left vertex of the empty rectangle ( , T3 is adjacent to both tasks T1 and T2, with an adjacency value of 7.
[0051] Step 5: In Figure 5-e, task T3 is placed at the top right corner of the empty rectangle ( , T3 is not adjacent to any other task, so its adjacency value is 0.
[0052] Step Six: In Figure 5-f, task T3 is placed at the bottom right vertex of the empty rectangle ( , T3 is not adjacent to any other task, so its adjacency value is 0.
[0053] Step 7: Place T3 at the bottom left corner vertex ( , When the adjacency value with other tasks is the largest, this vertex of the empty rectangle is selected as the expected placement position of the task.
[0054] Part Four: Computational Resource Recovery.
[0055] The task is assigned to computing resources, runs for a period of time, reaches its deadline, terminates, and the resources are reclaimed. The specific process is as follows: Figure 6 As shown: Step S4.1: Locate the resources used by the task; Step S4.2: Reclaim the resources occupied by the task and update the status of the resources occupied by the task; Step S4.3: In step S4.2, new free resources were added, and the list of maximum empty rectangles was updated; Step S4.4: The task has finished running, its status has changed, and it has been removed from the running queue; Step S4.5: After resource reclamation, the idle resources change. Tasks that previously failed to allocate resources or new tasks have arrived. Therefore, the ready list needs to be updated according to the new list and delay list, waiting for the scheduler to schedule tasks and allocate resources.
[0056] The implementation methods for this part are similar to those for the methods described above, and will not be repeated here.
[0057] Corresponding to the aforementioned embodiments of the task resource configuration method for a neural operating system based on static relays, the present invention also provides embodiments of a task resource configuration device for a neural operating system based on static relays.
[0058] See Figure 7 The neural operating system task resource configuration device based on static relay provided in this embodiment of the invention includes a memory and one or more processors. The memory stores executable code. When the one or more processors execute the executable code, they are used to implement the neural operating system task resource configuration method based on static relay in the above embodiment.
[0059] The embodiment of the task resource allocation device for the neural operating system based on static relay of the present invention can be applied to any device with data processing capabilities, such as a computer. The device embodiment can be implemented in software, hardware, or a combination of both. Taking software implementation as an example, as a logical device, it is formed by the processor of any data processing device loading the corresponding computer program instructions from non-volatile memory into memory for execution. From a hardware perspective, such as... Figure 7 The diagram shown is a hardware structure diagram of any data processing-capable device where the task resource allocation device of the neural operating system based on static relay of the present invention is located. Except for... Figure 7 In addition to the processor, memory, network interface, and non-volatile memory shown, any data processing device in the embodiment may also include other hardware depending on the actual function of the data processing device, which will not be described in detail here.
[0060] The specific implementation process of the functions and roles of each unit in the above device can be found in the implementation process of the corresponding steps in the above method, and will not be repeated here.
[0061] For the device embodiments, since they basically correspond to the method embodiments, the relevant parts can be referred to in the description of the method embodiments. The device embodiments described above are merely illustrative. The units described as separate components may or may not be physically separate, and the components shown as units may or may not be physical units, that is, they may be located in one place or distributed across multiple network units. Some or all of the modules can be selected to achieve the purpose of the present invention according to actual needs. Those skilled in the art can understand and implement this without creative effort.
[0062] This invention also provides a computer-readable storage medium storing a program that, when executed by a processor, implements the task resource allocation method for a neural operating system based on static relays described in the above embodiments.
[0063] The computer-readable storage medium can be an internal storage unit of any data processing device described in any of the foregoing embodiments, such as a hard disk or memory. The computer-readable storage medium can also be an external storage device of any data processing device, such as a plug-in hard disk, smart media card (SMC), SD card, flash card, etc., equipped on the device. Furthermore, the computer-readable storage medium can include both internal storage units and external storage devices of any data processing device. The computer-readable storage medium is used to store the computer program and other programs and data required by the data processing device, and can also be used to temporarily store data that has been output or will be output.
[0064] The above embodiments are only used to illustrate the technical solutions of the present invention, and are not intended to limit it. Although the present invention has been described in detail with reference to the foregoing embodiments, those skilled in the art should understand that modifications can still be made to the technical solutions described in the foregoing embodiments, or equivalent substitutions can be made to some or all of the technical features therein. Such modifications or substitutions do not cause the essence of the corresponding technical solutions to deviate from the scope of the technical solutions of the embodiments of the present invention.
Claims
1. A task resource allocation method for a neuromorphic operating system based on static relays, using the core as the basic computing unit, constructing a two-dimensional mesh structure of a neuromorphic chip as an on-chip network, with cores connected through the on-chip network for communication between cores, external data reaching the edge cores of the neuromorphic chip through pins, and the edge cores sending data to the internal cores through the on-chip network, abstracting the computing resources of the neuromorphic chip into a two-dimensional matrix based on the two-dimensional mesh, characterized in that... Includes the following steps: Step S1: Task queue classification and management; Step S2: Static relay configuration. Based on the maximum number of relay entries supported by a single core, relay units are divided on a two-dimensional matrix. A relay path is selected for each relay unit using a reverse path approach. The state of the relay core is only used for relay forwarding. Specifically, this includes: External data is input from the left side into a two-dimensional matrix. The basic relay unit is a matrix composed of m*m cores. Cores within m hops of the left input do not require relays. Starting from the right side of the two-dimensional matrix in the opposite direction of the input, a reverse relay path is specified hop by hop. The determination of the relay path includes the following steps: Step S2.1: Starting from the opposite direction of the two-dimensional matrix input, from right to left and from top to bottom, divide the relay units into m*m units until no relay units are needed. Step S2.2: For a relay unit where some cores are relays and some cores are not relays, the m*m area is still treated as a relay unit. Step S2.3: After the relay unit is divided, find the reverse relay path for each relay unit and take the upper right corner core of the adjacent relay unit as the first relay core of this relay unit. Step S2.4: After selecting the first relay core, search for other relay cores based on the maximum number of relay entries supported by a single core, until the last relay core is within the range of the maximum number of relay entries from the edge; Step S2.5: After steps S2.1 to S2.4, a relay path is assigned to each relay unit. When a data packet arrives at the core of the relay unit, the data is forwarded along the relay path. Step S2.6: Change the relay core status to non-resource allocation status; Step S3: Calculate resource allocation, divide available resources into overlapping empty rectangles, maintain a list of empty rectangles, and select the empty rectangle with the largest adjacency value to place the task in the resource allocation; Step S4: Calculate resource recovery.
2. The method for configuring task resources in a neural operating system based on static relays according to claim 1, characterized in that: In step S1, four types of task queues are maintained according to the task status, including: new queue, delayed queue, ready queue, and running queue. The new queue, new list, is used to place newly added tasks; The delay list is used to place tasks to be scheduled and processed; The ready queue is used to place ready tasks, which is the sum of the new queue and the delayed queue. The running list is used to store running tasks, that is, tasks allocated to resources; When a new task arrives, it is first added to a new queue (new list). Changes to the new queue (new list) update the ready queue. Resources matching the criteria are searched from the current largest empty matrix list in the two-dimensional matrix. If resource allocation is successful, the task is added to the running queue (running list). If allocation fails, the task is added to the ready queue (ready list). Based on the time the task was added to the running queue (running list) and its runtime, the task is removed from the running queue (running list) upon completion. Simultaneously, the delayed queue (delay list) is checked, the ready queue (ready list) is updated, and resource allocation is performed.
3. The method for configuring task resources in a neural operating system based on static relays according to claim 1, characterized in that: In step S2, the following hardware constraints exist during data transmission through the chip:
1. The distance of a single data packet transmission is limited, with the maximum relative node coordinate range ≤ ±n, where n ≤ N; 2. If the distance of a single data packet transmission exceeds m, it needs to be forwarded via a relay.
3. Cores on a chip can act as relays to forward data, but cores configured as relays cannot act as computing cores.
4. After the core acts as a relay, the maximum number of core destination addresses that can be forwarded through the relay core is N.
4. The method for configuring task resources in a neural operating system based on static relays according to claim 1, characterized in that: In step S3, when adding or deleting a task, the available area of the resource changes, and the empty rectangle list is updated; when adding a task, a rectangle whose size meets the task requirements is found from the rectangle list, the task is placed, the resource status is updated, and the rectangle list is updated; when deleting a task, the resource is released, and if multiple small rectangles can be merged into one large rectangle, they are merged.
5. The method for configuring task resources in a neural operating system based on static relays according to claim 2, characterized in that: Step S4 includes the following steps: Step S4.1: Locate the resources used by the task; Step S4.2: Reclaim the resources occupied by the task and update the status of the resources occupied by the task; Step S4.3: If new free resources are added in step S4.2, update the list of maximum empty rectangles; Step S4.4: Remove completed tasks from the running list; Step S4.5: After reclaiming resources, update the ready queue according to the new queue new list and the delayed queue delayed list, and wait for the scheduler to schedule tasks and allocate resources.
6. A task resource allocation device for a neural operating system based on static relays, characterized in that, The system includes a memory and one or more processors, wherein the memory stores executable code, and the one or more processors execute the executable code to implement the task resource allocation method for a neural operating system based on static relay as described in any one of claims 1-5.
Citation Information
Patent Citations
Reconfigurable hardware task fit method based on length to width ratios of tasks
CN102629218A
