Resource allocation method and device for non-uniform memory access and memory access method and device

By selecting the closest NUMA node set to be distributed in non-consistent memory access, the problem of inefficient resource allocation in the prior art is solved, and more efficient memory access optimization is achieved.

CN120371534AActive Publication Date: 2025-07-25启元实验室

Patent Information

Application Number
CN202510855328.X
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-06-25
Publication Date
2025-07-25
Estimated Expiration
2045-06-25

AI Technical Summary

Technical Problem

In the non-consistent memory access optimization, the NUMA node resource allocation method fails to effectively consider the combination of CPU and memory resources and the distance between NUMA nodes, resulting in low resource allocation efficiency and failing to fully utilize the advantages of NUMA nodes.

Method used

By determining the target selected node set, selecting the nearest NUMA node set for resource allocation, ensuring that the executor is bound to the same NUMA node as its resources, optimizing memory access.

Benefits of technology

Improves computing efficiency, reduces the latency of the executors on different NUMA nodes, and achieves better memory access performance.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120371534A_ABST
    Figure CN120371534A_ABST
Patent Text Reader

Abstract

The invention discloses a resource allocation method for non-uniform memory access and a memory access method and device, and relates to the technical field of non-uniform memory access. The resource allocation method comprises the following steps: determining a first target selected node set according to a first initial non-uniform memory access resource node of a received non-uniform memory access resource; traversing all initial non-consistent memory access resource nodes of the non-consistent memory access resources to determine all target selected node sets; determining a target selected node set meeting a target memory resource demand and a first preset condition in all target selected node sets as a target non-consistent memory access resource node set; and distributing the target non-uniform memory access resource node set to the executor with the target memory resource demand. According to the method, the target non-uniform memory access resource node set closest to the target selected node set is allocated to the executor, so that the delay of the executor at different NUMA nodes can be reduced.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This application relates to the technical field of non-uniform memory access. Specifically, it relates to a resource allocation method, a memory access method, and a device for non-uniform memory access. Background Art

[0002] Regarding the optimization of non-uniform memory access in distributed computing, a representative existing technology is the optimization of non-uniform memory access in the Yarn distributed computing cluster of the Apache Hadoop open-source software.

[0003] However, the NUMA resource allocation method in the Yarn cluster is relatively simple. When a single NUMA node is not sufficient to meet the CPU or memory requirements of the executor, Yarn will select multiple NUMA nodes that meet the resource requirements for allocation. However, the allocation rule is simply to poll the NUMA nodes. On the one hand, the polling allocation of CPU and memory resources is separated, and it does not consider allocating memory resources on the same NUMA node as the CPU resources as much as possible. On the other hand, it also does not consider the different distances between different NUMA nodes to allocate several sets of NUMA nodes that are closest to each other. This results in the fact that even if the Yarn cluster binds NUMA nodes in this case, its efficiency may still be low, and the maximum advantage of NUMA node binding is not fully utilized.

[0004] The content of the background art part is only the technology known to the applicant and does not necessarily represent the prior art in this field. Summary of the Invention

[0005] This application aims to provide a resource allocation method, a memory access method, and a device for non-uniform memory access to solve the above technical problems.

[0006] According to one aspect of this application, this application provides a resource allocation method for non-uniform memory access. The resource allocation method includes: determining a first target selected node set according to the first starting non-uniform memory access resource node of the received non-uniform memory access resources; traversing all the starting non-uniform memory access resource nodes of the non-uniform memory access resources to determine all the target selected node sets; determining the target selected node sets that meet the target memory resource requirements and the first preset condition in all the target selected node sets as the target non-uniform memory access resource node set; and allocating the target non-uniform memory access resource node set to the executor with the target memory resource requirements.

[0007] According to some embodiments of the present application, determining a first target selected node set based on a first starting non-uniform memory access resource node of the received non-uniform memory access resource includes: setting the first starting non-uniform memory access resource node in a first selected node set; determining whether the first starting non-uniform memory access resource node meets the target memory resource requirement; if so, determining the first selected node set as the first target selected node set; if not, adding non-uniform memory access resource nodes that meet a second preset condition to the first selected node set until the non-uniform memory access resource nodes in the first selected node set meet the target memory resource requirement, so as to determine the first selected node set that meets the second preset condition as the first target selected node set.

[0008] According to some embodiments of the present application, traversing all starting non-uniform memory access resource nodes of the non-uniform memory access resource to determine all target selected node sets includes: determining all node numbers of the non-uniform memory access resource nodes in the first target selected node set to determine the maximum value of all node numbers; starting to traverse from the next starting non-uniform memory access resource node corresponding to the maximum value of all node numbers to determine all target selected node sets.

[0009] According to one aspect of the present application, the present application provides a memory access method for non-uniform memory access. The memory access method includes: receiving non-uniform memory access resources from an executor and the target memory resource requirement of a distributed computing task to be executed by the executor, where the non-uniform memory access resources and the target memory resource requirement are determined by the executor; according to the access resources and the target memory resource requirement, performing the resource allocation method as described above to determine a target non-uniform memory access resource node set; sending node information of the target non-uniform memory access resource node set to the executor so that the executor binds to the target non-uniform memory access resource node set, so that the executor executes the distributed computing task through the target non-uniform memory access resource node set.

[0010] According to some embodiments of the present application, after sending the node information to the executor, the memory access method further includes: determining available non-uniform memory access resource information according to the non-uniform memory access resource information and the node information, so as to perform the resource allocation method as described above next time according to the available non-uniform memory access resource information.

[0011] According to one aspect of the present application, the present application provides a resource allocation device for non-uniform memory access. The resource allocation device includes a resource manager. The resource manager determines a first target selected node set according to the first starting non-uniform memory access resource node of the received non-uniform memory access resource. The resource manager traverses all the starting non-uniform memory access resource nodes of the non-uniform memory access resource to determine all the target selected node sets. The resource manager determines that the target selected node set that meets the target memory resource requirement and the first preset condition in all the target selected node sets is the target non-uniform memory access resource node set. The resource manager allocates the target non-uniform memory access resource node set to the executor with the target memory resource requirement.

[0012] According to some embodiments of the present application, the resource manager sets the first starting non-uniform memory access resource node in the first selected node set. The resource manager determines whether the first starting non-uniform memory access resource node meets the target memory resource requirement. If so, the resource manager determines the first selected node set as the first target selected node set. If not, the resource manager adds non-uniform memory access resource nodes that meet the second preset condition to the first selected node set until the non-uniform memory access resource nodes in the first selected node set meet the target memory resource requirement, so as to determine the first selected node set that meets the second preset condition as the first target selected node set.

[0013] According to some embodiments of the present application, the resource manager determines all the node numbers of the non-uniform memory access resource nodes in the first target selected node set to determine the maximum value of all the node numbers. The resource manager starts traversing from the next starting non-uniform memory access resource node corresponding to the non-uniform memory access resource node with the maximum value of all the node numbers to determine all the target selected node sets.

[0014] According to one aspect of the present application, the present application provides a memory access device for non-uniform memory access. The memory access device includes an executor and a resource manager. The executor determines the non-uniform memory access resource information and the target memory resource requirement of the distributed computing task to be executed. The resource manager receives the non-uniform memory access resource information and the target memory resource requirement. The resource manager executes the resource allocation method as described above according to the non-uniform memory access resource information and the target memory resource requirement to determine the target non-uniform memory access resource node set. The resource manager sends the node information of the target non-uniform memory access resource node set to the executor. The executor binds to the target non-uniform memory access resource node set according to the node information. The executor executes the distributed computing task through the target non-uniform memory access resource node set.

