Memory access performance optimization method based on NUMA architecture platform
By recording and adjusting the node arrangement on the NUMA architecture platform, and using the annealing algorithm to optimize the memory access distance, the problem of low program running efficiency under the NUMA architecture is solved, and the effect of improving the program running efficiency on the Feiteng platform is achieved.
Patent Information
- Application Number
- CN202410927859.0
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-07-11
- Publication Date
- 2024-10-22
AI Technical Summary
Under the NUMA architecture platform, program memory is distributed across NUMA nodes, resulting in frequent cross-node memory access, resulting in a decrease in program running efficiency.
By recording the number of NUMA nodes and the memory access distance, the annealing algorithm is used to randomly select and adjust the node arrangement, and the memory access distance is optimized to improve program operation efficiency. Specific steps include initializing the annealing temperature and the number of experiments, randomly selecting nodes, recalculating the memory access distance, deciding whether to accept the new distance based on the annealing probability, and finally looping to the optimal node arrangement.
It effectively improves the operating efficiency of programs under the Feiteng platform, solves the problem of low operating efficiency caused by cross-NUMA nodes, and is easy to implement and reusable.
Smart Images

Figure CN118819850A_ABST
Abstract
Description
Technical Field
[0001] The present invention is mainly applied in the field of computer technology. Background Art
[0002] With the rapid development of computer hardware technology, NUMA (Non Uniform Memory Access Architecture) has become the mainstream architecture for high-performance computing. A NUMA system contains multiple NUMA nodes, and different process tasks are distributed on each NUMA node.
[0003] Feiteng Information Technology Co., Ltd. disclosed a performance tuning method for a UMA system in its invention patent document "NUMA system performance tuning method, device and computer equipment" (publication number: CN114528075A, application number: CN202111630836.6). The method includes: obtaining node information in the NUMA system to be adjusted; obtaining the amount of memory and the amount of NUMA nodes required for the current test requirements; calling the NUMA node according to the obtained node information and the amount of memory and NUMA nodes, and binding the called NUMA node to the corresponding local memory. However, this method does not explain the optimization method for node allocation.
[0004] Take the domestic Feiteng series processor as an example. The processor is based on the ARM64 architecture, and its FT2000P uses the NUMA architecture to accelerate program operation. In engineering applications, program memory is often distributed across NUMA nodes, resulting in frequent cross-node memory access and reduced program operation efficiency. Summary of the invention
[0005] In order to solve the problem of low program running efficiency due to cross-NUMA nodes under the NUMA architecture platform, the present invention proposes a method for optimizing memory access performance under the NUMA architecture platform. The program running efficiency under the Feiteng platform is improved by searching for the optimal arrangement of program NUMA nodes, including the following steps:
[0006] Step a, record the number of NUMA nodes of the processor and the memory access distance of each node;
[0007] Step b, initializing the annealing temperature and the number of experiments, and randomly selecting the initial memory access distance according to the number of nodes and node distances to be used in the program;
[0008] Step c: randomly select a node and recalculate the cross-node memory access distance. If the new memory access distance is shorter, replace it, otherwise continue;
[0009] Step d, setting the annealing probability, if the condition is met, then choosing to accept the new memory access distance, if not, then not accepting the new memory access distance;
[0010] Step e: loop according to the number of experiments, and use the node arrangement at the end of the loop as the optimal NUMA node arrangement of the program.
[0011] Furthermore, in step b, the annealing temperature T and the number of experiments G are initialized, and the initial memory access distance R is randomly selected according to the number of nodes and the node distance:
[0012]
[0013] In the formula, N represents the number of nodes used by the program, and r(m,k) represents the memory access distance between the m node and the k node.
[0014] Furthermore, in step d, the annealing probability P is set as shown in the following formula:
[0015]
[0016] In the formula, rand(0,1) represents a random decimal between 0 and 1, R 2 Indicates the node access distance.
[0017] The present invention solves the problem of low operating efficiency caused by cross-NUMA nodes, effectively improves the operating efficiency of programs on the Feiteng platform, and has the advantages of simple implementation and reusability. BRIEF DESCRIPTION OF THE DRAWINGS
[0018] Figure 1 The figure is a flow chart of an embodiment of the present invention. DETAILED DESCRIPTION
[0019] The preferred implementation process of the present invention is further explained below in conjunction with the accompanying drawings.
[0020] The present invention proposes a method for optimizing memory access performance based on a NUMA architecture platform, and the preferred implementation flow chart is as follows: Figure 1 As shown, the process includes:
[0021] S1 records the number of NUMA nodes of the processor and the memory access distance of each node.
[0022] S2 initializes the annealing temperature T and the number of experiments G, and randomly selects the initial memory access distance according to the number of nodes and node distances to be used by the program, as shown in Formula 1, where N represents the number of nodes to be used by the program, and r(m,k) represents the memory access distance between the m node and the k node.
[0023]
[0024] S3 randomly selects nodes and recalculates the cross-node memory access distance of the program using formula 1. Calculate the difference between the newly generated memory access distance R1 and the previous memory access distance R2. If the new memory access distance is shorter, replace R2 with R1; if the new memory access distance is longer, go to S4.
[0025] S4 sets the annealing probability P as shown in Equation 2, where rand(0,1) represents a random decimal between 0 and 1. If the condition of Equation 2 is satisfied, accept the new memory access distance; if not, do not accept the new memory access distance.
[0026]
[0027] Example
[0028] S1: Taking FT2000P as an example, record the total number of NUMA nodes 8 and the distances of each node.
[0029] S2: Initialize the annealing temperature to 800 and the number of experiments to 100 times. Calculate the initial node distance of the program. Assuming the program uses 4 nodes, randomly select 4 nodes from nodes 1 - 8, such as (1, 2, 3, 4), and use Equation (1) to calculate the node distance R1 as 70.
[0030] S3: Randomly select 4 nodes from nodes 1 - 8 to form a new node arrangement, such as (2, 3, 4, 5), and calculate the new node distance R2 as 90.
[0031] S4: Calculate the difference between the new node distance and the previous node distance. If R2 < R1, replace R1 with R2; if R2 > R1, to prevent falling into a local optimal solution, go to S5.
[0032] S5: Set the annealing probability to 0.001. If e -R2 / 0.001 > rand(0,1), then accept R2 as the new distance, that is, R1 = R2; otherwise, R1 remains unchanged.
[0033] S6: Loop S3 to S5 according to the number of experiments G until the number of experiments G, and use the node arrangement at the end of the loop as the optimal NUMA node arrangement of the program.
Claims
1. A method for optimizing memory access performance based on a NUMA architecture platform, characterized by: Step a, record the number of NUMA nodes of the processor and the memory access distance of each node; Step b, initializing the annealing temperature and the number of experiments, and randomly selecting the initial memory access distance according to the number of nodes and node distances to be used in the program; Step c: randomly select a node and recalculate the cross-node memory access distance. If the new memory access distance is shorter, replace it, otherwise continue; Step d, setting the annealing probability, if the condition is met, then choosing to accept the new memory access distance, if not, then not accepting the new memory access distance; Step e: loop according to the number of experiments, and use the node arrangement at the end of the loop as the optimal NUMA node arrangement of the program.
2. The method for optimizing memory access performance based on a NUMA architecture platform according to claim 1, characterized in that: In step b, the annealing temperature T and the number of experiments G are initialized, and the initial memory access distance R is randomly selected according to the number of nodes and the node distance: In the formula, N represents the number of nodes used by the program, and r(m,k) represents the memory access distance between the m node and the k node.
3. The method for optimizing memory access performance based on a NUMA architecture platform according to claim 1, characterized in that: In step d, the annealing probability P is set as shown below: In the formula, rand(0,1) represents a random decimal between 0 and 1, and R2 represents the node access distance.
