Method, system, and storage medium for load balancing of neuron computer nodes
Patent Information
- Application Number
- CN202310669851.4
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2023-06-07
- Publication Date
- 2026-11-03
- Estimated Expiration
- 2043-06-07
AI Technical Summary
In neural network computer systems, insufficient load information makes it difficult to make node load balancing decisions, thus hindering the achievement of optimal application deployment decisions.
By generating a dynamic resource feature matrix of nodes, the fitness value and allocability coefficient are calculated using the particle swarm optimization algorithm to determine the deployment nodes of the application to be deployed, and load balancing decisions are made by integrating multiple load information.
It improves the resource utilization and load balancing reliability of the neural network computer system, and solves the problem of difficulty in node load balancing decision-making caused by insufficient load information description.
Smart Images

Figure CN116541177B_ABST
Abstract
Description
Technical Field
[0001] This application relates to the field of neural computer technology, and in particular to a method for load balancing neural computer nodes, a neural computer system, and a computer storage medium. Background Technology
[0002] In common distributed computing systems, the load status of each node is updated before load balancing decisions are made. The load balancing algorithm makes load balancing decisions based on the load status, and all computing resources and load statuses mounted on each node must keep the information synchronized.
[0003] However, when the computing resources are NPU (Neural Processing Unit) multi-core processor arrays, especially in neural computer systems with microkernels as NPU computing units, the computation of neural network applications is bound to the distribution area of specific NPU units, and the shape of the NPU core resource area required by the application is also limited by the relative physical location. The load area information and idle area information of the NPU core array are key features for load decision-making. These features determine the allocatability of application deployment and the reachability of communication networks. In the existing technology, the load information only indicates the occupied and unoccupied state of the NPU core resources on the node. For the various placements of application deployments in the unoccupied resource space, it may be difficult to obtain the optimal deployment decision, making the node load balancing process difficult and bringing about a complex load information processing process. Summary of the Invention
[0004] Therefore, it is necessary to provide a method, a neural computer system, and a computer storage medium for load balancing nodes in a neural computer that can solve the problem of difficulty in making node load balancing decisions due to insufficient load information description in the neural computer.
[0005] In a first aspect, this application provides a method for load balancing of neural computer nodes, the method comprising:
[0006] Based on the resource occupancy status of the processor cores on each node, a dynamic resource feature matrix for each node is generated.
[0007] Based on the resource dynamic feature matrix, obtain the placement scheme on each node that matches the resource format required by the application to be deployed, and calculate the fitness value of each placement scheme.
[0008] Based on the fitness value, the maximum fitness value of each node is obtained, and the corresponding assignability coefficient is calculated;
[0009] Based on the allocatable coefficient, the deployment node of the application to be deployed is determined.
[0010] In one embodiment, generating a dynamic resource feature matrix for each node based on the resource occupancy status of the processor cores on each node includes:
[0011] Obtain the resource occupancy status of the processor cores on the node, wherein the resource occupancy status includes two states: occupied and idle;
[0012] The resource occupancy status is abstracted into a two-dimensional matrix, and the distribution characteristics of the corresponding occupied cores and idle cores are extracted.
[0013] Based on the distribution characteristics, a dynamic resource feature matrix for the node is generated.
[0014] In one embodiment, the resource dynamic feature matrix includes the distance from occupied cores, the number of reachable boundary paths, and the hollow core feature. The distance from occupied cores represents the size of the free area at the location of a core. The number of reachable boundary paths represents the number of paths that a core can directly access the external network. The hollow core feature indicates that a core is an idle core, and there are at least two occupied cores in the adjacent positions of the core.
[0015] In one embodiment, based on the resource dynamic feature matrix, the placement scheme on each node that matches the resource format required by the application to be deployed is obtained, and the fitness value of each placement scheme is calculated, including:
[0016] Based on the shape of the resource format required by the application to be deployed, the matching filling location region is determined from the resource dynamic feature matrix of each node;
[0017] Based on the particle swarm optimization algorithm and the filling location region, the original position and original velocity of each search particle in the particle swarm optimization algorithm are determined, wherein the original position of each search particle corresponds one-to-one with the placement position of each placement scheme.
[0018] Based on the original position and original velocity of each search particle and the dynamic feature matrix of each resource, the fitness value of each placement scheme under each node is calculated.
[0019] In one embodiment, the fitness value of each placement scheme under each node is calculated based on the original position and original velocity of each search particle and the dynamic feature matrix of each resource, including:
[0020] Based on the original position and original velocity of each of the search particles, the corresponding lateral distance reduction degree, longitudinal distance reduction degree, number of reachable boundary paths, and void core features are obtained from each of the resource dynamic feature matrices.
[0021] Based on the degree of reduction in lateral distance, the degree of reduction in longitudinal distance, the number of reachable boundary paths, and the core characteristics of the void, the fitness value of each placement scheme under each node is calculated using the empirical coefficient of load balancing.
[0022] In one embodiment, based on the fitness value, obtaining the maximum fitness value of each node and calculating the corresponding assignability coefficient includes:
[0023] Based on the particle swarm optimization algorithm, the position and velocity of each search particle in the particle swarm optimization algorithm are updated;
[0024] Based on the fitness value and the updated positions and velocities of each of the search particles, the maximum fitness value of each node is obtained, and the corresponding assignability coefficient is calculated.
[0025] In one embodiment, based on the fitness value and the updated positions and velocities of each of the search particles, the maximum fitness value of each node is obtained, and the corresponding assignability coefficient is calculated, including:
[0026] Based on the fitness value and the updated position and velocity of each of the search particles, the maximum fitness value of each node is obtained;
[0027] Based on the maximum fitness value, the number of remaining idle cores of each node, the total number of remaining idle cores of all nodes, and the feedback experience coefficient of the load balancing, the allocatability coefficient corresponding to each node is calculated.
[0028] In one embodiment, the method further includes:
[0029] Based on the optimal placement scheme corresponding to the maximum fitness value, obtain the predicted load of the deployment node after the application to be deployed is executed;
[0030] Obtain the actual load status of the deployment node after the application to be deployed is executed;
[0031] Based on the predicted load and the actual load, deviation calculation is performed to obtain the deviation information of the load balancing, and the deviation information is fed back to the feedback experience coefficient of the load balancing.
[0032] Secondly, this application also provides a neural network computer system, which includes a neural network multi-core processor and an application to be deployed. The neural network multi-core processor uses a microkernel as the smallest unit for load balancing and is mounted on each node of the neural network computer system to execute the contents of the first aspect above and to perform deployment tasks on the application to be deployed.
[0033] Thirdly, this application also provides a computer-readable storage medium having a computer program stored thereon, which, when executed by a processor, implements the contents of the first aspect described above.
[0034] The aforementioned method for load balancing nodes in a neural computer, the neural computer system, and the computer storage medium generate a dynamic resource feature matrix for each node based on the resource occupancy status of the processor cores on each node. Based on the dynamic resource feature matrix, a placement scheme matching the resource format required by the application to be deployed on each node is obtained, and the fitness value of each placement scheme is calculated. Based on the fitness value, the maximum fitness value of each node is obtained, and the corresponding allocatable coefficient is calculated. Based on the allocatable coefficient, the deployment node of the application to be deployed is determined. By fusing multiple load information from the NPU core arrays of the chips on each node of the neural computer, the system can promptly assess the load status of each node and make load balancing decisions based on the node load status. This solves the problem of difficulty in node load balancing decisions caused by insufficient load information description in the prior art, and improves resource utilization and the reliability of load balancing. Attached Figure Description
[0035] Figure 1 This is a diagram illustrating the application environment of a neuronal computer system in one embodiment.
[0036] Figure 2 This is a flowchart illustrating a method for load balancing of neural computer nodes in one embodiment;
[0037] Figure 3 This is a flowchart illustrating the specific steps of S202 in one embodiment;
[0038] Figure 4 This is a flowchart illustrating the specific steps of S204 in one embodiment;
[0039] Figure 5 This is a schematic diagram of the process for calculating the fitness value in S406 in one embodiment;
[0040] Figure 6 This is a flowchart illustrating the specific steps of S206 in one embodiment;
[0041] Figure 7 This is a schematic diagram of the process for calculating the allocatable coefficients in S604 of one embodiment;
[0042] Figure 8 This is a schematic diagram of the process for adjusting the feedback experience coefficient after S208 in one embodiment;
[0043] Figure 9This is a schematic diagram of the structure of a single NPU processor core on each node in an example embodiment;
[0044] Figure 10 This is a schematic diagram illustrating the selection of the optimal placement scheme using a neuron-based computer node load balancing method in an example embodiment. Detailed Implementation
[0045] To make the objectives, technical solutions, and advantages of this application clearer, the following detailed description is provided in conjunction with the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are merely illustrative and not intended to limit the scope of this application.
[0046] like Figure 1 As shown in the figure, this application embodiment provides a neural network computer system. The system includes a neural network multi-core processor 101 and an application to be deployed 102. The neural network multi-core processor 101 uses a microkernel as the smallest unit for load balancing and is mounted on each node 103 of the neural network computer system. Based on the resource occupancy status of the processor cores of the neural network multi-core processor 101 on each node 103, a resource dynamic feature matrix is generated for each node 103. Based on the resource dynamic feature matrix, a placement scheme matching the resource format required by the application to be deployed 102 on each node 103 is obtained, and the fitness value of each placement scheme is calculated. Based on the fitness value, the maximum fitness value of each node 103 is obtained, and the corresponding allocatable coefficient is calculated. Based on the allocatable coefficient, the deployment node of the application to be deployed 102 is determined.
[0047] In one embodiment, such as Figure 2 As shown, a method for load balancing of neural computer nodes is provided, which is applied to... Figure 1 Taking the neural network computer system as an example, the following steps are included:
[0048] S202, Based on the resource occupancy status of the processor cores on each node, generate a dynamic resource feature matrix for each node.
[0049] The resource occupancy status includes two states: occupied and idle.
[0050] Specifically, the resource occupancy status of each individual processor core (i.e., microkernel) mounted on each node is obtained. Based on the occupied and idle states of each node's resource occupancy status, a dynamic resource feature matrix is generated for each node. The feature values of this dynamic resource matrix are positively correlated with the idle state of the node's resources; the feature values are maximized when all individual processor cores on the node are in an idle state.
[0051] S204. Based on the resource dynamic feature matrix, obtain the placement scheme on each node that matches the resource format required by the application to be deployed, and calculate the fitness value of each placement scheme.
[0052] Specifically, the application to be deployed has multiple possible placement schemes on each node's single processor core, and different placement schemes will have varying degrees of impact on the resource dynamic feature matrix. Using the initial state of each search particle in the particle swarm optimization algorithm, placement schemes matching the resource format required by the application to be deployed on each node are obtained, and the fitness value of each placement scheme is calculated.
[0053] S206, Based on the fitness value, obtain the maximum fitness value of each node and calculate the corresponding assignable coefficient.
[0054] Specifically, after calculating the fitness values of each placement scheme corresponding to the node in S204, the initial state of each search particle in the particle swarm optimization algorithm is updated, and the maximum fitness value and corresponding assignable coefficient of the placement scheme on the node are calculated.
[0055] S208, Based on the allocatable coefficient, determine the deployment node of the application to be deployed.
[0056] Specifically, based on the node's allocability coefficient, the node's load is calculated to determine the deployment node for the application to be deployed.
[0057] In the aforementioned method for load balancing nodes in a neural network computer, a dynamic resource feature matrix for each node is generated based on the resource occupancy status of the processor cores on each node. Based on this dynamic feature matrix, a placement scheme matching the resource format required by the application to be deployed on each node is obtained, and the fitness value of each placement scheme is calculated. Based on the fitness value, the maximum fitness value of each node is obtained, and the corresponding allocatable coefficient is calculated. Based on the allocatable coefficient, the deployment node for the application to be deployed is determined. By fusing various load information from the NPU core arrays of the chips on each node of the neural network computer, the load status of each node can be assessed in a timely manner, and load balancing decisions can be made based on the node load status. This solves the problem of difficulty in node load balancing decisions due to insufficient load information description in the prior art, and improves the resource utilization and reliability of load balancing in the neural network computer system.
[0058] In one embodiment, such as Figure 3 As shown, S202 generates a dynamic resource feature matrix for each node based on the resource occupancy status of the processor cores on each node, including the following steps:
[0059] S302, obtain the resource occupancy status of the processor core on the node.
[0060] S304, the resource occupancy status is abstracted into a two-dimensional matrix, and the distribution characteristics of the corresponding occupied cores and idle cores are extracted.
[0061] S306, Based on the distribution characteristics, generate the resource dynamic feature matrix of the node.
[0062] Specifically, the resource occupancy status of the processor cores on each node is abstracted into a two-dimensional matrix representing the occupied and idle states. The distribution characteristics of occupied and idle cores in this two-dimensional matrix are extracted and saved in the form of a resource dynamic feature matrix.
[0063] In one embodiment, the resource dynamic feature matrix includes the distance from the occupied core, the number of reachable boundary paths, and the hollow core feature.
[0064] The distance from occupied cores includes four directions: east, south, west, and north, representing the size of the idle core area where a core is located, reflecting the degree to which the idle core area is fragmented; the number of reachable boundary paths represents the number of paths a core can directly access external networks. The larger the number of reachable boundary paths, the higher the reachability of the communication network, and the more preferentially the core is allocated; the hollow core feature indicates that a core is an idle core, and there are at least two occupied cores in the adjacent positions of the core. When a core has the hollow core feature, the larger the feature value, the more preferentially the core is allocated, reducing the fragmentation rate of resources.
[0065] In this embodiment, the resource occupancy status of the processor cores on the node is extracted into a dynamic resource feature matrix that reflects the resource distribution characteristics of the node cores. This dynamic resource feature matrix describes in detail various load information of each node core array, reducing the complexity of processing load information in the load balancing decision process.
[0066] In one embodiment, such as Figure 4 As shown, S204, based on the resource dynamic feature matrix, obtains the placement scheme on each node that matches the resource format required by the application to be deployed, and calculates the fitness value of each placement scheme, including the following steps:
[0067] S402, based on the shape of the resource format required by the application to be deployed, determine the matching filling location region from the resource dynamic feature matrix of each node.
[0068] S404, Based on the particle swarm optimization algorithm and the filling position region, determine the original position and original velocity of each search particle in the particle swarm optimization algorithm.
[0069] The original position of each search particle corresponds one-to-one with the placement position of each placement scheme.
[0070] S406, based on the original position and original velocity of each of the search particles and the dynamic feature matrix of each resource, calculate the fitness value of each of the placement schemes under each of the nodes.
[0071] Specifically, using the particle swarm optimization algorithm, the original position of the core in the initial state of each search particle is equivalent to the possible placement position of the resource format shape required by the application to be deployed, i.e., the matching filling position region; where the filling position region is the possible placement orientation of the resource format shape required by the application to be deployed, which extends from this position as the starting point or the ending point, and the placement orientation possibility represents the possible placement scheme generated by rotation or symmetry with the search particle as the starting point or the ending point; the fitness value of the placement scheme corresponding to each placement orientation possibility is calculated.
[0072] In one embodiment, such as Figure 5 As shown, calculating the fitness value of each placement scheme under each node in S406 includes the following steps:
[0073] S502, based on the original position and original velocity of each of the search particles, obtain the corresponding lateral distance reduction degree, longitudinal distance reduction degree, number of reachable boundary paths, and void core features from each of the resource dynamic feature matrices.
[0074] S504, based on the degree of reduction in lateral distance, the degree of reduction in longitudinal distance, the number of accessible boundary paths, and the core characteristics of the void, the fitness value of each placement scheme under each node is calculated using the empirical coefficient of load balancing.
[0075] Specifically, based on the original position and original velocity of each search particle, the degree of reduction in lateral distance, the degree of reduction in longitudinal distance, the number of reachable boundary paths, and the characteristics of the hollow core after the core is allocated are determined for each placement scheme. The empirical coefficients for load balancing of the neural computer system are used to calculate the fitness value of each placement scheme.
[0076] In the above embodiments, the resource dynamic feature matrix of each node is used to obtain various load information of the NPU core array of the chip on each node of the neural computer, and these information are fused to calculate the fitness value of various placement schemes on each node, thereby improving the reliability of load balancing.
[0077] In one embodiment, such as Figure 6 As shown, S206, based on the fitness value, obtains the maximum fitness value of each node and calculates the corresponding assignability coefficient, including the following steps:
[0078] S602, based on the particle swarm optimization algorithm, update the position and velocity of each search particle in the particle swarm optimization algorithm.
[0079] Specifically, using the particle swarm optimization algorithm, after obtaining the fitness values of the placement schemes corresponding to the possibilities of each placement orientation in S204, the position and velocity of each search particle are updated.
[0080] S604, based on the fitness value and the updated position and velocity of each of the search particles, obtain the maximum fitness value of each node and calculate the corresponding assignable coefficient.
[0081] Specifically, at each node, the fitness values corresponding to the updated positions and velocities of each search particle are obtained. The core with the maximum fitness value corresponding to the velocity and position of each search particle at each node is selected as the optimal placement scheme for application deployment. The allocatability coefficient corresponding to the optimal placement scheme at each node is calculated.
[0082] In the above, the particle swarm optimization algorithm is used to quickly evaluate the feasibility of deploying applications for matching node resources.
[0083] In one embodiment, such as Figure 7 As shown, calculating the corresponding allocable coefficients in S604 includes the following steps:
[0084] S702, based on the fitness value and the updated position and velocity of each of the search particles, obtain the maximum fitness value of each node.
[0085] Specifically, based on the updated position and velocity of the search particles, the maximum fitness value of each search particle at its respective position is first calculated, and then the maximum fitness value of the node is obtained from the maximum fitness value of each particle at its respective position.
[0086] S704, based on the maximum fitness value, the number of remaining cores of each node, the total number of remaining cores of all nodes, and the feedback experience coefficient of the load balancing, calculate the allocatability coefficient corresponding to each node.
[0087] Specifically, the maximum fitness value of each node is obtained, that is, the optimal placement scheme of each node is obtained. Using the number of such optimal placement schemes, combined with the idle core number characteristic of the node's resources (i.e., the ratio of the node's remaining idle cores to the total number of remaining idle cores of all nodes) and the feedback empirical coefficient of the neural computer system for load balancing, the allocatable coefficient corresponding to each node is calculated.
[0088] The larger the assignability coefficient of a node, the higher the priority of selecting that node as the deployment node for the application to be deployed.
[0089] In one embodiment, such as Figure 8 As shown, after determining the deployment node of the application to be deployed based on the allocatable coefficient in S208, the method further includes the following steps:
[0090] S802, based on the optimal placement scheme corresponding to the maximum fitness value, obtain the predicted load of each node after the application to be deployed is executed.
[0091] Specifically, by using the optimal placement scheme corresponding to the maximum fitness value, the average feature matrix corresponding to each node is calculated, that is, the predicted load of the deployment node corresponding to the application deployment is executed based on the optimal placement scheme.
[0092] S804, obtain the actual load status of each node after the application to be deployed is executed.
[0093] Specifically, after the application to be deployed is deployed, the resource occupancy status of the corresponding deployment node's processor core is retrieved again, and the corresponding dynamic resource feature matrix is regenerated, which is the actual load of the node.
[0094] S806, based on the predicted load and the actual load, perform deviation calculation to obtain the deviation information of the load balancing, and feed the deviation information back to the feedback experience coefficient of the load balancing.
[0095] Specifically, a negative deviation value indicates that the actual load balancing effect of the application deployed on that node is good, and the feedback experience coefficient of that node will increase; a positive deviation value indicates that the actual load balancing effect of the application deployed on that node is poor, and the feedback experience coefficient of that node will decrease. The feedback experience coefficient will be re-evaluated after each load balancing operation.
[0096] In steps S802 to S806 above, after determining the deployment nodes of the application to be deployed, the predicted load and actual load after application deployment are obtained, the load balancing deviation information is calculated, and the deviation information is fed back to the feedback empirical coefficient of the neural computer system load balancing. The impact of application deployment on the load is predicted and compared, and the load of the core array of each node is evaluated in a timely manner. This provides a basis for allocation decisions for application deployment in a multi-node neural computer system environment, improving the utilization rate of node resources and the reliability of the load balancing process.
[0097] In one example embodiment, a method for load balancing of neural computer nodes is provided, wherein, as Figure 9 As shown, in node cluster C, the individual NPU processor cores on each node are abstracted into a two-dimensional matrix. Gray cores represent cores that are occupied and cannot be allocated; white cores represent cores that are idle and can be allocated. The specific steps include:
[0098] S1. Obtain the resource occupancy status of the NPU processor cores of each node, resulting in a two-dimensional matrix φ = {Φ∪Ψ}, where Φ represents the free region and Ψ represents the occupied region. Extract the distribution features of the corresponding occupied and free cores to generate the resource dynamic feature matrix A for each node. d (i, j), d ∈ (W, E, N, S) where the idle cores Core(i, j), (i, j) ∈ Φ. Let A E (i,j) A W (i,j) A S (i,j) A N (i,j) The idle cores Core(i,j) are located in the east (A). East ), West (A West ), South (A South ), North (A North The distance to the core in four directions.
[0099] Among them, the resource dynamic feature matrix A d (i, j) includes the distance A from the occupied core. Δ(i,j) Number of reachable boundary paths (AA) (i,j) and the hollow core feature F (i,j) .
[0100] S2, during the load balancing process, when there is a possibility that an idle core (i, j) on a node can be allocated, the resource dynamic feature matrix A is used. d (i, j), calculate the degree of reduction A in the lateral distance of the idle core Core(i, j). Δx(i,j) Degree of reduction in longitudinal distance A Δy(i,j) Number of reachable boundary paths (AA) (i,j) and the hollow core feature F (i,j) The specific formula is as follows:
[0101] A Δx(i,j) =(A E (i,j) +1)×j+(A W (i,j) +1)×(W-(j+1));
[0102] A Δy(i,j) =(A N (i,j) +1)×i+(A S (i,j) +1)×(H-(i+1));
[0103] AA (i,j) =P×Σ d∈(w,E,N,S) DAccessd(i,j) ;
[0104]
[0105] Where P is the normalization coefficient, and DAccess d(i,j) =0 indicates unreachable, DAccess d(i,j) =1 indicates reachability; This indicates the number of adjacent cores that occupy cores.
[0106] S3, as Figure 10 As shown, based on the PSO particle optimization algorithm, the original position of each search particle at its core is equated to the initial position of the resources required by the application to be deployed. Using the shape of the resources required by the application, the placement scheme O is calculated, with its filling region being l, l∈shape∩Φ. The fitness value V of each placement scheme is then calculated. l The specific formula is as follows:
[0107] V l =U×F l ×∑AA (i,j) / ∑(A Δx(i,j) +A Δy(i,j) );
[0108] Among them, F l =∑F (i,j) , where is the hole-filling coefficient, and U is the empirical coefficient for load balancing of the neuron computer system.
[0109] S4, the velocity v of each search particle id and position X id Perform an update and calculate the maximum fitness value V for each placement location. L(i,j)max Thus, the maximum fitness value V of the node is calculated. maxfit The specific formula is as follows:
[0110] v id =C1×random(0,1)×(P id -X id )+C2×random(0,1)×(P gd -X id );
[0111] X id =X id +v id ;
[0112]
[0113]
[0114] Where C1 and C2 are constants, random(0,1) represents a random number between (0,1), and P id To find the optimal position of the particle for the current node, X id P represents the current position of the search particle. gd Search for the optimal position of particles for global nodes; This indicates that the application to be deployed is located at the position (i0, j0) of the search particle and uses s k The area intersecting with the free area Φ when the placement direction is specified.
[0115] S5, based on the node's maximum fitness value V maxfit Determine the optimal placement scheme for each node. maxfit The number of optimal placement schemes N for each node is obtained. l And based on the optimal placement scheme O for each node maxfit Calculate the average feature matrix of each node. That is, to predict the load situation, the specific formula is as follows:
[0116]
[0117] Where n = (i, j, s) k )∈O maxfit .
[0118] S6, the number of optimal placement schemes N based on the maximum fitness value of each node. l Calculate the assignability coefficient M for each node. l The specific formula is as follows:
[0119] M l =K l ×N l ×V maxfit ×Cfree l / Cfree T ;
[0120] Among them, K l To provide feedback on the experience coefficient, Cfree l This represents the number of remaining free cores for that node, Cfree. T This represents the total number of remaining free cores across all nodes.
[0121] This allows us to obtain the load status Q of each node. l :
[0122]
[0123] Among them, Q max This indicates that the load is full.
[0124] Furthermore, based on the assignability coefficient M of each nodel The deployment nodes for the application to be deployed and the load balancing scheduling decisions M are determined from the node cluster C. choice M choice =max l∈C (M l ).
[0125] S7, after the deployment node executes the deployment task for the application to be deployed, re-acquires the resource occupancy status of the corresponding NPU processor core and abstracts it into a two-dimensional matrix φ', and regenerates the corresponding resource dynamic feature matrix A. d ''(i, j) represents the actual load condition of the node. For the actual load condition A... d ′'(i,j) and predicted load conditions Deviation calculation is performed to obtain deviation information D. l The specific formula is as follows:
[0126]
[0127] Where R is the normalization coefficient in the range (-1, 1).
[0128] Furthermore, based on the deviation information D l Adjusting the feedback experience coefficient K l :
[0129] K l =K0-D l ;
[0130] Where K0 is the initial value of the feedback coefficient. When the deviation information D l A negative value indicates that the actual load balancing effect of the application deployed on that node is good, and the feedback empirical coefficient K of that node is... l It will increase; when the deviation information D l A positive value indicates that the actual load balancing effect of the application deployed on that node is poor, and the feedback empirical coefficient K for that node is... l It will decrease.
[0131] It should be understood that although the steps in the flowcharts of the embodiments described above are shown sequentially according to the arrows, these steps are not necessarily executed in the order indicated by the arrows. Unless explicitly stated herein, there is no strict order restriction on the execution of these steps, and they can be executed in other orders. Moreover, at least some steps in the flowcharts of the embodiments described above may include multiple steps or multiple stages. These steps or stages are not necessarily completed at the same time, but can be executed at different times. The execution order of these steps or stages is not necessarily sequential, but can be performed alternately or in turn with other steps or at least some of the steps or stages of other steps.
[0132] In one embodiment, a computer device is provided, including a memory and a processor, wherein the memory stores a computer program, and the processor executes the computer program to implement the methods described in the above embodiments.
[0133] In one embodiment, a computer-readable storage medium is provided having a computer program stored thereon, which, when executed by a processor, implements the methods described in the above embodiments.
[0134] In one embodiment, a computer program product is provided, including a computer program that, when executed by a processor, implements the methods described in the above embodiments.
[0135] It should be noted that the user information (including but not limited to user device information, user personal information, etc.) and data (including but not limited to data used for analysis, data stored, data displayed, etc.) involved in this application are all information and data authorized by the user or fully authorized by all parties, and the collection, use and processing of the relevant data shall comply with the relevant laws, regulations and standards of the relevant countries and regions.
[0136] Those skilled in the art will understand that all or part of the processes in the methods of the above embodiments can be implemented by a computer program instructing related hardware. The computer program can be stored in a non-volatile computer-readable storage medium, and when executed, it can include the processes of the embodiments of the above methods. Any references to memory, databases, or other media used in the embodiments provided in this application can include at least one of non-volatile and volatile memory. Non-volatile memory can include read-only memory (ROM), magnetic tape, floppy disk, flash memory, optical memory, high-density embedded non-volatile memory, resistive random access memory (ReRAM), magnetic random access memory (MRAM), ferroelectric random access memory (FRAM), phase change memory (PCM), graphene memory, etc. Volatile memory can include random access memory (RAM) or external cache memory, etc. By way of illustration and not limitation, RAM can take many forms, such as Static Random Access Memory (SRAM) or Dynamic Random Access Memory (DRAM). The databases involved in the embodiments provided in this application may include at least one type of relational database and non-relational database. Non-relational databases may include, but are not limited to, blockchain-based distributed databases. The processors involved in the embodiments provided in this application may be general-purpose processors, central processing units, graphics processing units, digital signal processors, programmable logic devices, quantum computing-based data processing logic devices, etc., and are not limited to these.
[0137] The technical features of the above embodiments can be combined in any way. For the sake of brevity, not all possible combinations of the technical features in the above embodiments are described. However, as long as there is no contradiction in the combination of these technical features, they should be considered to be within the scope of this specification.
[0138] The embodiments described above are merely illustrative of several implementation methods of this application, and while the descriptions are specific and detailed, they should not be construed as limiting the scope of this patent application. It should be noted that those skilled in the art can make various modifications and improvements without departing from the concept of this application, and these all fall within the protection scope of this application. Therefore, the protection scope of this application should be determined by the appended claims.
Claims
1. A method for load balancing of neural computer nodes, characterized in that, The method includes: Based on the resource occupancy status of the processor cores on each node, a dynamic resource feature matrix for each node is generated. Based on the resource dynamic feature matrix, obtain the placement scheme on each node that matches the resource format required by the application to be deployed, and calculate the fitness value of each placement scheme. Based on the fitness value, the maximum fitness value of each node is obtained, and the corresponding assignability coefficient is calculated; Based on the allocatable coefficient, the deployment node of the application to be deployed is determined; The process of generating a dynamic resource feature matrix for each node based on the resource occupancy status of the processor cores on each node includes: Obtain the resource occupancy status of the processor cores on the node, wherein the resource occupancy status includes two states: occupied and idle; The resource occupancy status is abstracted into a two-dimensional matrix, and the distribution characteristics of the corresponding occupied cores and idle cores are extracted. Based on the distribution characteristics, a dynamic resource feature matrix for the node is generated; The resource dynamic feature matrix includes the distance from occupied cores, the number of reachable boundary paths, and the hollow core feature. The distance from occupied cores represents the size of the free area at the location of a core. The number of reachable boundary paths represents the number of paths that a core can directly access the external network. The hollow core feature indicates that a core is an idle core and there are at least two occupied cores in the adjacent positions of the core. The step of obtaining placement schemes on each node that match the resource format required by the application to be deployed, based on the resource dynamic feature matrix, and calculating the fitness value of each placement scheme includes: Based on the shape of the resource format required by the application to be deployed, the matching filling location region is determined from the resource dynamic feature matrix of each node; Based on the particle swarm optimization algorithm and the filling location region, the original position and original velocity of each search particle in the particle swarm optimization algorithm are determined, wherein the original position of each search particle corresponds one-to-one with the placement position of each placement scheme. Based on the original position and original velocity of each search particle and the dynamic feature matrix of each resource, the fitness value of each placement scheme under each node is calculated; The calculation of the fitness value of each placement scheme under each node, based on the original position and original velocity of each search particle and the dynamic feature matrix of each resource, includes: Based on the original position and original velocity of each of the search particles, the corresponding lateral distance reduction degree, longitudinal distance reduction degree, number of reachable boundary paths, and void core features are obtained from each of the resource dynamic feature matrices. Based on the degree of reduction in lateral distance, the degree of reduction in longitudinal distance, the number of reachable boundary paths, and the core characteristics of the void, the fitness value of each placement scheme under each node is calculated using the empirical coefficient of load balancing.
2. The method for load balancing of neural computer nodes according to claim 1, characterized in that, The step of obtaining the maximum fitness value of each node based on the fitness value and calculating the corresponding assignability coefficient includes: Based on the particle swarm optimization algorithm, the position and velocity of each search particle in the particle swarm optimization algorithm are updated; Based on the fitness value and the updated positions and velocities of each of the search particles, the maximum fitness value of each node is obtained, and the corresponding assignability coefficient is calculated.
3. The method for load balancing neural computer nodes according to claim 2, characterized in that, The process of obtaining the maximum fitness value of each node based on the fitness value and the updated positions and velocities of each search particle, and calculating the corresponding assignability coefficient, includes: Based on the fitness value and the updated position and velocity of each of the search particles, the maximum fitness value of each node is obtained; Based on the maximum fitness value, the number of remaining idle cores of each node, the total number of remaining idle cores of all nodes, and the feedback experience coefficient of the load balancing, the allocatability coefficient corresponding to each node is calculated.
4. The method for load balancing of neural computer nodes according to claim 1, characterized in that, The method further includes: Based on the optimal placement scheme corresponding to the maximum fitness value, obtain the predicted load of the deployment node after the application to be deployed is executed; Obtain the actual load status of the deployment node after the application to be deployed is executed; Based on the predicted load and the actual load, deviation calculation is performed to obtain the deviation information of the load balancing, and the deviation information is fed back to the feedback experience coefficient of the load balancing.
5. A neural network computer system, characterized in that, The system includes a neural network multi-core processor and an application to be deployed. The neural network multi-core processor uses a microkernel as the smallest unit for load balancing and is mounted on each node of the neural computer system. When executing, it implements the method described in any one of claims 1 to 4 and performs deployment tasks on the application to be deployed.
6. A computer-readable storage medium having a computer program stored thereon, characterized in that, When the computer program is executed by a processor, it implements the steps of the method according to any one of claims 1 to 4.
Citation Information
Patent Citations
Neuron operating system task resource configuration method and device based on static relay
CN116225689A
Optimizing The Deployment Of A Workload On A Distributed Processing System
US20120185867A1