[0015] According to some embodiments of the present application, the resource manager determines the available non-uniform memory access resource information based on the non-uniform memory access resource information and the node information, so as to execute the resource allocation method as described above next time according to the available non-uniform memory access resource information.

[0016] According to another aspect of the present application, the present application also provides a non-volatile computer-readable storage medium, on which a computer program is stored, and when the computer program is executed by a processor, it can implement the resource allocation method for non-uniform memory access as described above.

[0017] According to another aspect of the present application, the present application also provides an electronic device, including: one or more processors; a storage device for storing one or more programs, and when the one or more programs are executed by the one or more processors, the one or more processors can implement the resource allocation method for non-uniform memory access as described above.

[0018] According to another aspect of the present application, the present application also provides a computer program product, including: a computer program stored on a computer-readable storage medium; the computer program includes program instructions, and when the program instructions are executed by a computer, the computer executes the resource allocation method for non-uniform memory access as described above.

[0019] According to another aspect of the present application, the present application also provides a non-volatile computer-readable storage medium, on which a computer program is stored, and when the computer program is executed by a processor, it can implement the memory access method for non-uniform memory access as described above.

[0020] According to another aspect of the present application, the present application also provides an electronic device, including: one or more processors; a storage device for storing one or more programs, and when the one or more programs are executed by the one or more processors, the one or more processors can implement the memory access method for non-uniform memory access as described above.

[0021] According to another aspect of the present application, the present application also provides a computer program product, including: a computer program stored on a computer-readable storage medium; the computer program includes program instructions, and when the program instructions are executed by a computer, the computer executes the memory access method for non-uniform memory access as described above.

[0022] Beneficial effects The present application can determine a first set of target selected nodes through the first starting non-uniform memory access resource node of the received non-uniform memory access resources. The present application can traverse all the starting non-uniform memory access resource nodes of the non-uniform memory access resources to determine all the sets of target selected nodes. The present application can determine that the set satisfying the target memory resource requirement and the first preset condition in all the sets of target selected nodes is the set of target non-uniform memory access resource nodes. The present application can allocate the set of target non-uniform memory access resource nodes to the executor with the target memory resource requirement.

[0023] The resource allocation method provided by the present application can, when a single NUMA node is insufficient to meet the target memory resource requirement, allocate the set of target non-uniform memory access resource nodes that are the closest to the set of target selected nodes to the executor for binding, so that the allocation of non-uniform memory access resources is as much as possible on the NUMA node with the same resources as the executor (i.e., the non-uniform memory access resources of the local machine).

[0024] Moreover, the present application allocating the set of target non-uniform memory access resource nodes that are the closest to the set of target selected nodes to the executor can reduce the latency of the executor on different NUMA nodes and improve the computing efficiency, so that the memory access optimization of the executor for non-uniform memory access resources reaches a better performance. BRIEF DESCRIPTION OF THE DRAWINGS

[0025] To more clearly illustrate the technical solutions in the embodiments of the present application, the following will briefly introduce the drawings required for the description of the embodiments. Obviously, the following drawings are only some embodiments of the present application. For those of ordinary skill in the art, other drawings can be obtained based on these drawings without creative efforts.

[0026] Figure 1 FIG. 15 shows a schematic flowchart of a resource allocation method 1000 according to an embodiment of the present application; Figure 2 FIG. 18 shows a schematic flowchart of step S110 according to an embodiment of the present application; Figure 3 FIG. 21 shows a schematic flowchart of step S120 according to an embodiment of the present application; Figure 4 FIG. 24 shows a schematic flowchart of a memory access method 2000 according to an embodiment of the present application; Figure 5 FIG. 27 shows another schematic flowchart of the memory access method 2000 according to an embodiment of the present application; Figure 6 FIG. 30 shows a schematic structural diagram of a resource allocation device according to an embodiment of the present application; Figure 7 FIG. 2 shows a schematic structural diagram of a memory access device according to an embodiment of the present application.

[0027] Description of reference numerals: Resource allocation device 300; Resource manager 310.

[0028] Memory access device 400; Executor 410. Detailed implementation manners

[0029] Example embodiments will now be described more fully with reference to the accompanying drawings. However, the example embodiments can be implemented in various forms and should not be construed as limited to the embodiments set forth herein; rather, these embodiments are provided so that this application will be thorough and complete, and will fully convey the concept of the example embodiments to those skilled in the art. Identical reference numerals in the figures denote identical or similar parts, and thus their repetitive description will be omitted.

[0030] The features, structures, or characteristics described may be combined in one or more embodiments in any suitable manner. In the following description, numerous specific details are provided to give a thorough understanding of the embodiments of the present disclosure. However, those skilled in the art will realize that the technical solutions of the present disclosure can be practiced without one or more of these specific details, or can be implemented in other ways, components, materials, devices, etc. In these cases, well-known structures, methods, devices, implementations, materials, or operations will not be shown or described in detail.

[0031] In addition, the terms "including" and "having", and any variations thereof, are intended to cover non-exclusive inclusion. For example, a process, method, system, product, or device that includes a series of steps or units is not limited to the listed steps or units, but optionally further includes steps or units not listed, or optionally further includes other steps or units inherent to these processes, methods, products, or devices.

[0032] The terms "first", "second", etc. in the specification and claims of the present application and in the above drawings are used to distinguish different objects, rather than to describe a specific order.

[0033] The technical solutions of the present application will be clearly and completely described below with reference to the accompanying drawings in the embodiments of the present application. Obviously, the described embodiments are some, but not all, of the embodiments of the present application. All other embodiments obtained by those skilled in the art based on the embodiments of the present application without creative efforts fall within the scope of protection of the present application.

[0034] English terms involved in the present application, their English full names, and corresponding Chinese interpretations: NUMA, Non-Uniform Memory Access, non-uniform memory access; CPU, Central Processing Unit, central processing unit; Apache Hadoop, an open-source distributed system framework; Apache Spark, an open-source cluster computing system; Executor, executor; TCP, Transmission Control Protocol, transmission control protocol; UDP, User Datagram Protocol, user datagram protocol; C / S, Client / Server, client / server; RPC, Remote Procedure Call, remote procedure call; WebSocket, a network communication protocol; HTTP, HyperText Transfer Protocol, hypertext transfer protocol; API, Application Programming Interface, application programming interface.

[0035] Under the NUMA topology, the entire physical memory space is split into multiple NUMA nodes. Each NUMA node has a separate memory controller and local memory, and the processors are divided among these NUMA nodes. In this way, each processor has a portion of directly connected memory, called local memory, and the remaining memory is remote memory. The latency for a processor to access local memory is the lowest, while remote memory needs to be accessed through inter-processor interconnection communication, resulting in higher latency, and the latency for accessing remote memory in different nodes (hereinafter referred to as the distance between NUMA nodes) varies.

[0036] Under the NUMA topology, if only the processors and memory resources under a specific NUMA node are used, the best performance will be obtained. However, once there is a situation where processors and memory are in different NUMA nodes, it will inevitably have an impact on performance. The default scheduling policy of the Linux operating system does not guarantee that resources under a specific NUMA node will always be allocated to tasks, but it provides an interface for application programs to choose to bind tasks to specific NUMA nodes.

[0037] In the optimization of non-uniform memory access in distributed computing, a representative existing technology is the optimization of non-uniform memory access in the Yarn distributed computing cluster of the Apache Hadoop open-source software. Since version 3.1.0, the Yarn cluster of Apache Hadoop has provided native support for non-uniform memory access optimization, which can be enabled through corresponding configurations. When the non-uniform memory access optimization is enabled in the Yarn cluster, a NUMA resource manager (NUMA Resources Manager) will be started. Each time a new container executor is started, it will request NUMA resources from the NUMA resource manager. The NUMA resource manager will check the available NUMA resources and reply with the CPU and memory resources allocated to this executor. Finally, the executor will bind itself to the CPU and memory resources obtained from the NUMA resource manager.

