Non-uniform memory access resource allocation method, memory access method and device
By optimizing the NUMA node resource allocation method and selecting the nearest set of NUMA nodes for binding, the problem of low resource allocation efficiency in the Yarn cluster is solved, and the computational efficiency and performance of non-consistent memory access are improved.
Patent Information
- Application Number
- CN202510855328.X
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2025-06-25
- Publication Date
- 2025-11-04
- Estimated Expiration
- 2045-06-25
AI Technical Summary
In existing technologies, Yarn clusters fail to fully consider the combination of CPU and memory resources and the distance between NUMA nodes when allocating NUMA node resources, resulting in inefficient non-consistent memory access and failing to leverage the maximum advantage of NUMA node binding.
By determining the target set of selected nodes, resources are allocated preferentially to the set of NUMA nodes that are closest to it, ensuring that the executor is bound to the same NUMA nodes as much as possible, reducing latency and improving computational efficiency.
It optimizes memory access resource allocation when a single NUMA node is insufficient, reduces the latency of the executor on different NUMA nodes, and improves computational efficiency and performance.
Smart Images

Figure CN120371534B_ABST
Abstract
Description
TECHNICAL FIELD
[0001] The present application relates to the technical field of non-uniform memory access, in particular to a non-uniform memory access resource allocation method, a memory access method and device. BACKGROUND
[0002] A representative existing technology of non-uniform memory access optimization in distributed computing is the non-uniform memory access optimization of Yarn distributed computing cluster in Apache Hadoop open source software.
[0003] However, the NUMA resource allocation method of Yarn cluster is relatively simple. When a single NUMA node is insufficient to meet the CPU or memory requirements of an executor, Yarn will select multiple NUMA nodes to meet the resource requirements for allocation, but the allocation rule is only a simple polling of NUMA nodes. On the one hand, the polling allocation of CPU and memory resources is separated, and does not consider allocating memory resources on the same NUMA node as CPU resources as much as possible. On the other hand, it does not consider the different distances between different NUMA nodes to allocate a set of NUMA nodes closest to each other. This results in the efficiency of the Yarn cluster in this case being low, and the maximum advantage of NUMA node binding is not fully utilized.
[0004] The content of the part of the background is only the technology known to the discloser, and does not necessarily represent the prior art in the field. SUMMARY
[0005] The present application aims to provide a non-uniform memory access resource allocation method, a memory access method and device to solve the above technical problems.
[0006] According to an aspect of the present application, the present application provides a non-uniform memory access resource allocation method, the resource allocation method comprising: determining a first target selected node set according to a first starting non-uniform memory access resource node of a received non-uniform memory access resource; traversing all starting non-uniform memory access resource nodes of the non-uniform memory access resource to determine all target selected node sets; determining a target selected node set in all target selected node sets that meets a target memory resource requirement and a first preset condition as a target non-uniform memory access resource node set; and allocating the target non-uniform memory access resource node set to an executor that has a target memory resource requirement.
[0007] According to some embodiments of the present application, determining the first target selected node set according to the received first starting non-coherent memory access resource node of the non-coherent memory access resource includes: setting the first starting non-coherent memory access resource node in the first selected node set; determining whether the first starting non-coherent memory access resource node meets the target memory resource requirement; if yes, determining the first selected node set as the first target selected node set; if no, adding a non-coherent memory access resource node meeting the second preset condition to the first selected node set until the non-coherent 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 meeting the second preset condition as the first target selected node set.
[0008] According to some embodiments of the present application, traversing all starting non-coherent memory access resource nodes of the non-coherent memory access resource to determine all target selected node sets includes: determining all node numbers of the non-coherent memory access resource nodes in the first target selected node set, to determine the maximum value of all node numbers; starting from the next starting non-coherent memory access resource node corresponding to the maximum value of all node numbers to traverse, to determine all target selected node sets.
[0009] According to an aspect of the present application, the present application provides a non-coherent memory access memory access method. The memory access method includes: receiving a non-coherent memory access resource from an executor and a target memory resource requirement of a distributed computing task to be executed by the executor, wherein the non-coherent memory access resource and the target memory resource requirement are determined by the executor; according to the access resource and the target memory resource requirement, executing the resource allocation method as described above to determine a target non-coherent memory access resource node set; sending node information of the target non-coherent memory access resource node set to the executor, so that the executor is bound to the target non-coherent memory access resource node set, so that the executor executes the distributed computing task through the target non-coherent 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-coherent memory access resource information according to the non-coherent memory access resource information and the node information, to execute the resource allocation method as described above next time according to the available non-coherent memory access resource information.
[0011] According to an aspect of the present application, the present application provides a resource allocation device for non-uniform memory access. The resource allocation device comprises a resource manager. The resource manager determines a first target selected node set according to a first starting non-uniform memory access resource node of received non-uniform memory access resources. The resource manager traverses all starting non-uniform memory access resource nodes of the non-uniform memory access resources to determine all target selected node sets. The resource manager determines a target selected node set satisfying a target memory resource requirement and a first preset condition from all target selected node sets as a target non-uniform memory access resource node set. The resource manager allocates the target non-uniform memory access resource node set to an executor existing 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 satisfies the target memory resource requirement. If yes, the resource manager determines the first selected node set as the first target selected node set. If no, the resource manager adds a non-uniform memory access resource node satisfying a second preset condition to the first selected node set until the non-uniform memory access resource nodes in the first selected node set satisfy the target memory resource requirement to determine the first selected node set satisfying 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 node numbers of the non-uniform memory access resource nodes in the first target selected node set to determine a maximum value of all node numbers. The resource manager starts traversing from a next starting non-uniform memory access resource node corresponding to the maximum value of all node numbers to determine all target selected node sets.
[0014] According to an aspect of the present application, the present application provides a memory access device for non-uniform memory access. The memory access device comprises an executor and a resource manager. The executor determines non-uniform memory access resource information and a target memory resource requirement of a 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 a resource allocation method as described above 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 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 available non-coherent memory access resource information according to the non-coherent memory access resource information and the node information, to perform the resource allocation method as described above next time according to the available non-coherent memory access resource information.
[0016] According to another aspect of the present application, the present application further provides a non-transitory computer readable storage medium having stored thereon a computer program, which, when executed by a processor, enables the non-coherent memory access resource allocation method as described above.
[0017] According to another aspect of the present application, the present application further provides an electronic device, comprising: one or more processors; a storage device configured to store one or more programs, which, when executed by the one or more processors, enable the one or more processors to implement the non-coherent memory access resource allocation method as described above.
[0018] According to another aspect of the present application, the present application further provides a computer program product, comprising: a computer program stored on a computer readable storage medium; the computer program comprising program instructions that, when executed by a computer, cause the computer to perform the non-coherent memory access resource allocation method as described above.
[0019] According to another aspect of the present application, the present application further provides a non-transitory computer readable storage medium having stored thereon a computer program, which, when executed by a processor, enables the non-coherent memory access method as described above.
[0020] According to another aspect of the present application, the present application further provides an electronic device, comprising: one or more processors; a storage device configured to store one or more programs, which, when executed by the one or more processors, enable the one or more processors to implement the non-coherent memory access method as described above.
[0021] According to another aspect of the present application, the present application further provides a computer program product, comprising: a computer program stored on a computer readable storage medium; the computer program comprising program instructions that, when executed by a computer, cause the computer to perform the non-coherent memory access method as described above.
[0022] Advantageous effects
[0023] The application can determine the first target selected node set through the first starting non-coherent memory access resource node of the received non-coherent memory access resource. The application can determine the total target selected node set by traversing all starting non-coherent memory access resource nodes of the non-coherent memory access resource. The application can determine the target non-coherent memory access resource node set as the set that meets the target memory resource requirement and the first preset condition in the total target selected node set. The application can assign the target non-coherent memory access resource node set to the executor that has the target memory resource requirement.
[0024] The resource allocation method provided by the application can assign the target non-coherent memory access resource node set closest to the target selected node set to the executor in the case that a single NUMA node is insufficient to meet the target memory resource requirement, so that the executor is bound, thereby making the allocation of the non-coherent memory access resource as much as possible on the same NUMA node as the executor resource (i.e., the local non-coherent memory access resource).
[0025] In addition, the application assigns the target non-coherent memory access resource node set closest to the target selected node set to the executor, which can reduce the delay of the executor in different NUMA nodes, improve the efficiency of calculation, and thereby make the optimization of the memory access of the executor to the non-coherent memory access resource achieve better performance. BRIEF DESCRIPTION OF DRAWINGS
[0026] In order to more clearly illustrate the technical solutions in the embodiments of the application, the following will briefly introduce the drawings needed to be used in the embodiment description. Obviously, the drawings in the following description are only some embodiments of the application, and other drawings can also be obtained by those skilled in the art without creative labor.
[0027] Figure 1 A flowchart of a resource allocation method 1000 according to an embodiment of the application is shown;
[0028] Figure 2 A flowchart of step S110 according to an embodiment of the application is shown;
[0029] Figure 3 A flowchart of step S120 according to an embodiment of the application is shown;
[0030] Figure 4 A flowchart of a memory access method 2000 according to an embodiment of the application is shown;
[0031] Figure 5 Another flowchart of the memory access method 2000 according to an embodiment of the application is shown.
[0032] Figure 6 Fig. 1 shows a schematic diagram of a resource allocation apparatus according to an embodiment of the present application;
[0033] Figure 7 Fig. 2 shows a schematic diagram of a memory access apparatus according to an embodiment of the present application.
[0034] Legend of reference signs:
[0035] Resource allocation apparatus 300; resource manager 310.
[0036] Memory access apparatus 400; executor 410. DETAILED DESCRIPTION
[0037] Example embodiments now will be described more fully hereinafter with reference to the accompanying drawings. Example embodiments, however, can be implemented in many different forms and should not be construed as limited to the embodiments set forth herein; rather, these embodiments are provided so that this disclosure will be thorough and complete, and will fully convey the scope of example embodiments to those skilled in the art. Like reference numerals refer to like elements throughout the figures, and descriptions of the same or similar elements can be not be repeated.
[0038] The described features, structures, or characteristics can be combined in any suitable manner in one or more embodiments. In the following description, numerous specific details are provided to give a thorough understanding of embodiments of the disclosure. One skilled in the relevant art will recognize, however, that the techniques described herein can be practiced without one or more of the specific details, or with other methods, components, materials, and so forth. In other instances, well-known structures, methods, devices, implementations, materials, and so forth have not been described in detail in order to avoid obscuring aspects of the present disclosure.
[0039] Furthermore, the term "comprising" and "including" and their variants are intended to cover both the case where only the stated elements are present and the case where additional elements are present. For example, a process, method, system, product, or apparatus that comprises or includes one or more steps or units is not limited to only those steps or units, but can also include additional steps or units that are not listed.
[0040] The terms "first", "second", and the like, in the description and in the claims, do not necessarily denote any ordinal, but are used to distinguish different objects.
[0041] With reference to the drawings of the embodiments of the present application, the technical solutions of the present application are clearly and completely described below. Obviously, the described embodiments are only a part of the embodiments of the present application, rather than all the embodiments of the present application. Based on the embodiments of the present application, all other embodiments obtained by those skilled in the art without creative work fall within the scope of protection of the present application.
[0042] The English and its English full name and corresponding Chinese explanation involved in the present application are as follows:
[0043] NUMA, Non-Uniform Memory Access, non-uniform memory access;
[0044] CPU, Central Processing Unit, central processing unit;
[0045] Apache Hadoop, an open source distributed system framework;
[0046] Apache Spark, an open source cluster computing system;
[0047] Executor, executor;
[0048] TCP, Transmission Control Protocol, Transmission Control Protocol;
[0049] UDP, User Datagram Protocol, User Datagram Protocol;
[0050] C / S, Client / Server, Client / Server;
[0051] RPC, Remote Procedure Call, Remote Procedure Call;
[0052] WebSocket, a network communication protocol;
[0053] HTTP, HyperText Transfer Protocol, HyperText Transfer Protocol;
[0054] API, Application Programming Interface, Application Programming Interface.
[0055] In NUMA topology, the whole physical memory space is split into multiple NUMA nodes, each of which has a separate memory controller and local memory, and the processors are divided into these NUMA nodes. In this way, each processor has a part of directly connected memory, called local memory, and the remaining memory is remote memory. The delay of the processor accessing the local memory is the lowest, while the remote memory needs to be accessed through the interconnection communication between processors, and the delay will be higher, and the delay of accessing the remote memory of different nodes (hereinafter referred to as the distance between NUMA nodes) is not the same.
[0056] In the NUMA topology, if only the processors and memory resources under a specific NUMA node are used, the best performance will be obtained, and once the processors and memories are in different NUMA nodes, it will inevitably affect the performance. The default scheduling strategy of the Linux operating system cannot guarantee to always allocate resources under a specific NUMA node for a task, but provides an interface for the application program to choose to bind the task to a specific NUMA node.
[0057] A representative existing technology for non-uniform memory access optimization in distributed computing is the non-uniform memory access optimization of the Yarn distributed computing cluster in the Apache Hadoop open source software. The Yarn cluster of Apache Hadoop has provided native non-uniform memory access optimization support since version 3.1.0, which can be started through corresponding configuration. When the Yarn cluster starts the non-uniform memory access optimization, it will start a NUMA resource manager (NUMA Resources Manager), and each time a new container executor (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 the CPU and memory resources allocated to this executor, and finally the executor will bind itself to the CPU and memory resources obtained from the NUMA resource manager.
[0058] According to an aspect of the present application, the present application provides a non-uniform memory access resource allocation method 1000. The resource allocation method 1000 can be executed by a resource allocation device. Illustratively, the resource allocation device can be a host or server with data processing capability.
[0059] Referring to Figure 1 , the resource allocation method 1000 can include steps S110-S140.
[0060] In step S110, the resource allocation apparatus determines a first target selected node set according to the received first starting non-uniform memory access resource node of the non-uniform memory access resource.
[0061] According to an example embodiment, the non-uniform memory access resource can be an executor native non-uniform memory access resource information sent from an executor. The non-uniform memory access resource can include a NUMA node number (e.g., N), a CPU number and a memory size of each NUMA node, and a distance between NUMA nodes, etc.
[0062] The target memory resource requirement can be a NUMA resource requirement of the executor for executing the distributed computing task. For example, the target memory resource requirement can include required CPU and NUMA resources.
[0063] The first starting non-uniform memory access resource node can be a NUMA node in the non-uniform memory access resource.
[0064] The resource allocation apparatus can receive a plurality of non-uniform memory access resources native to the executor. Each non-uniform memory access resource can include a plurality of NUMA nodes. The resource allocation apparatus can randomly select a NUMA node as the first starting non-uniform memory access resource node.
[0065] The first selected node set can be a memory resource set including the first starting non-uniform memory access resource node.
[0066] The resource allocation apparatus 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 of 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 nodes and the first starting non-uniform memory access resource node is the closest.
[0067] According to an example 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 a plurality of other non-uniform memory access resource nodes) in the first selected node set.
[0068] In the case that the first selected node set includes a plurality of other NUMA resource nodes, the resource allocation apparatus can further add a NUMA resource node. The selection condition is that the newly added NUMA resource node is closest to the first selected node set, i.e., the sum of distances between the newly added NUMA resource node and all NUMA nodes (including the first starting NUMA resource node and the plurality of other NUMA resource nodes) in the first selected node set is closest, until the first selected node set meets the target memory resource requirement. The resource allocation apparatus can determine the current first selected node set that has met the target memory resource requirement as the first target selected node set.
[0069] 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.
[0070] In step S120, the resource allocation apparatus traverses all starting NUMA resource nodes of the NUMA resources to determine all target selected node sets.
[0071] According to an example embodiment, the starting NUMA resource node can be one NUMA node in the NUMA resources.
[0072] The resource allocation apparatus can take each NUMA resource node (NUMA node) in the NUMA resources as a starting NUMA resource node.
[0073] The selected node set can be a memory resource set including the starting NUMA resource node. The resource allocation apparatus can place one starting NUMA resource node in one selected node set. Each starting NUMA resource node corresponds to one selected node set.
[0074] The selected node set can further include other NUMA resource nodes. The selection condition for the other NUMA resource nodes placed in the selected node set is that the distance between the NUMA resource node and the starting NUMA resource node is closest.
[0075] According to an example embodiment, the distance of the selected node set can be the sum of distances between all NUMA nodes (including the starting NUMA resource node and the plurality of other NUMA resource nodes) in the selected node set.
[0076] In the case that the selected node set includes multiple other NUMA resource nodes, the resource allocation apparatus can further add a NUMA resource node. The condition for selection is that the newly added NUMA resource node is closest to the selected node set, that is, the sum of distances between the newly added NUMA resource node and all NUMA nodes in the selected node set (including the starting NUMA resource node and the multiple other NUMA resource nodes) is closest, until the selected node set meets the target memory resource requirement. The resource allocation apparatus can determine the current selected node set that has met the target memory resource requirement as the target selected node set.
[0077] The 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.
[0078] The resource allocation apparatus can traverse all starting NUMA resource nodes of the NUMA resource, thereby forming all target selected node sets. Each target selected node set can meet the target memory resource requirement.
[0079] In step S130, the resource allocation apparatus determines the target selected node set that meets the target memory resource requirement and the first preset condition from all target selected node sets as the target NUMA resource node set.
[0080] According to an example embodiment, the first preset condition can be that the target selected node set is closest, that is, the sum of distances between all NUMA nodes in the target selected node set (including the starting NUMA resource node and the multiple other NUMA resource nodes) is closest.
[0081] The target NUMA resource node set can be a memory resource set that meets the target memory resource requirement and the first preset condition.
[0082] The resource allocation apparatus can calculate the distances of all target selected node sets, and select one target selected node set that is closest and meets the target memory resource requirement as the target NUMA resource node set.
[0083] In step S140, the resource allocation apparatus allocates the target NUMA resource node set to the executor that has the target memory resource requirement.
[0084] According to an example embodiment, the resource allocation apparatus can allocate the target NUMA resource node set to an executor waiting for execution of a distributed computing task. After the executor receives the target NUMA resource node set, the executor can bind to the corresponding NUMA nodes (including the starting NUMA resource node and the plurality of other NUMA resource nodes) in the target NUMA resource node set.
[0085] Through the above embodiments, the application can determine the first target selected node set through the received first starting NUMA resource node of the NUMA resource. The application can determine the total target selected node set by traversing all the starting NUMA resource nodes of the NUMA resource. The application can determine the target NUMA resource node set by determining the set satisfying the target memory resource requirement and the first preset condition in the total target selected node set. The application can allocate the target NUMA resource node set to the executor existing the target memory resource requirement.
[0086] The resource allocation method provided by the application can allocate the target NUMA resource node set closest to the target selected node set to the executor in the case that a single NUMA node is insufficient to meet the target memory resource requirement, so that the executor is bound, thereby making the allocation of the NUMA resource as close as possible to the same NUMA node as the executor resource (i.e., the local NUMA resource).
[0087] In addition, the application can allocate the target NUMA resource node set closest to the target selected node set to the executor, which can reduce the delay of the executor in different NUMA nodes, improve the efficiency of the calculation, and thereby make the memory access optimization of the executor to the NUMA resource achieve better performance.
[0088] Optionally, referring to Figure 2 , the step S110 can include steps S111-S114.
[0089] In step S111, the resource allocation apparatus sets the first starting NUMA resource node in the first selected node set.
[0090] According to an example embodiment, the first selected node set can be a memory resource set including the first starting NUMA resource node. The resource allocation apparatus can place the first starting NUMA resource node in the first selected node set.
[0091] In step S112, the resource allocation apparatus determines whether the first starting NUMA resource node in the first selected node set meets the target memory resource requirement.
[0092] According to an example embodiment, the resource allocation apparatus can determine whether the memory resource information of the first starting NUMA resource node in the first selected node set meets the target memory resource requirement.
[0093] If the resource allocation apparatus determines that the first starting NUMA resource node meets the target memory resource, the resource allocation apparatus performs step S113.
[0094] In step S113, the resource allocation apparatus determines the first selected node set as the first target selected node set.
[0095] According to an example embodiment, in a case where the resource allocation apparatus determines that the memory resource information of the first starting NUMA resource node in the first selected node set meets the target memory resource requirement, the resource allocation apparatus determines the first selected node set as the first target selected node set.
[0096] If the resource allocation apparatus determines that the first starting NUMA resource node does not meet the target memory resource, the resource allocation apparatus performs step S114.
[0097] In step S114, the resource allocation apparatus adds a NUMA resource node meeting a second preset condition to the first selected node set until the NUMA resource nodes in the first selected node set meet the target memory resource requirement, so as to determine the first selected node set meeting the target memory resource requirement as the first target selected node set.
[0098] According to an example embodiment, the second preset condition can be that the distance between the added NUMA resource node and the first starting NUMA resource node is the closest. The resource allocation apparatus can continue to determine whether the memory resource information of the NUMA nodes (including the first starting NUMA resource node and the added NUMA resource node) in the first selected node set meets the target memory resource requirement.
[0099] In a case where the resource allocation apparatus determines that the memory resource information of the NUMA nodes (including the first starting NUMA resource node and the added NUMA resource node) in the first selected node set meets the target memory resource requirement, the resource allocation apparatus determines the current first selected node set as the first target selected node set.
[0100] In a case where the resource allocation apparatus determines that the memory resource information of the NUMA nodes (including the first starting NUMA node and the added NUMA node) in the first selected node set does not meet the target memory resource requirement, the resource allocation apparatus can continue to add the NUMA node meeting the second preset condition to the first selected node set.
[0101] The second preset condition can also be that the added NUMA node is closest to the first selected node set, that is, the sum of distances between the added NUMA node and all the NUMA nodes (including the first starting NUMA node and the plurality of other NUMA nodes) in the first selected node set is closest.
[0102] The resource allocation apparatus can add the NUMA node meeting the second preset condition to the first selected node set for 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 apparatus determines the current first selected node set that has met the target memory resource requirement as the first target selected node set.
[0103] Through the above embodiments, the application can set the first starting NUMA node in the first selected node set. The application can determine whether the first starting NUMA node meets the target memory resource requirement.
[0104] The application can add the NUMA node meeting the second preset condition to the first selected node set until the NUMA nodes in the first selected node set meet the target memory resource requirement, so as to determine the first selected node set meeting the target memory resource requirement as the first target selected node set.
[0105] The application can add the NUMA node meeting the second preset condition to the first selected node set, so that the first target selected node set can meet the target memory resource requirement and the current first selected node set (i.e., the distance of the first target selected node set) is closest.
[0106] Optionally, referring to Figure 3 , the step S120 can include steps S121-S122.
[0107] In step S121, the resource allocation apparatus determines all the node numbers of the NUMA nodes in the first target selected node set to determine the maximum value of all the node numbers.
[0108] According to an example embodiment, each non-coherent memory access resource node in the first target selected node set corresponds to a node number. The resource allocation apparatus can determine the node number of each non-coherent memory access resource node in the first target selected node set, determine all node numbers, and determine the maximum value of all node numbers.
[0109] According to an example embodiment, the resource allocation apparatus can also determine the node number of the last non-coherent memory access resource node allocated to the executor, and determine the maximum value of the node number of the last non-coherent memory access resource node allocated to the executor.
[0110] In step S122, the resource allocation apparatus starts traversing from the next starting non-coherent memory access resource node of the non-coherent memory access resource node corresponding to the maximum value of all node numbers to determine the entire target selected node set.
[0111] According to an example embodiment, the resource allocation apparatus can start traversing all starting non-coherent memory access resource nodes of the non-coherent memory access resource from the next starting non-coherent memory access resource node of the non-coherent memory access resource node corresponding to the maximum value of the node numbers to determine the entire target selected node set.
[0112] According to an example embodiment, the resource allocation apparatus can also start traversing all starting non-coherent memory access resource nodes of the non-coherent memory access resource from the next starting non-coherent memory access resource node of the non-coherent memory access resource node corresponding to the maximum value of the node numbers of the last non-coherent memory access resource node allocated to the executor to determine the entire target selected node set.
[0113] The process of determining the entire target selected node set by the resource allocation apparatus has been described in step S120, and thus will not be described here.
[0114] Through the above-described embodiments, the present application can determine the maximum value of all node numbers by determining all node numbers of the non-coherent memory access resource nodes in the first target selected node set. The present application can determine the entire target selected node set by starting traversing from the next starting non-coherent memory access resource node of the non-coherent memory access resource node corresponding to the maximum value of all node numbers.
[0115] The application can traverse from the next starting non-coherent memory access resource node corresponding to the maximum node number of the non-coherent memory access resource nodes, instead of traversing in a fixed order from 1 to N when traversing the starting non-coherent memory access resource node. In this way, the resource allocation method provided by the application can uniformly allocate non-coherent memory access resource nodes, so that the executors are uniformly allocated to different non-coherent memory access resource nodes, which is beneficial to the balanced distribution of resource utilization.
[0116] According to the above embodiment, the time complexity of the resource allocation method of the application is O (N^3), and the memory resource allocation time is only tens of milliseconds, which can greatly reduce the memory resource allocation time.
[0117] According to an aspect of the application, the application provides a non-coherent memory access memory access method 2000. The memory access method 2000 can be executed by a memory access device. Illustratively, the memory access device can be a host or a server with data processing capability.
[0118] Referring to Figure 4 , the memory access method 2000 can include steps S210-S230.
[0119] In step S210, the memory method device receives non-coherent memory access resources from an executor and target memory resource requirements of a distributed computing task to be executed by the executor. The non-coherent memory access resources and the target memory resource requirements are determined by the executor.
[0120] The distributed computing task can be a cluster composed 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 is composed of multiple computers, multiple executors (Executors) are started on each cluster to cooperatively complete big data processing tasks, which belongs to the category of distributed computing tasks. Common open source distributed cluster systems are, for example, Apache Hadoop cluster, and common open source big data analysis systems are, for example, Apache Spark. For another example, even if only a single computer is used, if multiple independent executors are divided on the single computer to cooperatively operate, it still belongs to the category of distributed computing tasks, for example, the local mode of the big data analysis system Apache Spark.
[0121] The executor can be an object with relatively independent computing resources, which can cooperatively complete a computing task when scheduled. For example, the actual form of the executor can be a process, a thread, or a container, etc.
[0122] According to an example embodiment, the executor can scan the local non-uniform memory access resource to obtain the local non-uniform memory access resource. The non-uniform memory access resource can include information such as a number of NUMA nodes (for example, N), a number of CPUs and a memory size of each NUMA node, and a distance between the NUMA nodes.
[0123] The target memory resource requirement can be a NUMA resource requirement of the executor for performing the distributed computing task. For example, the target memory resource requirement can include required CPUs and NUMA resources.
[0124] In step S220, the memory method device determines a target non-uniform memory access resource node set according to the access resource and the target memory resource requirement, by performing the resource allocation method 1000 as described above.
[0125] The process of determining the target non-uniform memory access resource node set by the memory method device is the same as the process of determining the target non-uniform memory access resource node set by the resource allocation device as described above, and thus will not be described again here.
[0126] In step S230, the memory method device sends 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 performs the distributed computing task through the target non-uniform memory access resource node set.
[0127] According to an example embodiment, the node information of the target non-uniform memory access resource node set can be information of all NUMA nodes in the target non-uniform memory access resource node set. The node information can include information such as a number of nodes, a number of CPUs and a memory size of each NUMA node, and a distance between the NUMA nodes of all NUMA nodes in the target non-uniform memory access resource node set.
[0128] The memory method device can provide services to the executor on the distributed cluster through remote procedure calls and the like, so that the executor is bound to the target non-uniform memory access resource node set.
[0129] Through the above-described embodiments, the present application can receive a non-uniform memory access resource and a target memory resource requirement from an executor, and determine a target non-uniform memory access resource node set by performing a resource allocation method as described above according to the access resource and the target memory resource requirement. The present application can send 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 as to enable the executor to perform a distributed computing task through the target non-uniform memory access resource node set.
[0130] The memory access method provided in the application can allocate the target non-uniform memory access resource node set closest to the target selected node set to the executor, so that the executor is bound, so that the allocation of the non-uniform memory access resource is as possible as the same NUMA node as the executor resource (i.e. the local non-uniform memory access resource).
[0131] In addition, the application allocates the target non-uniform memory access resource node set closest to the target selected node set to the executor, which can reduce the delay of the executor in different NUMA nodes, improve the efficiency of calculation, so that the memory access optimization of the executor to the non-uniform memory access resource achieves better performance.
[0132] Optionally, referring to Figure 5 , the memory access method 2000 can further include step S240.
[0133] 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 next time according to the available non-uniform memory access resource information.
[0134] According to an example embodiment, the available non-uniform memory access resource information can be the available non-uniform memory access resource information of the local executor.
[0135] For example, the memory method device can record the non-uniform memory access resource information of each machine which is not bound, so as to determine the available non-uniform memory access resource information.
[0136] In the case that the executor of the corresponding machine has other executors continue to apply for NUMA resources, the allocation will be made according to the available non-uniform memory access resource information.
[0137] Through the above embodiment, the application can 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 make allocation according to the available non-uniform memory access resource information, so as to balance the allocation of the non-uniform memory access resource information.
[0138] Optionally, in step S220, the memory method device determines the target non-uniform memory access resource node set according to the access resource, the target memory resource requirement and the brute force enumeration method.
[0139] According to an example embodiment, the brute-force enumeration method can enumerate every NUMA node set satisfying the resource requirement, and then select a NUMA node set closest to each other from the NUMA node sets. Through the brute-force enumeration method, the memory access device can also select a plurality of NUMA nodes closest to each other to determine the target NUMA resource node set.
[0140] 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 increases exponentially with the increase of N. In the case of N increasing to 32, the time complexity is high, and the time of memory resource allocation is about several seconds.
[0141] According to an aspect of the present application, the present application provides a non-uniform memory access resource allocation device 300. Referring to Figure 6 , the resource allocation device 300 can include a resource manager 310.
[0142] According to an example embodiment, the resource manager 310 determines a first target selected node set according to a received first starting non-uniform memory access resource node of a non-uniform memory access resource.
[0143] The non-uniform memory access resource can be the non-uniform memory access resource information from the executor native sent by the executor. The non-uniform memory access resource 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 the NUMA nodes.
[0144] The target memory resource requirement can be the NUMA resource requirement of the executor to execute the distributed computing task. For example, the target memory resource requirement can include the required CPU and NUMA resource.
[0145] The first starting non-uniform memory access resource node can be a NUMA node in the non-uniform memory access resource.
[0146] The resource manager 310 can receive a plurality of non-uniform memory access resources from the executor native. Each non-uniform memory access resource can include a plurality of NUMA nodes. The resource manager 310 can randomly select a NUMA node as the first starting non-uniform memory access resource node.
[0147] The first selected node set can be a memory resource set including the first starting non-uniform memory access resource node.
[0148] The resource manager 310 can place the first starting non-uniform memory access resource node in a first selected node set. The first selected node set can further include other non-uniform memory access resource nodes. The selection of the other non-uniform memory access resource nodes placed in the first selected node set is based on the distance between the non-uniform memory access resource nodes and the first starting non-uniform memory access resource node being the closest.
[0149] According to an example embodiment, the distance of the first selected node set can be the sum of the distances between all the NUMA nodes (including the first starting non-uniform memory access resource node and the plurality of other non-uniform memory access resource nodes) in the first selected node set.
[0150] In the case that the first selected node set includes the plurality of other non-uniform memory access resource nodes, the resource manager 310 can further add non-uniform memory access resource nodes. The selection is based on the distance between the added non-uniform memory access resource nodes and the first selected node set being the closest, i.e., the sum of the distances between the added non-uniform memory access resource nodes and all the NUMA nodes (including the first starting non-uniform memory access resource node and the plurality of other non-uniform memory access resource nodes) in the first selected node set being the closest, until the first selected node set meets the target memory resource requirement. The resource manager 310 can determine the current first selected node set that has met the target memory resource requirement as the first target selected node set.
[0151] The first target selected node set can be a memory resource set in which the memory resource information of all the NUMA nodes in the set meets the target memory resource requirement.
[0152] According to an example embodiment, the resource manager 310 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.
[0153] The starting non-uniform memory access resource node can be one NUMA node in the non-uniform memory access resource.
[0154] The resource manager 310 can take each non-uniform memory access resource node (NUMA node) in the non-uniform memory access resource as a starting non-uniform memory access resource node.
[0155] The selected node set can be a memory resource set including the starting non-uniform memory access resource node. The resource manager 310 can place one starting non-uniform memory access resource node in one selected node set. Each starting non-uniform memory access resource node corresponds to one selected node set.
[0156] The selected node set can also include other non-uniform memory access resource nodes. The selected condition for placing other non-uniform memory access resource nodes in the selected node set is that the distance between the non-uniform memory access resource nodes and the starting non-uniform memory access resource node is the shortest.
[0157] According to an example embodiment, the distance of the selected node set can be the sum of the distances between all NUMA nodes (including the starting non-uniform memory access resource node and the plurality of other non-uniform memory access resource nodes) in the selected node set.
[0158] In the case where the selected node set includes a plurality of other non-uniform memory access resource nodes, the resource manager 310 can also add non-uniform memory access resource nodes. The selected condition is that the newly added non-uniform memory access resource node is closest to the selected node set, that is, the newly added non-uniform memory access resource node is closest to the sum of the distances between all NUMA nodes (including the starting non-uniform memory access resource node and the plurality of other non-uniform memory access resource nodes) in the selected node set, until the selected node set meets the target memory resource requirement. The resource manager 310 can determine the current selected node set that has met the target memory resource requirement as the target selected node set.
[0159] The 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.
[0160] The resource manager 310 can traverse all starting non-uniform memory access resource nodes of the non-uniform memory access resource, thereby forming all target selected node sets. Each target selected node set can meet the target memory resource requirement.
[0161] According to an example embodiment, the resource manager 310 determines the target selected node set that meets the target memory resource requirement and a first preset condition from all target selected node sets as the target non-uniform memory access resource node set.
[0162] The first preset condition can be that the target selected node set is closest, that is, the sum of the distances between all NUMA nodes (including the starting non-uniform memory access resource node and the plurality of other non-uniform memory access resource nodes) in the target selected node set is the shortest.
[0163] The target non-uniform memory access resource node set can be a memory resource set that meets the target memory resource requirement and the first preset condition.
[0164] The resource manager 310 can calculate distances of all target selected node sets, select a target selected node set with the shortest distance among all target selected node sets, and assign the target selected node set to the target non-uniform memory access resource node set.
[0165] According to an example embodiment, the resource manager 310 assigns the target non-uniform memory access resource node set to an executor that has the target memory resource requirement.
[0166] The resource manager 310 can assign the target non-uniform memory access resource node set to an executor that is waiting for execution of a distributed computing task. After the executor receives the target non-uniform memory access resource node set, the executor can bind to the corresponding NUMA node (including the starting non-uniform memory access resource node and the plurality of other non-uniform memory access resource nodes) in the target non-uniform memory access resource node set.
[0167] Through the above embodiments, the present application can determine a first target selected node set through a first starting non-uniform memory access resource node of a received non-uniform memory access resource. The present application can determine all target selected node sets through traversal of all starting non-uniform memory access resource nodes of the non-uniform memory access resource. The present application can determine a target non-uniform memory access resource node set that meets the target memory resource requirement and the first preset condition among all target selected node sets. The present application can assign the target non-uniform memory access resource node set to an executor that has the target memory resource requirement.
[0168] The present application can assign a target non-uniform memory access resource node set with the shortest distance among target selected node sets to an executor in a case where a single NUMA node is insufficient to meet the target memory resource requirement, so that the executor performs binding, thereby making the allocation of the non-uniform memory access resource as much as possible on the same NUMA node as the resource of the executor (i.e., local non-uniform memory access resource).
[0169] In addition, the present application assigns a target non-uniform memory access resource node set with the shortest distance among target selected node sets to an executor, which can reduce the latency of the executor on different NUMA nodes, improve the efficiency of computing, and thereby make the optimization of memory access of the non-uniform memory access resource of the executor achieve better performance.
[0170] Optionally, the resource manager 310 sets the first starting non-uniform memory access resource node in the first selected node set.
[0171] The first selected node set can be a memory resource set including the first starting NUMA resource node. The resource manager 310 can place the first starting NUMA resource node in the first selected node set.
[0172] According to an example embodiment, the resource manager 310 determines whether the first starting NUMA resource node meets the target memory resource requirement.
[0173] The resource manager 310 can determine whether the memory resource information of the first starting NUMA resource node in the first selected node set meets the target memory resource requirement.
[0174] If yes, the resource manager 310 determines the first selected node set as the first target selected node set. That is, in the case that the resource manager 310 determines that the memory resource information of the first starting NUMA resource node in the first selected node set meets the target memory resource requirement, the resource manager 310 determines the first selected node set as the first target selected node set.
[0175] If no, the resource manager 310 adds a NUMA resource node meeting a second preset condition to the first selected node set until the NUMA resource nodes in the first selected node set meet the target memory resource requirement, so as to determine the first selected node set meeting the second preset condition as the first target selected node set.
[0176] The second preset condition can be that the distance between the added NUMA resource node and the first starting NUMA 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 NUMA resource node and the added NUMA resource node) in the first selected node set meets the target memory resource requirement.
[0177] In the case that the resource manager 310 determines that the memory resource information of the NUMA nodes (including the first starting NUMA resource node and the added NUMA resource node) in the first selected node set meets the target memory resource requirement, the resource manager 310 determines the current first selected node set as the first target selected node set.
[0178] In the case that the resource manager 310 determines that the memory resource information of the NUMA nodes (including the first starting NUMA resource node and the added NUMA resource node) in the first selected node set does not meet the target memory resource requirement, the resource manager 310 can continue to add NUMA resource nodes to the current first selected node set.
[0179] The second preset condition can also be that the newly added NUMA resource node is closest to the first selected node set, i.e., the sum of distances between the newly added NUMA resource node and all NUMA nodes in the first selected node set (including the first starting NUMA resource node and the plurality of other NUMA resource nodes) is closest.
[0180] The resource manager 310 can add the NUMA resource node meeting 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.
[0181] Through the above embodiment, the application can set the first starting NUMA resource node in the first selected node set. The application can determine whether the first starting NUMA resource node meets the target memory resource requirement.
[0182] The application can add the NUMA resource node meeting the second preset condition to the first selected node set until the NUMA resource node in the first selected node set meets the target memory resource requirement, so as to determine the first selected node set meeting the target memory resource requirement as the first target selected node set.
[0183] The application can add the NUMA resource node meeting the second preset condition to the first selected node set, so that the first target selected node set can meet the target memory resource requirement and the current first selected node set (i.e., the distance of the first target selected node set) is closest.
[0184] Optionally, the resource manager 310 determines all node numbers of the NUMA resource nodes in the first target selected node set to determine the maximum value of all node numbers.
[0185] Each NUMA resource node in the first target selected node set corresponds to a node number. The resource manager 310 can determine the node number of each NUMA resource node in the first target selected node set, thereby determining all node numbers to determine the maximum value of all node numbers.
[0186] According to an example embodiment, the resource manager 310 can also determine the node number of the NUMA resource node last allocated to the executor and determine the maximum value of the node number of the NUMA resource node last allocated to the executor.
[0187] According to an example embodiment, the resource manager 310 starts traversing from the next starting non-coherent memory access resource node corresponding to the non-coherent memory access resource node with the maximum value of all node numbers to determine the target selected node set.
[0188] The resource manager 310 can start traversing all starting non-coherent memory access resource nodes of the non-coherent memory access resource from the next starting non-coherent memory access resource node corresponding to the non-coherent memory access resource node with the maximum value of node numbers, so as to determine the target selected node set.
[0189] According to an example embodiment, the resource manager 310 can also start traversing all starting non-coherent memory access resource nodes of the non-coherent memory access resource from the next starting non-coherent memory access resource node corresponding to the non-coherent memory access resource node with the maximum value of node numbers of the non-coherent memory access resource node last allocated to the executor, so as to determine the target selected node set.
[0190] The process of determining the target selected node set by the resource manager 310 has been described above, and thus will not be described here again.
[0191] Through the above embodiments, the application can determine the maximum value of all node numbers by determining all node numbers of the non-coherent memory access resource node in the first target selected node set. The application can determine the target selected node set by starting traversing from the next starting non-coherent memory access resource node corresponding to the non-coherent memory access resource node with the maximum value of all node numbers.
[0192] The application can start traversing from the next starting non-coherent memory access resource node corresponding to the non-coherent memory access resource node with the maximum value of node numbers in the case of traversing starting non-coherent memory access resource nodes, instead of traversing in the order from 1 to N. In this way, the resource allocation method provided by the application can uniformly allocate non-coherent memory access resource nodes, so that the executor 410 is uniformly allocated to different non-coherent memory access resource nodes, which is conducive to the balanced distribution of resource utilization.
[0193] Through the above embodiments, the time complexity of the resource allocation method of the resource manager 310 of the application is O (N^3), and the time of memory resource allocation is only tens of milliseconds, which can greatly reduce the allocation time of memory resources.
[0194] According to an aspect of the application, the application provides a non-coherent memory access memory access device 400. Referring to Figure 7The memory access apparatus 400 comprises an executor 410 and a resource manager 310.
[0195] According to an example embodiment, the executor 410 determines the non-uniform memory access resource information and target memory resource requirement of the distributed computing task to be executed.
[0196] The distributed computing task can be a computing task that is completed by a cluster of multiple computers, i.e., belongs to the category of distributed computing tasks. For example, a big data analysis system comprises a cluster of multiple computers, and multiple executors 410 are started on each cluster to cooperatively complete a big data processing task, i.e., belongs to the category of distributed computing tasks. Common open source distributed cluster systems include Apache Hadoop cluster, and common open source big data analysis systems include Apache Spark. For another example, even if only a single computer is used, if multiple independent executors 410 are divided on the single computer to cooperatively operate, it still belongs to the category of distributed computing tasks, for example, the local mode of the big data analysis system Apache Spark.
[0197] The executor 410 can be an object that has relatively independent computing resources and can cooperatively complete a computing task when scheduled. For example, the actual form of the executor 410 can be a process, a thread, or a container, etc.
[0198] The executor 410 can scan the local non-uniform memory access resources to obtain the local non-uniform memory access resources. The non-uniform memory access resources can include the number of NUMA nodes (e.g., N), the number of CPUs and the memory size of each NUMA node, and the distance between the NUMA nodes, etc.
[0199] For example, in the Linux operating system, the libnuma open source library can be used, which provides corresponding API interfaces, and the executor 410 performs NUMA resource related operations 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 the NUMA nodes through the numa_distance interface.
[0200] The libnuma open source library is only one way to operate the NUMA resources. Other API interfaces or system call interfaces can also be used to operate the NUMA resources, and still fall within the protection scope of the present application.
[0201] The target memory resource requirement can be a NUMA resource requirement of the executor 410 for executing a distributed computing task. For example, the target memory resource requirement can include required CPUs and NUMA resources.
[0202] According to an example embodiment, the resource manager 310 receives the non-uniform memory access resource information and the target memory resource requirement. The resource manager 310 determines the target non-uniform memory access resource node set according to the non-uniform memory access resource information and the target memory resource requirement, by executing the resource allocation method 1000 as described above.
[0203] 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 within an application, or a separate hardware or chip.
[0204] The process of the resource manager 310 determining the target non-uniform memory access resource node set is the same as the process of the resource allocation apparatus 300 determining the target non-uniform memory access resource node set as described above, and thus will not be described again here.
[0205] According to an example embodiment, the resource manager 310 sends node information of the target non-uniform memory access resource node set to the executor 410.
[0206] The node information of the target non-uniform memory access resource node set can be information of all NUMA nodes in the target non-uniform memory access resource node set. The node information can include the number of nodes, the number of CPUs and the memory size of each NUMA node, and the distance between the NUMA nodes, and the like.
[0207] The medium through which the resource manager 310 provides the NUMA resource allocation service to the executor 410 can be any communication protocol or framework, including but not limited to TCP protocol, UDP protocol, C / S (client / server) architecture, RPC (remote procedure call) framework, WebSocket framework, and HTTP framework, and the like.
[0208] According to an example embodiment, the executor 410 binds to the target non-uniform memory access resource node set according to the node information. The executor 410 executes a distributed computing task through the target non-uniform memory access resource node set.
[0209] For example, the executor 410 can bind the application to the CPU 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 resource of the target non-uniform memory access resource node set through the numa_set_membind interface.
[0210] Through the above embodiments, the application can receive the non-uniform memory access resource and the target memory resource requirement from the executor, and determine the target non-uniform memory access resource node set by accessing the resource and the target memory resource requirement and performing the resource allocation method as described above. The application can send the node information of the target non-uniform memory access resource node set to the executor to make the executor bind to the target non-uniform memory access resource node set, so as to make the executor execute the distributed computing task through the target non-uniform memory access resource node set.
[0211] In the case where a single NUMA node is insufficient to meet the target memory resource requirement, the application can allocate the target non-uniform memory access resource node set closest to the target selected node set to the executor to make the executor bind, so as to make the allocation of the non-uniform memory access resource as much as possible on the same NUMA node as the executor resource (i.e. local non-uniform memory access resource).
[0212] In addition, the application can allocate the target non-uniform memory access resource node set closest to the target selected node set to the executor to reduce the delay of the executor in different NUMA nodes and improve the efficiency of the computation, so as to make the memory access optimization of the non-uniform memory access resource of the executor achieve better performance.
[0213] Optionally, the resource manager 310 determines the available non-uniform memory access resource information according to the non-uniform memory access resource information and the node information, to execute the resource allocation method 1000 as described above next time according to the available non-uniform memory access resource information.
[0214] The available non-uniform memory access resource information can be the available non-uniform memory access resource information of the local executor 410.
[0215] 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.
[0216] In the case where the executor 410 of the corresponding machine has other executors 410 continue to apply for NUMA resources, the resource manager 310 will allocate according to the available non-uniform memory access resource information.
[0217] Through the above embodiment, the application can determine available non-uniform memory access resource information through non-uniform memory access resource information and node information, and allocate according to the available non-uniform memory access resource information, so as to balance the allocation of non-uniform memory access resource information.
[0218] Optionally, the resource manager 310 determines the target non-uniform memory access resource node set according to the access resource, the target memory resource requirement, and the brute force enumeration method.
[0219] According to an example embodiment, the brute force enumeration method can enumerate each NUMA node set that meets the resource requirement, and then select a NUMA node set closest to each other from the NUMA node set. Through the brute force enumeration method, the resource manager 310 can also select a plurality of NUMA nodes closest to each other to determine the target non-uniform memory access resource node set.
[0220] 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 with the increase of N. In the case of N increasing to 32, the time complexity is high, and the memory resource allocation time is about a few seconds.
[0221] According to another aspect of the application, the application also provides a non-volatile computer readable storage medium having a computer program stored thereon, which can implement the non-uniform memory access resource allocation method as described above when executed by a processor.
[0222] According to another aspect of the application, the application also provides an electronic device, comprising: one or more processors; a storage device for storing one or more programs, which, when executed by the one or more processors, enable the one or more processors to implement the non-uniform memory access resource allocation method as described above.
[0223] According to another aspect of the application, the application also provides a computer program product, comprising: a computer program stored on a computer readable storage medium; the computer program comprising program instructions, which, when executed by a computer, cause the computer to execute the non-uniform memory access resource allocation method as described above.
[0224] According to another aspect of the application, the application also provides a non-volatile computer readable storage medium having a computer program stored thereon, which can implement the non-uniform memory access memory access method as described above when executed by a processor.
[0225] According to another aspect of the present application, the present application also provides an electronic device, comprising: one or more processors; a storage device for storing one or more programs, which, when executed by the one or more processors, enable the one or more processors to implement the non-uniform memory access memory access method as described above.
[0226] According to another aspect of the present application, the present application also provides a computer program product, comprising: a computer program stored on a computer readable storage medium; the computer program comprising program instructions which, when executed by a computer, cause the computer to perform the non-uniform memory access memory access method as described above.
[0227] Finally, it should be noted that the above only describes the preferred embodiments of the present application and is not intended to limit the present application. Although the present application is 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 make equivalent replacements to some technical features. Any modification, equivalent replacement, improvement, etc. made within the spirit and principles of the present application shall be included in the protection scope of the present application.
Claims
1. A resource allocation method for non-consistent memory access, characterized in that, include: Based on the first initial non-consistent memory access resource node received from the non-consistent memory access resource, determine the first target selected node set, including: Set the first initial non-consistent memory access resource node in the first selected node set; Determine whether the first initial non-consistent memory access resource node meets the target memory resource requirements; If so, determine that the first selected node set is the first target selected node set; If not, add non-consistent memory access resource nodes that meet the second preset condition to the first selected node set until the non-consistent memory access resource nodes in the first selected node set meet the target memory resource requirements, so as to determine the first selected node set that meets the second preset condition as the first target selected node set, wherein the second preset condition is that the newly added non-consistent memory access resource node is closest to the first selected node set; Traverse all the starting non-consistent memory access resource nodes of the non-consistent memory access resource to determine the complete set of target selected nodes; The set of target selected nodes that meets the target memory resource requirements and the first preset condition among all the target selected node sets is determined as the target non-consistent memory access resource node set, wherein the first preset condition is that the target selected node set is the closest. The target set of non-consistent memory access resource nodes is assigned to the executor that has the target memory resource requirement.
2. The resource allocation method according to claim 1, characterized in that, The step of traversing all the initial non-consistent memory access resource nodes to determine the complete set of target selected nodes includes: Determine all node numbers of the non-consistent memory access resource nodes in the first target selected node set, and determine the maximum value of all node numbers; The traversal begins from the next starting non-consistent memory access resource node corresponding to the maximum value of all the non-consistent memory access resource nodes, to determine the complete set of target selected nodes.
3. A memory access method for non-uniform memory access, characterized in that, include: The system receives inconsistent memory access resources from the executor, as well as the target memory resource requirements of the distributed computing task to be executed by the executor, wherein the inconsistent memory access resources and the target memory resource requirements are determined by the executor. Based on the access resources and the target memory resource requirements, execute the resource allocation method as described in any one of claims 1-2 to determine the target non-consistent memory access resource node set; The executor sends node information of the target non-consistent memory access resource node set to the executor, so that the executor binds to the target non-consistent memory access resource node set, and the executor executes the distributed computing task through the target non-consistent memory access resource node set.
4. The memory access method according to claim 3, characterized in that, After sending the node information to the executor, the memory access method further includes: Based on the inconsistent memory access resource information and the node information, available inconsistent memory access resource information is determined, so as to execute the resource allocation method as described in any one of claims 1-3 next time based on the available inconsistent memory access resource information.
5. A resource allocation device for non-consistent memory access, characterized in that, The resource allocation device includes: The resource manager, based on the first initial non-consistent memory access resource node received, determines the first target selected node set, including: The resource manager sets the first initial non-consistent memory access resource node in the first selected node set; The resource manager determines whether the first initial non-consistent memory access resource node meets the target memory resource requirements. If so, the resource manager determines that the first selected node set is the first target selected node set; If not, the resource manager adds non-consistent memory access resource nodes that meet the second preset condition to the first selected node set until the non-consistent memory access resource nodes in the first selected node set meet the target memory resource requirements, so as to determine the first selected node set that meets the second preset condition as the first target selected node set, wherein the second preset condition is that the newly added non-consistent memory access resource node is closest to the first selected node set; The resource manager traverses all the initial non-consistent memory access resource nodes of the non-consistent memory access resource to determine the complete set of target selected nodes; The resource manager determines the set of target selected nodes that meets the target memory resource requirements and the first preset condition among all the target selected node sets as the target non-consistent memory access resource node set, wherein the first preset condition is that the target selected node set is the closest. The resource manager allocates the target set of non-consistent memory access resource nodes to the executor that has the target memory resource requirement.
6. The resource allocation device according to claim 5, characterized in that, The resource manager determines all the node numbers of the non-consistent memory access resource nodes in the first target selected node set, and determines the maximum value of all the node numbers; The resource manager traverses from the next starting non-consistent memory access resource node corresponding to the maximum value of all the non-consistent memory access resource nodes to determine the complete set of target selected nodes.
7. A memory access device for non-uniform memory access, characterized in that, The memory access device includes: The executor determines the inconsistent memory access resource information and the target memory resource requirements of the distributed computing task to be executed; The resource manager receives the inconsistent memory access resource information and the target memory resource requirement; The resource manager determines the target set of non-consistent memory access resource nodes by executing the resource allocation method as described in any one of claims 1-2 based on the non-consistent memory access resource information and the target memory resource requirements. The resource manager sends the node information of the target non-consistent memory access resource node set to the executor; The executor is bound to the target set of non-consistent memory access resource nodes according to the node information; The executor executes the distributed computing task through the target set of non-consistent memory access resource nodes.
8. The memory access device according to claim 7, characterized in that, The resource manager determines available non-consistent memory access resource information based on the non-consistent memory access resource information and the node information, so as to execute the resource allocation method as described in any one of claims 1-2 next time based on the available non-consistent memory access resource information.
Citation Information
Patent Citations
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