[0038] According to one aspect of the present application, the present application provides a resource allocation method 1000 for non-uniform memory access. The resource allocation method 1000 can be executed by a resource allocation device. Exemplarily, the resource allocation device can be a host or a server with data processing capabilities.

[0039] See Figure 1 , the resource allocation method 1000 can include step S110 - step S140.

[0040] In step S110, the resource allocation device determines a first target selected node set according to the first starting non-uniform memory access resource node of the received non-uniform memory access resources.

[0041] According to the exemplary embodiment, the non-uniform memory access resources can be the non-uniform memory access resource information of the executor's own machine sent by the executor. The non-uniform memory access resources can include information such as the number of NUMA nodes (for example, N), the number of CPUs and the memory size of each NUMA node, and the distance between NUMA nodes.

[0042] The target memory resource requirement can be the NUMA resource requirement for the executor to execute the distributed computing task. For example, the target memory resource requirement can include the required CPU and NUMA resources.

[0043] The first starting non-uniform memory access resource node can be a NUMA node in the non-uniform memory access resources.

[0044] The resource allocation device can receive multiple non-uniform memory access resources from the local machine of the actuator. Each non-uniform memory access resource can include multiple NUMA nodes. The resource allocation device can randomly select a NUMA node as the first starting non-uniform memory access resource node.

[0045] The first selected node set can be a memory resource set including the first starting non-uniform memory access resource node.

[0046] The resource allocation device can place the first starting non-uniform memory access resource node in the first selected node set. The first selected node set can also include other non-uniform memory access resource nodes. The selection condition for the other non-uniform memory access resource nodes placed in the first selected node set is that the distance between the non-uniform memory access resource node and the first starting non-uniform memory access resource node is the closest.

[0047] According to the exemplary embodiment, the distance of the first selected node set can be the sum of the distances between all NUMA nodes (including the first starting non-uniform memory access resource node and multiple other non-uniform memory access resource nodes) in the first selected node set.

[0048] When the first selected node set includes multiple other non-uniform memory access resource nodes, the resource allocation device can also add non-uniform memory access resource nodes. The selection condition is that the newly added non-uniform memory access resource node is the closest to the first selected node set, that is, the sum of the distances between the newly added non-uniform memory access resource node and all NUMA nodes (including the first starting non-uniform memory access resource node and multiple other non-uniform memory access resource nodes) in the first selected node set is the closest, until the first selected node set meets the target memory resource requirement. The resource allocation device can determine the current first selected node set that has met the target memory resource requirement as the first target selected node set.

[0049] The first target selected node set can be a memory resource set in which the memory resource information of all NUMA nodes in the set meets the target memory resource requirement.

[0050] In step S120, the resource allocation device traverses all the starting non-uniform memory access resource nodes of the non-uniform memory access resources to determine all the target selected node sets.

[0051] According to the exemplary embodiment, the starting non-uniform memory access resource node can be a NUMA node in the non-uniform memory access resource.

[0052] The resource allocation device may use each non-uniform memory access resource node (NUMA node) in the non-uniform memory access resources as the starting non-uniform memory access resource node.

[0053] The selected node set may be a memory resource set including the starting non-uniform memory access resource node. The resource allocation device may place a starting non-uniform memory access resource node in a selected node set. Each starting non-uniform memory access resource node corresponds to a selected node set.

[0054] The selected node set may further include other non-uniform memory access resource nodes. The selection condition for the other non-uniform memory access resource nodes placed in the selected node set is that the distance between the non-uniform memory access resource node and the starting non-uniform memory access resource node is the closest.

[0055] According to the exemplary embodiment, the distance of the selected node set may be the sum of the distances between all NUMA nodes (including the starting non-uniform memory access resource node and multiple other non-uniform memory access resource nodes) in the selected node set.

[0056] In the case where the selected node set includes multiple other non-uniform memory access resource nodes, the resource allocation device may further add non-uniform memory access resource nodes. The selection condition is that the newly added non-uniform memory access resource node is the closest to the selected node set, that is, the sum of the distances between the newly added non-uniform memory access resource node and all NUMA nodes (including the starting non-uniform memory access resource node and multiple other non-uniform memory access resource nodes) in the selected node set is the closest, until the selected node set meets the target memory resource requirement. The resource allocation device may determine the current selected node set that has met the target memory resource requirement as the target selected node set.

[0057] The target selected node set may be a memory resource set in which the memory resource information of all NUMA nodes in the set meets the target memory resource requirement.

[0058] The resource allocation device may traverse all the starting non-uniform memory access resource nodes of the non-uniform memory access resources, thereby forming all the target selected node sets. Each target selected node set can meet the target memory resource requirement.

[0059] In step S130, the resource allocation device determines the target selected node set that meets the target memory resource requirement and the first preset condition among all the target selected node sets as the target non-uniform memory access resource node set.

[0060] According to the exemplary embodiment, the first preset condition may be that the distance of the target selected node set is the closest, that is, the sum of the distances between all the NUMA nodes (including the starting non-uniform memory access resource node and multiple other non-uniform memory access resource nodes) in the target selected node set is the closest.

[0061] The target non-uniform memory access resource node set may be a memory resource set that meets the target memory resource requirement and the first preset condition.

[0062] The resource allocation device may calculate the distances of all the target selected node sets, select a target selected node set with the closest distance among all the target selected node sets, and that meets the target memory resource requirement as the target non-uniform memory access resource node set.

[0063] In step S140, the resource allocation device allocates the target non-uniform memory access resource node set to the executor with the target memory resource requirement.

[0064] According to the exemplary embodiment, the resource allocation device may allocate the target non-uniform memory access resource node set to the executor waiting to execute the distributed computing task. After receiving the target non-uniform memory access resource node set, the executor may be bound to the NUMA nodes (including the starting non-uniform memory access resource node and multiple other non-uniform memory access resource nodes) corresponding to the target non-uniform memory access resource node set.

[0065] Through the above embodiments, the present application can determine the first target selected node set through the first starting non-uniform memory access resource node of the received non-uniform memory access resource. The present application can determine all the target selected node sets by traversing all the starting non-uniform memory access resource nodes of the non-uniform memory access resource. The present application can determine the set that meets the target memory resource requirement and the first preset condition among all the target selected node sets as the target non-uniform memory access resource node set. The present application can allocate the target non-uniform memory access resource node set to the executor with the target memory resource requirement.

[0066] When a single NUMA node is not sufficient to meet the target memory resource requirement, the resource allocation method provided by the present application can allocate the target non-uniform memory access resource node set with the closest distance of the target selected node set to the executor for binding, so that the allocation of the non-uniform memory access resource is as much as possible on the NUMA node with the same resources as the executor (i.e., the non-uniform memory access resource of the local machine).

[0067] Moreover, this application allocates the set of target non-uniform memory access resource nodes that are closest to the set of target selected nodes to the executor, which can reduce the latency of the executor across different NUMA nodes, improve the computing efficiency, and thus enable the executor to achieve better performance in optimizing the memory access of non-uniform memory access resources.

[0068] Optionally, referring to Figure 2 , step S110 may include steps S111 - S114.

[0069] In step S111, the resource allocation device sets the first starting non-uniform memory access resource node in the first selected node set.

[0070] According to the exemplary embodiment, the first selected node set may be a memory resource set including the first starting non-uniform memory access resource node. The resource allocation device may place the first starting non-uniform memory access resource node in the first selected node set.

[0071] In step S112, the resource allocation device determines whether the first starting non-uniform memory access resource node meets the target memory resource requirement.

[0072] According to the exemplary embodiment, the resource allocation device may determine whether the memory resource information of the first starting non-uniform memory access resource node in the first selected node set meets the target memory resource requirement.

[0073] If the resource allocation device determines that the first starting non-uniform memory access resource node meets the target memory resource, the resource allocation device executes step S113.

[0074] In step S113, the resource allocation device determines the first selected node set as the first target selected node set.

[0075] According to the exemplary embodiment, when the resource allocation device determines that the memory resource information of the first starting non-uniform memory access resource node in the first selected node set meets the target memory resource requirement, it determines the first selected node set as the first target selected node set.

[0076] If the resource allocation device determines that the first starting non-uniform memory access resource node does not meet the target memory resource, the resource allocation device executes step S114.

[0077] In step S114, the resource allocation device adds non-uniform memory access resource nodes that meet the second preset condition to the first selected node set until the non-uniform memory access resource nodes in the first selected node set meet the target memory resource requirement, so as to determine the first selected node set that meets the target memory resource requirement as the first target selected node set.

[0078] According to the exemplary embodiment, the second preset condition may be that the distance between the newly added non-uniform memory access (NUMA) node and the first starting NUMA node is the closest. The resource allocation device may continue to determine whether the memory resource information of the NUMA nodes (including the first starting NUMA node and the newly added NUMA node) in the first selected node set meets the target memory resource requirement.

[0079] When the resource allocation device determines that the memory resource information of the NUMA nodes (including the first starting NUMA node and the newly added NUMA node) in the first selected node set meets the target memory resource requirement, it determines the current first selected node set as the first target selected node set.

[0080] When the resource allocation device determines that the memory resource information of the NUMA nodes (including the first starting NUMA node and the newly added NUMA node) in the first selected node set does not meet the target memory resource requirement, it may continue to add a non-uniform memory access resource node to the current first selected node set.

[0081] The second preset condition may also be that the distance between the newly added non-uniform memory access resource node and the first selected node set is the closest, that is, the sum of the distances between the newly added non-uniform memory access resource node and all the NUMA nodes (including the first starting NUMA node and multiple other non-uniform memory access resource nodes) in the first selected node set is the closest.

[0082] The resource allocation device may add non-uniform memory access resource nodes that meet the second preset condition to the first selected node set multiple times until the memory resource information of all the NUMA nodes in the first selected node set meets the target memory resource requirement. The resource allocation device determines the current first selected node set that has met the target memory resource requirement as the first target selected node set.

[0083] Through the above embodiments, the present application can set the first starting non-uniform memory access resource node in the first selected node set. The present application can determine whether the first starting non-uniform memory access resource node meets the target memory resource requirement.

[0084] The present application can add non-uniform memory access resource nodes that meet the second preset condition to the first selected node set until the non-uniform memory access resource nodes in the first selected node set meet the target memory resource requirement, so as to determine the first selected node set that meets the target memory resource requirement as the first target selected node set.

[0085] The present application can add non-uniform memory access resource nodes that meet the second preset condition to the first selected node set, so that the first target selected node set can not only meet the target memory resource requirements, but also make the current first selected node set (i.e., the distance of the first target selected node set) the closest.

[0086] Optionally, referring to Figure 3 , step S120 may include steps S121 - S122.

[0087] In step S121, the resource allocation device determines all the node numbers of the non-uniform memory access resource nodes in the first target selected node set to determine the maximum value of all the node numbers.

[0088] According to the exemplary embodiment, each non-uniform memory access resource node in the first target selected node set corresponds to a node number. The resource allocation device can determine the node numbers of each non-uniform memory access resource node in the first target selected node set, so as to determine all the node numbers and determine the maximum value of all the node numbers.

[0089] According to the exemplary embodiment, the resource allocation device can also determine the node numbers of the non-uniform memory access resource nodes allocated to the actuator last time, and determine the maximum value of the node numbers of the non-uniform memory access resource nodes allocated to the actuator last time.

[0090] In step S122, the resource allocation device starts traversing from the next starting non-uniform memory access resource node corresponding to the maximum value of all the node numbers to determine all the target selected node sets.

[0091] According to the exemplary embodiment, the resource allocation device can start traversing all the starting non-uniform memory access resource nodes of the non-uniform memory access resource from the next starting non-uniform memory access resource node corresponding to the maximum value of the node numbers, so as to determine all the target selected node sets.

[0092] According to the exemplary embodiment, the resource allocation device can also start traversing all the starting non-uniform memory access resource nodes of the non-uniform memory access resource from the next starting non-uniform memory access resource node corresponding to the maximum value of the node numbers of the non-uniform memory access resource nodes allocated to the actuator last time, so as to determine all the target selected node sets.

[0093] The process by which the resource allocation device determines all the target selected node sets has been described in step S120, so it will not be elaborated here.

[0094] Through the above embodiments, the present application can determine all the node numbers of the non-uniform memory access resource nodes in the first target selected node set to determine the maximum value of all the node numbers. The present application can traverse starting from the next starting non-uniform memory access resource node corresponding to the non-uniform memory access resource node corresponding to the maximum value of all the node numbers to determine the entire target selected node set.

[0095] In the case of traversing the starting non-uniform memory access resource node, the present application does not traverse in a fixed order from 1 to N, but starts traversing from the next starting non-uniform memory access resource node corresponding to the non-uniform memory access resource node corresponding to the maximum value of the node numbers. With such a setting, the resource allocation method provided by the present application can evenly allocate non-uniform memory access resource nodes, so that the executor is evenly allocated to different non-uniform memory access resource nodes, which is beneficial to the balanced distribution of resource utilization.

[0096] Through the above embodiments, the time complexity of the resource allocation method of the present application is O(N^3), and the time for memory resource allocation is only dozens of milliseconds, which can greatly reduce the memory resource allocation time.

[0097] According to one aspect of the present application, the present application provides a memory access method 2000 for non-uniform memory access. The memory access method 2000 can be executed by a memory access device. Exemplarily, the memory access device can be a host or a server with data processing capabilities.

[0098] See Figure 4 , the memory access method 2000 may include step S210-step S230.

[0099] In step S210, the memory method device receives non-uniform memory access resources from the executor and the target memory resource requirements of the distributed computing task to be executed by the executor. The non-uniform memory access resources and the target memory resource requirements are determined by the executor.

[0100] Distributed computing tasks can involve forming a cluster of multiple computers to jointly complete a computing task, which falls within the scope of distributed computing tasks. For example, a big data analysis system forms a cluster of multiple computers, and multiple executors are launched on each cluster to collaboratively complete big data processing tasks, which belongs to the category of distributed computing tasks. Common open-source distributed cluster systems include, for example, the Apache Hadoop cluster, and common open-source big data analysis systems include, for example, Apache Spark. Another example is that even if only a single computer is used, but if multiple independent executors are partitioned on the single computer to perform collaborative operations, it still belongs to the category of distributed computing tasks. For example, the local mode of the big data analysis system Apache Spark is this form.

[0101] An executor can be an object with relatively independent computing resources that can collaboratively complete computing tasks when being scheduled. For example, the actual form of an executor can be a process, a thread, or a container, etc.

[0102] According to the example embodiment, the executor can scan the non-uniform memory access resources of the local machine to obtain the non-uniform memory access resources of the local machine. The non-uniform memory access resources can include information such as the number of NUMA nodes (for example, N), the number of CPUs and the memory size of each NUMA node, and the distance between NUMA nodes.

[0103] The target memory resource requirement can be the NUMA resource requirement for the executor to execute the distributed computing task. For example, the target memory resource requirement can include the required CPUs and NUMA resources.

[0104] In step S220, the memory method device executes the resource allocation method 1000 as described above according to the access resources and the target memory resource requirement, and determines the target non-uniform memory access resource node set.

[0105] The process by which the memory method device determines the target non-uniform memory access resource node set is the same as the process by which the above-mentioned resource allocation device determines the target non-uniform memory access resource node set, so it will not be elaborated here.

[0106] In step S230, the memory method device sends the node information of the target non-uniform memory access resource node set to the executor, so that the executor binds to the target non-uniform memory access resource node set, and the executor executes the distributed computing task through the target non-uniform memory access resource node set.

[0107] According to an exemplary embodiment, the node information of the target non-uniform memory access resource node set may be the information of all NUMA nodes in the target non-uniform memory access resource node set. The node information may include the number of NUMA nodes in the target non-uniform memory access resource node set, the number of CPUs and the memory size of each NUMA node, and the distance between NUMA nodes, etc.

[0108] The memory method device may provide services to an executor on a distributed cluster through remote procedure calls or the like, so that the executor is bound to the target non-uniform memory access resource node set.

[0109] Through the above embodiments, the present application can receive non-uniform memory access resources from the executor and the target memory resource requirements. By accessing the resources and the target memory resource requirements, perform the resource allocation method as described above to determine the target non-uniform memory access resource node set. The present application can send the node information of the target non-uniform memory access resource node set to the executor, so that the executor is bound to the target non-uniform memory access resource node set, so that the executor can execute the distributed computing task through the target non-uniform memory access resource node set.

[0110] The memory access method provided by the present application can, when a single NUMA node is not sufficient to meet the target memory resource requirements, allocate the target non-uniform memory access resource node set with the shortest distance to the target selected node set to the executor for binding, so that the allocation of non-uniform memory access resources is as much as possible on the NUMA node with the same resources as the executor (i.e., the non-uniform memory access resources of the local machine).

[0111] Moreover, the present application allocates the target non-uniform memory access resource node set with the shortest distance to the target selected node set to the executor, which can reduce the latency of the executor on different NUMA nodes and improve the computing efficiency, so that the memory access optimization of the executor for non-uniform memory access resources reaches a better performance.

[0112] Optionally, referring to Figure 5 , the memory access method 2000 may further include step S240.

[0113] In step S240, the memory method device determines the available non-uniform memory access resource information according to the non-uniform memory access resource information and the node information, so as to execute the resource allocation method 1000 as described above next time according to the available non-uniform memory access resource information.

[0114] According to an exemplary embodiment, the available non-uniform memory access resource information may be the available non-uniform memory access resource information native to the executor.

[0115] For example, the memory method device may record the unbound non-uniform memory access resource information of each machine, so as to determine the available non-uniform memory access resource information.

[0116] In the case where there are other executors in the executor of the corresponding machine continuing to apply for NUMA resources, the allocation will be made according to the available non-uniform memory access resource information.

[0117] Through the above embodiments, the present application can determine the available non-uniform memory access resource information through the non-uniform memory access resource information and the node information, and allocate according to the available non-uniform memory access resource information, so as to evenly allocate the non-uniform memory access resource information.

[0118] Optionally, in step S220, the memory method device determines a target non-uniform memory access resource node set according to the access resource, the target memory resource requirement, and the brute-force enumeration method.

[0119] According to an exemplary embodiment, the brute-force enumeration method may be to enumerate each NUMA node set that meets the resource requirements, and then select a NUMA node set that is the closest to each other from them. Through the brute-force enumeration method, the memory access device can also select several NUMA nodes that are the closest to each other to determine the target non-uniform memory access resource node set.

[0120] However, it should be noted that the time complexity of the brute-force enumeration method is O(2^N), where N is the number of NUMA nodes. The time complexity will increase exponentially as N increases. When N increases to 32, the time complexity is high, and the time for memory resource allocation is about several seconds.

[0121] According to an aspect of the present application, the present application provides a non-uniform memory access resource allocation device 300. Refer to Figure 6 , the resource allocation device 300 may include a resource manager 310.

[0122] According to an exemplary embodiment, the resource manager 310 determines a first target selected node set according to the first starting non-uniform memory access resource node of the received non-uniform memory access resource.

[0123] The non-uniform memory access resource may be the non-uniform memory access resource information native to the executor sent by the executor. The non-uniform memory access resource may include information such as the number of NUMA nodes (e.g., N), the number of CPUs and the memory size of each NUMA node, and the distance between NUMA nodes.

[0124] The target memory resource requirement may be the NUMA resource requirement for the executor to execute the distributed computing task. For example, the target memory resource requirement may include the required CPUs and NUMA resources.

[0125] The first starting non-uniform memory access resource node may be a NUMA node in the non-uniform memory access resource.

[0126] The resource manager 310 may receive multiple non-uniform memory access resources native to the executor. Each non-uniform memory access resource may include multiple NUMA nodes. The resource manager 310 may randomly select a NUMA node as the first starting non-uniform memory access resource node.

[0127] The first selected node set may be a memory resource set including the first starting non-uniform memory access resource node.

[0128] The resource manager 310 may place the first starting non-uniform memory access resource node in the first selected node set. The first selected node set may also include other non-uniform memory access resource nodes. The selection condition for the other non-uniform memory access resource nodes placed in the first selected node set is that the distance between the non-uniform memory access resource node and the first starting non-uniform memory access resource node is the closest.

[0129] According to the example embodiment, the distance of the first selected node set may be the sum of the distances between all NUMA nodes (including the first starting non-uniform memory access resource node and multiple other non-uniform memory access resource nodes) in the first selected node set.

[0130] In the case where the first selected node set includes multiple other non-uniform memory access resource nodes, the resource manager 310 may also add non-uniform memory access resource nodes. The selection condition is that the newly added non-uniform memory access resource node is the closest to the first selected node set, that is, the sum of the distances between the newly added non-uniform memory access resource node and all NUMA nodes (including the first starting non-uniform memory access resource node and multiple other non-uniform memory access resource nodes) in the first selected node set is the closest, until the first selected node set meets the target memory resource requirements. The resource manager 310 may determine the current first selected node set that has met the target memory resource requirements as the first target selected node set.

[0131] The first target selected node set may be a memory resource set in which the memory resource information of all NUMA nodes in the set meets the target memory resource requirements.

[0132] According to the exemplary embodiment, the resource manager 310 traverses all starting non-uniform memory access resource nodes of the non-uniform memory access resources to determine all target selected node sets.

[0133] The starting non-uniform memory access resource node may be a NUMA node in the non-uniform memory access resources.

[0134] The resource manager 310 may use each non-uniform memory access resource node (NUMA node) in the non-uniform memory access resources as the starting non-uniform memory access resource node.

[0135] The selected node set may be a memory resource set including the starting non-uniform memory access resource node. The resource manager 310 may place a starting non-uniform memory access resource node in a selected node set. Each starting non-uniform memory access resource node corresponds to a selected node set.

[0136] The selected node set may also include other non-uniform memory access resource nodes. The selection condition for the other non-uniform memory access resource nodes placed in the selected node set is that the distance between the non-uniform memory access resource node and the starting non-uniform memory access resource node is the closest.

[0137] According to the exemplary embodiment, the distance of the selected node set may be the sum of the distances between all NUMA nodes (including the starting non-uniform memory access resource node and multiple other non-uniform memory access resource nodes) in the selected node set.

[0138] In the case where the selected node set includes multiple other non-uniform memory access resource nodes, the resource manager 310 may also add non-uniform memory access resource nodes. The selection condition is that the newly added non-uniform memory access resource node is the closest to the selected node set, that is, the sum of the distances between the newly added non-uniform memory access resource node and all NUMA nodes (including the starting non-uniform memory access resource node and multiple other non-uniform memory access resource nodes) in the selected node set is the closest, until the selected node set meets the target memory resource requirement. The resource manager 310 may determine the current selected node set that has met the target memory resource requirement as the target selected node set.

[0139] The target selected node set may be a memory resource set in which the memory resource information of all NUMA nodes in the set meets the target memory resource requirement.

[0140] The resource manager 310 may traverse all starting non-uniform memory access resource nodes of the non-uniform memory access resources, thereby forming all target selected node sets. Each target selected node set can meet the target memory resource requirement.

[0141] According to the exemplary embodiment, the resource manager 310 determines the target selected node set that meets the target memory resource requirement and the first preset condition among all the target selected node sets as the target non-uniform memory access resource node set.

[0142] The first preset condition may be that the distance of the target selected node set is the closest, that is, the sum of the distances between all NUMA nodes (including the starting non-uniform memory access resource node and multiple other non-uniform memory access resource nodes) in the target selected node set is the closest.

[0143] The target non-uniform memory access resource node set may be a memory resource set that meets the target memory resource requirement and the first preset condition.

[0144] The resource manager 310 may calculate the distances of all the target selected node sets, select a target selected node set with the closest distance among all the target selected node sets and that meets the target memory resource requirement as the target non-uniform memory access resource node set.

[0145] According to the exemplary embodiment, the resource manager 310 allocates the target non-uniform memory access resource node set to the executor with the target memory resource requirement.

[0146] The resource manager 310 may allocate a set of target non-uniform memory access resource nodes to an executor waiting to execute a distributed computing task. After receiving the set of target non-uniform memory access resource nodes, the executor may be bound to the NUMA nodes corresponding to the set of target non-uniform memory access resource nodes (including the starting non-uniform memory access resource node and multiple other non-uniform memory access resource nodes).

[0147] Through the above embodiments, the present application can determine a first set of target selected nodes through the first starting non-uniform memory access resource node of the received non-uniform memory access resources. The present application can traverse all the starting non-uniform memory access resource nodes of the non-uniform memory access resources to determine all the sets of target selected nodes. The present application can determine that the set satisfying the target memory resource requirement and the first preset condition in all the sets of target selected nodes is the set of target non-uniform memory access resource nodes. The present application can allocate the set of target non-uniform memory access resource nodes to an executor with a target memory resource requirement.

[0148] When a single NUMA node is not sufficient to meet the target memory resource requirement, the present application can allocate the set of target non-uniform memory access resource nodes closest to the set of target selected nodes to the executor for binding, so that the allocation of non-uniform memory access resources is as much as possible on the NUMA node with the same resources as the executor (i.e., the non-uniform memory access resources of the local machine).

[0149] Moreover, allocating the set of target non-uniform memory access resource nodes closest to the set of target selected nodes to the execution can reduce the latency of the executor on different NUMA nodes and improve the computing efficiency, so that the memory access optimization of the executor for non-uniform memory access resources reaches a better performance.

[0150] Optionally, the resource manager 310 sets the first starting non-uniform memory access resource node in the first set of selected nodes.

[0151] The first set of selected nodes may be a memory resource set including the first starting non-uniform memory access resource node. The resource manager 310 may place the first starting non-uniform memory access resource node in the first set of selected nodes.

[0152] According to an exemplary embodiment, the resource manager 310 determines whether the first starting non-uniform memory access resource node meets the target memory resource requirement.

[0153] The resource manager 310 may determine whether the memory resource information of the first starting non-uniform memory access resource node in the first set of selected points meets the target memory resource requirement.

[0154] If so, the resource manager 310 determines that the first selected node set is the first target selected node set. That is, when the resource manager 310 determines that the memory resource information of the first starting non-uniform memory access resource node in the first selected node set meets the target memory resource requirement, it determines the first selected node set as the first target selected node set.

[0155] If not, the resource manager 310 adds non-uniform memory access resource nodes that meet the second preset condition to the first selected node set until the non-uniform memory access resource nodes in the first selected node set meet the target memory resource requirement, so as to determine the first selected node set that meets the second preset condition as the first target selected node set.

[0156] The second preset condition may be that the distance between the newly added non-uniform memory access resource node and the first starting non-uniform memory access resource node is the closest. The resource manager 310 can continue to determine whether the memory resource information of the NUMA nodes (including the first starting non-uniform memory access resource node and the newly added non-uniform memory access resource node) in the first selected node set meets the target memory resource requirement.

[0157] When the resource manager 310 determines that the memory resource information of the NUMA nodes (including the first starting non-uniform memory access resource node and the newly added non-uniform memory access resource node) in the first selected node set meets the target memory resource requirement, it determines the current first selected node set as the first target selected node set.

[0158] When the resource manager 310 determines that the memory resource information of the NUMA nodes (including the first starting non-uniform memory access resource node and the newly added non-uniform memory access resource node) in the first selected node set does not meet the target memory resource requirement, it can continue to add non-uniform memory access resource nodes to the current first selected node set.

[0159] The second preset condition may also be that the distance between the newly added non-uniform memory access resource node and the first selected node set is the closest, that is, the sum of the distances between the newly added non-uniform memory access resource node and all the NUMA nodes (including the first starting non-uniform memory access resource node and multiple other non-uniform memory access resource nodes) in the first selected node set is the closest.

[0160] The resource manager 310 can add non-uniform memory access resource nodes that meet the second preset condition to the first selected node set multiple times until the memory resource information of all NUMA nodes in the first selected node set meets the target memory resource requirement. The resource manager 310 determines the current first selected node set that has met the target memory resource requirement as the first target selected node set.

[0161] Through the above embodiments, the present application can set the first starting non-uniform memory access resource node in the first selected node set. The present application can determine whether the first starting non-uniform memory access resource node meets the target memory resource requirement.

[0162] The present application can add non-uniform memory access resource nodes that meet the second preset condition to the first selected node set until the non-uniform memory access resource nodes in the first selected node set meet the target memory resource requirement, so as to determine the first selected node set that meets the target memory resource requirement as the first target selected node set.

[0163] The present application can add non-uniform memory access resource nodes that meet the second preset condition to the first selected node set, so that the first target selected node set can not only meet the target memory resource requirement, but also make the current first selected node set (i.e., the distance of the first target selected node set) the closest.

[0164] Optionally, the resource manager 310 determines all the node numbers of the non-uniform memory access resource nodes in the first target selected node set to determine the maximum value of all the node numbers.

[0165] Each non-uniform memory access resource node in the first target selected node set corresponds to a node number. The resource manager 310 can determine the node numbers of each non-uniform memory access resource node in the first target selected node set, so as to determine all the node numbers and determine the maximum value of all the node numbers.

[0166] According to the exemplary embodiment, the resource manager 310 can also determine the node number of the non-uniform memory access resource node allocated to the executor last time, and determine the maximum value of the node numbers of the non-uniform memory access resource nodes allocated to the executor last time.

[0167] According to the exemplary embodiment, the resource manager 310 starts traversing from the next starting non-uniform memory access resource node of the non-uniform memory access resource node corresponding to the maximum value of all the node numbers to determine all the target selected node sets.

[0168] The resource manager 310 can traverse all the starting non-uniform memory access resource nodes of the non-uniform memory access resources starting from the next starting non-uniform memory access resource node of the non-uniform memory access resource node corresponding to the maximum value of the node numbers, so as to determine all the target selected node sets.

[0169] According to the exemplary embodiment, the resource manager 310 can also traverse all the starting non-uniform memory access resource nodes of the non-uniform memory access resources starting from the next starting non-uniform memory access resource node of the non-uniform memory access resource node corresponding to the maximum value of the node numbers of the non-uniform memory access resource nodes allocated to the executor last time, so as to determine all the target selected node sets.

[0170] The process for the resource manager 310 to determine all the target selected node sets has been described above, so it will not be elaborated here.

[0171] Through the above embodiments, the present application can determine all the node numbers of the non-uniform memory access resource nodes in the first target selected node set to determine the maximum value of all the node numbers. The present application can traverse starting from the next starting non-uniform memory access resource node of the non-uniform memory access resource node corresponding to the maximum value of all the node numbers to determine all the target selected node sets.

[0172] In the case of traversing the starting non-uniform memory access resource nodes, the present application can start traversing from the next starting non-uniform memory access resource node of the non-uniform memory access resource node corresponding to the maximum value of the node numbers instead of traversing in a fixed order from 1 to N. With such a setting, the resource allocation method provided by the present application can evenly allocate the non-uniform memory access resource nodes, so that the executor 410 is evenly allocated to different non-uniform memory access resource nodes, which is beneficial to the balanced distribution of resource utilization.

[0173] Through the above embodiments, the time complexity of the resource allocation method of the resource manager 310 of the present application is O(N^3), and the time for memory resource allocation is only dozens of milliseconds, which can greatly reduce the memory resource allocation time.

[0174] According to one aspect of the present application, the present application provides a memory access device 400 for non-uniform memory access. Refer to Figure 7 , the memory access device 400 includes an executor 410 and a resource manager 310.

[0175] According to the exemplary embodiment, the executor 410 determines the non-uniform memory access resource information and the target memory resource requirements of the distributed computing tasks to be executed. A distributed computing task can be to form a cluster of multiple computers to jointly complete a computing task, which belongs to the category of distributed computing tasks. For example, a big data analysis system forms a cluster of multiple computers, and multiple executors 410 are started on each cluster to cooperate in completing the big data processing task, which belongs to the category of distributed computing tasks. Common open-source distributed cluster systems such as the Apache Hadoop cluster, and common open-source big data analysis systems such as Apache Spark. Another example is that even if only a single computer is used, but if multiple independent executors 410 are divided on the single computer to cooperate in computing, it still belongs to the category of distributed computing tasks. For example, the local mode of the big data analysis system Apache Spark is this form.

[0176] The executor 410 can be an object with relatively independent computing resources that can cooperate in completing a computing task under being scheduled. For example, the actual form of the executor 410 can be a process, a thread, or a container, etc.

[0177] The executor 410 can scan the non-uniform memory access resources of the local machine to obtain the non-uniform memory access resources of the local machine. The non-uniform memory access resources can include information such as the number of NUMA nodes (for example, N), the number of CPUs and the memory size of each NUMA node, and the distance between NUMA nodes.

[0178] For example, in the Linux operating system, the open-source library libnuma can be used, which provides corresponding API interfaces, and the executor 410 performs operations related to NUMA resources through system calls. For example, the executor 410 can obtain the number of NUMA nodes of the machine through the numa_num_configured_nodes interface, the executor 410 can obtain the CPU resource information of each NUMA node through the numa_node_to_cpus interface, the executor 410 can obtain the memory resource information of each NUMA node through the numa_node_size interface, and the executor 410 can obtain the distance between NUMA nodes through the numa_distance interface.

[0179] The open-source library libnuma is only one way to operate NUMA resources. Using other API interfaces, or directly using system call interfaces, etc., can also operate NUMA resources, which should still belong to the protection scope of this application.

[0180] The target memory resource requirement can be the NUMA resource requirement for the executor 410 to execute a distributed computing task. For example, the target memory resource requirement can include the required CPU and NUMA resources.

[0181] According to the exemplary embodiment, the resource manager 310 receives non-uniform memory access resource information and target memory resource requirements. The resource manager 310 executes the resource allocation method 1000 as described above according to the non-uniform memory access resource information and the target memory resource requirements, and determines a target non-uniform memory access resource node set.

[0182] The resource manager 310 can be an object that can provide resource allocation services to the executor 410. For example, the resource manager 310 can be a separate software, a thread in an application, or an independent hardware, chip, etc.

[0183] The process by which the resource manager 310 determines the target non-uniform memory access resource node set is the same as the process by which the above-mentioned resource allocation device 300 determines the target non-uniform memory access resource node set, so it will not be elaborated here.

[0184] According to the exemplary embodiment, the resource manager 310 sends the node information of the target non-uniform memory access resource node set to the executor 410.

[0185] The node information of the target non-uniform memory access resource node set can be the information of all NUMA nodes in the target non-uniform memory access resource node set. The node information can include the number of nodes of all NUMA nodes in the target non-uniform memory access resource node set, the number of CPUs and the memory size of each NUMA node, and the distance between NUMA nodes, etc.

[0186] The medium through which the resource manager 310 provides NUMA resource allocation services to the executor 410 can be any communication-supported protocol, framework, etc., including but not limited to TCP protocol, UDP protocol, C / S (client / server) architecture, RPC (remote procedure call) framework, WebSocket framework, and HTTP framework, etc.

[0187] According to the exemplary embodiment, the executor 410 binds to the target non-uniform memory access resource node set according to the node information. The executor 410 executes the distributed computing task through the target non-uniform memory access resource node set.

[0188] For example, the executor 410 can bind the application to the CPUs of the target non-uniform memory access resource node set through the numa_run_on_node_mask interface. The executor 410 can bind the application to the memory resources of the target non-uniform memory access resource node set through the numa_set_membind interface.

[0189] Through the above embodiments, the present application can receive non-uniform memory access resources from an actuator and target memory resource requirements. By using the access resources and the target memory resource requirements, the resource allocation method described above is executed to determine a target non-uniform memory access resource node set. The present application can send node information of the target non-uniform memory access resource node set to the actuator so that the actuator can be bound to the target non-uniform memory access resource node set, enabling the actuator to execute distributed computing tasks through the target non-uniform memory access resource node set.

[0190] When a single NUMA node is insufficient to meet the target memory resource requirements, the present application can allocate the target non-uniform memory access resource node set that is closest to the target selected node set to the actuator for binding, so that the allocation of non-uniform memory access resources is as close as possible to the NUMA node with the same resources as the actuator (i.e., the non-uniform memory access resources of the local machine).

[0191] Moreover, by allocating the target non-uniform memory access resource node set that is closest to the target selected node set to the actuator, the present application can reduce the latency of the actuator on different NUMA nodes, improve the computing efficiency, and thus optimize the memory access of the actuator to non-uniform memory access resources to achieve better performance.

[0192] Optionally, the resource manager 310 determines available non-uniform memory access resource information based on the non-uniform memory access resource information and the node information, and then executes the resource allocation method 1000 described above according to the available non-uniform memory access resource information next time.

[0193] The available non-uniform memory access resource information can be the available non-uniform memory access resource information of the local machine of the actuator 410.

[0194] For example, the resource manager 310 can record the unbound non-uniform memory access resource information of each machine to determine the available non-uniform memory access resource information.

[0195] When other actuators 410 on the corresponding machine continue to apply for NUMA resources, the resource manager 310 will allocate resources according to the available non-uniform memory access resource information.

[0196] Through the above embodiments, the present application can determine the available non-uniform memory access resource information based on the non-uniform memory access resource information and the node information, and perform allocation according to the available non-uniform memory access resource information, thereby enabling balanced allocation of non-uniform memory access resource information.

[0197] Optionally, the resource manager 310 determines a target non-uniform memory access (NUMA) resource node set according to the accessed resources, the target memory resource requirements, and the brute-force enumeration method.

[0198] According to an exemplary embodiment, the brute-force enumeration method may be to enumerate each NUMA node set that meets the resource requirements, and then select a NUMA node set that is closest to each other from them. Through the brute-force enumeration method, the resource manager 310 may also select several NUMA nodes that are closest to each other to determine the target non-uniform memory access resource node set.

[0199] However, it should be noted that the time complexity of the brute-force enumeration method is O(2^N), where N is the number of NUMA nodes. The time complexity will increase exponentially as N increases. When N increases to 32, the time complexity is high, and the time for memory resource allocation is about several seconds.

[0200] According to another aspect of the present application, the present application also provides a non-volatile computer-readable storage medium, on which a computer program is stored. When the computer program is executed by a processor, it can implement the resource allocation method for non-uniform memory access as described above.

[0201] According to another aspect of the present application, the present application also provides an electronic device, including: one or more processors; a storage device for storing one or more programs. When the one or more programs are executed by the one or more processors, the one or more processors can implement the resource allocation method for non-uniform memory access as described above.

[0202] According to another aspect of the present application, the present application also provides a computer program product, including: a computer program stored on a computer-readable storage medium; the computer program includes program instructions. When the program instructions are executed by a computer, the computer is caused to execute the resource allocation method for non-uniform memory access as described above.

[0203] According to another aspect of the present application, the present application also provides a non-volatile computer-readable storage medium, on which a computer program is stored. When the computer program is executed by a processor, it can implement the memory access method for non-uniform memory access as described above.

[0204] According to another aspect of the present application, the present application also provides an electronic device, including: one or more processors; a storage device for storing one or more programs. When the one or more programs are executed by the one or more processors, the one or more processors can implement the memory access method for non-uniform memory access as described above.

[0205] According to another aspect of the present application, the present application also provides a computer program product, including: a computer program stored on a computer-readable storage medium; the computer program includes program instructions that, when executed by a computer, cause the computer to execute the memory access method for non-uniform memory access as described above.

[0206] Finally, it should be noted that the above are only the preferred embodiments of the present application and are not intended to limit the present application. Although the present application has been described in detail with reference to the foregoing embodiments, those skilled in the art can still modify the technical solutions of the foregoing embodiments, or perform equivalent replacements for some of the technical features. Any modifications, equivalent replacements, improvements, etc. made within the spirit and principle of the present application shall be included within the protection scope of the present application.

Claims

1. A resource allocation method for non-uniform memory access, characterized in that Including: Determine a first target selected node set according to a first starting non-uniform memory access resource node of the received non-uniform memory access resource; Traverse all starting non-uniform memory access resource nodes of the non-uniform memory access resource to determine all target selected node sets; Determine that the target selected node set that meets the target memory resource requirement and the first preset condition in all the target selected node sets is the target non-uniform memory access resource node set; Allocate the target non-uniform memory access resource node set to the executor with the target memory resource requirement.

2. The resource allocation method according to claim 1, wherein The determining a first target selected node set according to a first starting non-uniform memory access resource node of the received non-uniform memory access resource includes: Set the first starting non-uniform memory access resource node in a first selected node set; Judge whether the first starting non-uniform memory access resource node meets the target memory resource requirement; If so, determine the first selected node set as the first target selected node set; If not, add non-uniform memory access resource nodes that meet the second preset condition to the first selected node set until the non-uniform memory access resource nodes in the first selected node set meet the target memory resource requirement, so as to determine the first selected node set that meets the second preset condition as the first target selected node set.

3. The resource allocation method according to claim 1, wherein The traversing all starting non-uniform memory access resource nodes of the non-uniform memory access resource to determine all target selected node sets includes: Determine all node numbers of the non-uniform memory access resource nodes in the first target selected node set to determine the maximum value of all the node numbers; Start traversing from the next starting non-uniform memory access resource node corresponding to the maximum value of all the node numbers to determine all the target selected node sets.

4. A memory access method for non-uniform memory access, characterized in that, Including: Receive the non-uniform memory access resource from the executor and the target memory resource requirement of the distributed computing task to be executed by the executor, wherein the non-uniform memory access resource and the target memory resource requirement are determined by the executor; Execute the resource allocation method according to any one of claims 1-3 according to the access resource and the target memory resource requirement to determine the target non-uniform memory access resource node set; Send the node information of the target non-uniform memory access resource node set to the executor so that the executor is bound to the target non-uniform memory access resource node set, so that the executor executes the distributed computing task through the target non-uniform memory access resource node set.

5. The memory access method according to claim 4, wherein After the sending the node information to the executor, the memory access method further includes: Determine the available non-uniform memory access resource information according to the non-uniform memory access resource information and the node information, so as to execute the resource allocation method according to any one of claims 1-3 next time according to the available non-uniform memory access resource information.

6. A resource allocation device for non-uniform memory access, characterized in that, The resource allocation device includes: A resource manager, which determines a first target selected node set according to the first starting non-uniform memory access resource node of the received non-uniform memory access resource; The resource manager traverses all the starting non-uniform memory access resource nodes of the non-uniform memory access resource to determine all the target selected node sets; The resource manager determines that the target selected node set that meets the target memory resource requirement and the first preset condition in all the target selected node sets is the target non-uniform memory access resource node set; The resource manager allocates the target non-uniform memory access resource node set to the executor with the target memory resource requirement.

7. The resource allocation device according to claim 6, wherein The resource manager sets the first starting non-uniform memory access resource node in the first selected node set; The resource manager determines whether the first starting non-uniform memory access resource node meets the target memory resource requirement; If so, the resource manager determines the first selected node set as the first target selected node set; If not, the resource manager adds non-uniform memory access resource nodes that meet the second preset condition to the first selected node set until the non-uniform memory access resource nodes in the first selected node set meet the target memory resource requirement, so as to determine that the first selected node set that meets the second preset condition is the first target selected node set.

8. The resource allocation device according to claim 7, wherein The resource manager determines all the node numbers of the non-uniform memory access resource nodes in the first target selected node set to determine the maximum value of all the node numbers; The resource manager starts traversing from the next starting non-uniform memory access resource node of the non-uniform memory access resource node corresponding to the maximum value of all the node numbers to determine all the target selected node sets.

9. A memory access device for non-uniform memory access, characterized in that, The memory access device includes: An executor, which determines the non-uniform memory access resource information and the target memory resource requirement of the distributed computing task to be executed; A resource manager, which receives the non-uniform memory access resource information and the target memory resource requirement; The resource manager executes the resource allocation method according to any one of claims 1-3 according to the non-uniform memory access resource information and the target memory resource requirement to determine a target non-uniform memory access resource node set; The resource manager sends the node information of the target non-uniform memory access resource node set to the executor; The executor binds to the target non-uniform memory access resource node set according to the node information; The executor executes the distributed computing task through the target non-uniform memory access resource node set.

10. The memory access device according to claim 9, wherein The resource manager determines available non-uniform memory access resource information according to the non-uniform memory access resource information and the node information, so as to execute the resource allocation method according to any one of claims 1-3 next time according to the available non-uniform memory access resource information.

Citation Information

Patent Citations

  • Container scheduling method and device, cluster system, electronic equipment and storage medium

    CN114610497A

  • Resource management method and device based on NUMA architecture storage system and medium

    CN115129473A

  • Virtualized resource scheduling method and device, equipment, storage medium and product

    CN119105853A

  • Process scheduling method and device based on NUMA architecture, electronic equipment and storage medium

    CN120123082A

  • Non-uniform memory access (NUMA) resource assignment and re-evaluation

    US20140237197A1

Cited By

  • Resource scheduling method and device, electronic equipment and storage medium

    CN121433918A