Method and device for improving intelligent computing performance
By connecting the computing nodes to shared memory in an intelligent computing system and using the so file sharing library to establish a queue, data interaction is directly carried out in shared memory, the problem of RDMA transmission delay and throughput is solved, and data interaction efficiency is improved. Computational performance.
Patent Information
- Application Number
- CN202411025646.5
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-07-30
- Publication Date
- 2024-11-15
AI Technical Summary
The data interaction method between nodes in existing intelligent computing systems depends on RDMA, resulting in limited data transmission delay and throughput, affecting the rationality of decomposition of computing tasks and overall performance.
By connecting multiple compute nodes to the same shared memory and using the so file sharing library to establish Completion Queue and double-ring lock-free queues between the sending and receiving nodes, write and read data directly in shared memory, avoiding additional information network transmission.
It greatly improves data interaction efficiency, optimizes the decomposition logic of computing tasks, reduces task pauses due to data transmission, significantly improves intelligent computing performance, and is transparent to user applications without additional modifications.
Smart Images

Figure CN118964062A_ABST
Abstract
Description
Technical Field
[0001] The present invention belongs to the field of intelligent computing technology, and in particular, relates to a method and device for improving intelligent computing performance. Background Art
[0002] With the advent of the big data era, intelligent computing has been increasingly widely used in the fields of intelligent manufacturing, financial technology, and medical health. With the increasing complexity of application scenarios, the amount of computing of each operator has also increased exponentially. How to quickly exchange data between operators is a key bottleneck that restricts its rapid development. At present, the traditional data exchange method between intelligent computing nodes generally uses RDMA. Although this can bypass the CPU when transmitting data, RDMA data transmission requires a delay of 2us even for the simplest echo ping-pong test, and the throughput is also very limited by the network bandwidth when transmitting large data. Therefore, when decomposing computing tasks, the problem of data interaction must be fully considered, which greatly affects the rationality of task decomposition of intelligent computing and prevents intelligent computing from achieving optimal performance. Summary of the invention
[0003] In view of the above-mentioned deficiencies in the prior art, the purpose of the invention is to provide a method, device, electronic device and storage medium for improving the performance of intelligent computing, connecting each computing node to the same shared memory through an interconnection bus, and when multiple computing nodes exchange data, the data can be directly written into the shared memory, and the nodes that need to use the data can read it directly from the shared memory. Data exchange between multiple computing nodes no longer requires additional transmission over the network, which greatly improves the efficiency of data interaction.
[0004] In a first aspect of the present invention, a method for improving intelligent computing performance is proposed, which is applied to a system comprising: a plurality of computing nodes connected to a shared memory via an interconnection bus, each of the plurality of computing nodes starting a daemon process module, the method comprising:
[0005] Write a so file shared library;
[0006] The sending nodes in multiple computing nodes write data into the shared memory through the so file shared library;
[0007] The receiving nodes in multiple computing nodes read the data in the shared memory through the so file shared library;
[0008] Among them, the daemon module is used to establish a Completion Queue and a dual-ring lock-free queue for the sending node and the receiving node when writing data into the shared memory and reading data in the shared memory. The functions that need to be intercepted by the program of the receiving node in the so file shared library include: ibv_create_cq, ibv_create_qp, rdma_bind_addr, rdma_listen, rdma_get_cm_event and ibv_post_recv; the functions that need to be intercepted by the program of the sending node in the so file shared library include: ibv_create_cq, ibv_create_qp, rdma_connect, rdma_get_cm_event and ibv_post_send.
[0009] Furthermore, in the above method for improving intelligent computing performance, the function ibv_create_cq that needs to be intercepted by the program receiving the node in the so file shared library is used to:
[0010] The receiving node among the multiple computing nodes is connected to the daemon process module, and the RDMA communication identification number, IP address and port number assigned to the receiving node are transmitted;
[0011] The daemon module applies for a Completion Queue in the shared memory and returns the head address of the receiving node CompletionQueue;
[0012] The header address, the assigned RDMA communication identification number, the IP address and the port number are recorded in the first area of the shared memory.
[0013] Furthermore, in the above method for improving intelligent computing performance, the function rdma_bind_addr that needs to be intercepted by the program of the receiving node in the so file shared library is used for:
[0014] The connection daemon module transfers the assigned RDMA communication identification number;
[0015] The daemon module applies for a dual-ring lock-free queue in the shared memory and returns the head address of the dual-ring lock-free queue;
[0016] The allocated RDMA communication identification number and the head address of the dual-ring lock-free queue are recorded in the first area of the shared memory.
[0017] Furthermore, in the above method for improving intelligent computing performance, the function ibv_post_recv that needs to be intercepted by the program of the receiving node in the so file shared library is used to:
[0018] Get the ID number of the latest completed transmission data in the dual-ring lock-free queue from the Completion Queue;
[0019] Read the data storage address from the dual-ring lock-free queue corresponding to the assigned RDMA communication identification number;
[0020] Get data from the address where the data is stored;
[0021] The functions ibv_create_qp, rdma_listen, and rdma_get_cm_event intercepted by the receiving node return directly.
[0022] Furthermore, in the above method for improving intelligent computing performance, the function ibv_create_cq that needs to be intercepted by the program sending the node in the so file shared library is used to:
[0023] Connect to the daemon module;
[0024] The RDMA communication identification number assigned by the receiving node and the head address of the Completion Queue are obtained through the IP address and port number of the receiving node. The sending node and the receiving node share the same Completion Queue.
[0025] Furthermore, in the above method for improving intelligent computing performance, the function rdma_connect that needs to be intercepted by the program receiving the node in the so file shared library is used to:
[0026] Connect to the daemon module;
[0027] Send the RDMA communication identification number, IP address and port number assigned by the sending node to the daemon module;
[0028] The daemon module applies for a dual-ring lock-free queue of a receiving node, returns it to the receiving node, and records the allocated RDMA communication identification number, IP address and port number and the head address of the dual-ring lock-free queue into the first area of the shared memory.
[0029] Furthermore, in the above method for improving intelligent computing performance, the function ibv_post_send that needs to be intercepted by the program sending the node in the so file shared library is used to:
[0030] Connect to the daemon module and pass the RDMA communication identification number assigned by the receiving node obtained from ibv_create_cq;
[0031] The daemon module queries the head address of the corresponding dual-ring lock-free queue from the first area of the shared memory;
[0032] Apply for a memory block from the shared memory of the dual-ring lock-free queue, and write the data to be sent into the memory block;
[0033] Write the memory block address into the dual-loop lock-free queue, and write the id corresponding to the dual-loop lock-free queue into the Completion Queue;
[0034] The function ibv_create_qp that the sending node needs to intercept returns directly.
[0035] In a second aspect of the present invention, a device for improving intelligent computing performance is also proposed, which is applied to a system including: a plurality of computing nodes are connected to a shared memory via an interconnection bus, each of the plurality of computing nodes starts a daemon process module, and the device includes:
[0036] Writing module: used to write so file shared library;
[0037] Writing module: used for a sending node in multiple computing nodes to write data into a shared memory through the so file shared library;
[0038] Reading module: used for a receiving node among multiple computing nodes to read data in a shared memory through the so file shared library;
[0039] Among them, the daemon module is used to establish a Completion Queue and a dual-loop lock-free queue for the sending node and the receiving node when writing data into the shared memory and reading data in the shared memory. The functions that need to be intercepted by the program of the receiving node in the so file shared library include: ibv_create_cq, ibv_create_qp, rdma_bind_addr, rdma_listen, rdma_get_cm_event and ibv_post_recv; the functions that need to be intercepted by the program of the sending node in the so file shared library include: ibv_create_cq, ibv_create_qp, rdma_connect, rdma_get_cm_event and ibv_post_send.
[0040] According to a third aspect of the present invention, an electronic device is provided, comprising: a processor and a memory;
[0041] The processor is used to execute a method for improving intelligent computing performance as described in any of the above items by calling the program or instruction stored in the memory.
[0042] In a fourth aspect of the present invention, a computer-readable storage medium is further proposed, wherein the computer-readable storage medium stores a program or instruction, wherein the program or instruction enables a computer to execute a method for improving intelligent computing performance as described in any one of the above items.
[0043] The beneficial effects of the present invention are as follows: the present invention connects the computing nodes in the same computer room to the same shared memory through an interconnection bus. When the nodes exchange data, the data can be directly written into the shared memory. When other nodes need to use the data, they can directly read from the shared memory. In this way, data exchange between the computing nodes no longer requires additional transmission through the network, which greatly improves the efficiency of data interaction; in addition, when the distributed computing tasks are pre-decomposed, the task decomposition of each stage can make the logic more reasonable, reduce the forced suspension of some subtasks due to data transmission, and further improve the performance of intelligent computing; by additionally loading the so file shared library when starting the task, it is transparent to the user application, does not require additional modification, is convenient and fast, and does not cause additional burden work. BRIEF DESCRIPTION OF THE DRAWINGS
[0044] The accompanying drawings are only used to illustrate specific embodiments and are not considered to limit the present invention. In the entire drawings, the same reference symbols represent the same components. Obviously, the drawings described below are only some embodiments recorded in the embodiments of the present invention. For those of ordinary skill in the art, other drawings can also be obtained based on these drawings.
[0045] Figure 1 A method diagram for improving intelligent computing performance provided by an embodiment of the present invention;
[0046] Figure 2 An architecture diagram for improving intelligent computing performance provided by an embodiment of the present invention;
[0047] Figure 3 A diagram of a device for improving intelligent computing performance provided by an embodiment of the present invention;
[0048] Figure 4 A schematic block diagram of an electronic device provided by an embodiment of the present invention. DETAILED DESCRIPTION
[0049] In order to enable those skilled in the art to better understand the technical solutions in the embodiments of the present invention, the technical solutions of the present invention will be clearly and completely described below in conjunction with the accompanying drawings. Obviously, the described embodiments are part of the embodiments of the present invention, rather than all of the embodiments. It should be understood that these descriptions are only exemplary and are not intended to limit the scope of the present invention. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in the field without making creative work should fall within the scope of protection of the present invention.
[0050] Furthermore, in the following description, descriptions of well-known structures and technologies are omitted to avoid unnecessarily obscuring the concepts disclosed in the present invention.
[0051] In the description of the present invention, the terms "first", "second", and "third" are used for descriptive purposes only and should not be understood as indicating or implying relative importance. The terms "installed", "connected", and "connected" should be understood in a broad sense, for example, it can be a fixed connection, a detachable connection, or an integral connection; it can be a mechanical connection or an electrical connection; it can be a direct connection, or it can be indirectly connected through an intermediate medium, or it can be internal communication between two components. For ordinary technicians in this field, the specific meanings of the above terms in the present invention can be understood according to specific circumstances.
[0052] Exemplary embodiments will be described in detail herein, examples of which are shown in the accompanying drawings. When the following description refers to the drawings, unless otherwise indicated, the same numbers in different drawings represent the same or similar elements. The embodiments described in the following exemplary embodiments do not represent all embodiments consistent with the present invention. Instead, they are merely examples of methods and systems consistent with some aspects of the present invention as detailed in the appended claims.
[0053] Before introducing the embodiments of the present invention, professional terms involved in the present invention are first introduced.
[0054] CXL (Compute Express Link) was proposed by Intel and is an industry-supported cache coherent interconnect technology standard protocol that is an open industrial standard between processors and devices such as accelerators, memory buffers, intelligent network interfaces, persistent memory, and solid-state drives.
[0055] NVLink is a high-bandwidth interconnect technology developed by NVIDIA to connect GPUs and CPUs and between multiple GPUs to achieve high-speed data transmission and efficient computing resource sharing.
[0056] UB (Unified Bus) is an interconnect bus protocol proposed by Huawei. It is an interconnect bus technology similar to CXL, designed to provide high-performance, low-power connections for connecting various processors, accelerators and storage devices.
[0057] Gen-Z is an emerging high-performance interconnect technology designed to provide high-bandwidth, low-latency and highly scalable connections to meet modern computing and storage needs.
[0058] A shared library usually ends with .so (SharedObject) in UNIX and UNIX-like systems (such as Linux). It is a library that can be shared among multiple programs. Shared libraries allow programs to be dynamically loaded and linked at runtime, thereby reducing memory usage and disk space usage, and facilitating software updates and maintenance.
[0059] LD_PRELOAD is an environment variable that allows the user to specify a shared library when running a program, which will be loaded before the standard library. This is very useful for injecting custom code or replacing existing library functions while the program is running.
[0060] MPI (Message Passing Interface): MPI is a standard for writing parallel and distributed computing programs. It provides a set of communication and synchronization primitives that allow multiple processes to communicate and collaborate on different computing nodes.
[0061] The present invention proposes a method, device, electronic device and storage medium for improving intelligent computing performance, wherein each computing node is connected to the same shared memory through an interconnection bus. When multiple computing nodes exchange data, the data can be directly written into the shared memory, and nodes that need to use the data can directly read from the shared memory. Data exchange between multiple computing nodes no longer requires additional transmission over the network, thereby greatly improving the efficiency of data exchange.
[0062] Method Embodiment
[0063] Figure 1 A diagram of a method for improving intelligent computing performance provided by an embodiment of the present invention.
[0064] In a first aspect of the present invention, a method for improving intelligent computing performance is proposed, which is applied to a system comprising: a plurality of computing nodes are connected to a shared memory via an interconnect bus, each of the plurality of computing nodes starts a daemon process module, and combines Figure 1 , the method includes three steps from S1 to S3:
[0065] S1: Write a so file shared library.
[0066] Specifically, in an embodiment of the present invention, the so file shared library may be libnav.so, which is loaded through the LD_PRLOAD command. In this way, when the application calls the relevant function in the RDMA api, the function with the same name in the so file is executed, so that the data is directly read and written to the shared memory instead of being transmitted through the network. The present invention is transparent to the user application by additionally loading the so file when starting the task, and does not require additional modification. It is convenient and fast, and does not cause additional burden work.
[0067] S2: The sending node among multiple computing nodes writes the data into the shared memory through the so file shared library.
[0068] Specifically, in the embodiment of the present invention, when multiple computing nodes exchange data, the sending node can directly write the data into the shared memory through the so file shared library.
[0069] S3: The receiving nodes in multiple computing nodes read the data in the shared memory through the so file shared library.
[0070] Specifically, in the embodiment of the present invention, the receiving node among the multiple computing nodes is a node that needs to use data and can directly read the data from the shared memory.
[0071] It should be understood that through the above three steps S1 to S3, data interaction between multiple computing nodes no longer requires additional transmission through the network, which greatly improves the efficiency of data interaction. In addition, when pre-decomposing distributed computing tasks, the decomposition of tasks in each stage can make the logic more reasonable, reduce the forced suspension of certain subtasks due to data transmission, and further improve the performance of intelligent computing.
[0072] Among them, the daemon module is used to establish a Completion Queue and a dual-ring lock-free queue for the sending node and the receiving node when writing data into the shared memory and reading data in the shared memory. The functions that need to be intercepted by the program of the receiving node in the so file shared library include: ibv_create_cq, ibv_create_qp, rdma_bind_addr, rdma_listen, rdma_get_cm_event and ibv_post_recv; the functions that need to be intercepted by the program of the sending node in the so file shared library include: ibv_create_cq, ibv_create_qp, rdma_connect, rdma_get_cm_event and ibv_post_send.
[0073] Specifically, in an embodiment of the present invention, when the sending node and the receiving node apply for a queue to the daemon module, the daemon module is also responsible for recording the information of the sending node and the receiving node in the shared memory. In this way, when sending data, it is possible to query the daemon module to obtain whether the receiving node is connected to the shared memory to determine whether to switch to traditional network communication.
[0074] The following describes the functions that need to be intercepted by the program sending the node in the so file shared library, the functions that need to be intercepted by the program receiving the node in the so file shared library, and the detailed steps for establishing the Completion Queue and the dual-ring lock-free queue for the sending node and the receiving node when writing data to the shared memory and reading data from the shared memory.
[0075] Figure 2 An architecture diagram for improving intelligent computing performance provided by an embodiment of the present invention.
[0076] The sending node host1 and the receiving node host2 are connected to the shared memory through an interconnection bus. The sending node host1 and the receiving node host2 both start a daemon module monitor. The interconnection bus is not limited to the CXL protocol proposed by Intel, the NVLink proposed by NVIDIA, the UB proposed by Huawei, Gen-Z, etc.
[0077] Furthermore, in the above method for improving intelligent computing performance, the function ibv_create_cq that needs to be intercepted by the program receiving the node in the so file shared library is used to:
[0078] The receiving node among the multiple computing nodes is connected to the daemon process module, and the RDMA communication identification number (RDMAid), IP address (ipAddr) and port number (port) allocated by the receiving node are transmitted;
[0079] The daemon module applies for a Completion Queue (cq) in the shared memory and returns the header address of the receiving node Completion Queue (addr-cq1);
[0080] The header address (addr-cq1), the assigned RDMA communication identification number (RDMAid), the IP address (ipAddr) and the port number (port) are recorded in the first area of the shared memory.
[0081] Specifically, ibv_create_cq is originally used to create a Completion Queue (cq). When data is sent, it is added to this queue. However, in the embodiment of the present invention, Figure 2ibv_create_cq is used to connect to the daemon module monitor and pass it to the RDMA communication identification number 1 (RDMAid1), ip address (ipAddr) and port number (port) assigned by the receiving node. The daemon module monitor applies for a CompletionQueue (cq) in the shared memory and returns the head address (Addr-cq1) of the Completion Queue to the receiving node. The head address (Addr-cq1) of the Completion Queue, the assigned RDMA communication identification number 1 (RDMAid1), ip address (ipAddr) and port number (port) are recorded in the first area of the shared memory. The first area here is the metadata area of the shared memory.
[0082] Furthermore, in the above method for improving intelligent computing performance, the function rdma_bind_addr that needs to be intercepted by the program of the receiving node in the so file shared library is used for:
[0083] The connection daemon module transfers the RDMA communication identification number (RDMAid) assigned to this communication;
[0084] The daemon module applies for a dual-ring lock-free queue in the shared memory and returns the head address of the dual-ring lock-free queue;
[0085] The allocated RDMA communication identification number (RDMAid) and the head address of the dual-ring lock-free queue are recorded in the first area of the shared memory.
[0086] Specifically, in the embodiment of the present invention, combined with Figure 2 , the function rdma_bind_addr is in the so file shared library, the connection daemon module passes the assigned RDMA communication identification number 1 (RDMAid1), the daemon module applies for a dual-ring lock-free queue in the shared memory, returns the head address of the dual-ring lock-free queue (addr-Ifq1), and records the assigned RDMA communication identification number 1 (RDMAid) and (addr-Ifq1) in the first area of the shared memory. The first area here is the metadata area of the shared memory, so that the sending node can write the memory block address of the written data into the dual-ring lock-free queue.
[0087] Furthermore, in the above method for improving intelligent computing performance, the function ibv_post_recv that needs to be intercepted by the program of the receiving node in the so file shared library is used to:
[0088] Get the ID number of the latest completed transmission data in the dual-ring lock-free queue from the Completion Queue (cq);
[0089] The data storage address is read from the dual-ring lock-free queue corresponding to the assigned RDMA communication identification number (RDMAid);
[0090] Get data from the address where the data is stored;
[0091] The functions ibv_create_qp, rdma_listen, and rdma_get_cm_event intercepted by the receiving node return directly.
[0092] Specifically, in the embodiment of the present invention, combined with Figure 2 , the function ibv_post_recv in the so file shared library obtains the id number of the latest completed transmission data in the dual-ring lock-free queue from the Completion Queue (cq); reads the data storage address from the dual-ring lock-free queue corresponding to the assigned RDMA communication identification number 1 (RDMAid1); obtains the real data from the data storage address; the three functions ibv_create_qp, rdma_listen, and rdma_get_cm_event can return directly without any further operation.
[0093] Furthermore, in the above method for improving intelligent computing performance, the function ibv_create_cq that needs to be intercepted by the program sending the node in the so file shared library is used to:
[0094] Connect to the daemon module;
[0095] The RDMA communication identification number (RDMAid) and the header address of the Completion Queue (addr-cq1) assigned by the receiving node are obtained through the IP address (ipAddr) and port number (port) of the receiving node. The sending node and the receiving node share the same Completion Queue (cq).
[0096] Specifically, in the embodiment of the present invention, combined with Figure 2 The function ibv_create_cq of the sending node is different from the function ibv_create_cq of the receiving node. The sending node only needs to connect to the daemon module monitor, and obtain the RDMA communication identification number (RDMAid) and the header address of the Completion Queue (addr-cq1) allocated by the receiving node through the IP address (ipAddr) and port number (port) of the receiving node. The sending node and the receiving node share the same CompletionQueue (cq).
[0097] Furthermore, in the above method for improving intelligent computing performance, the function rdma_connect that needs to be intercepted by the program sending the node in the so file shared library is used to:
[0098] Connect to the daemon module;
[0099] Send the RDMA communication identification number (RDMAid), IP address (ipAddr) and port number (port) allocated by the sending node to the daemon module;
[0100] The daemon module applies for a dual-ring lock-free queue of a receiving node, returns it to the receiving node, and records the allocated RDMA communication identification number (RDMAid), IP address (ipAddr), port number (port) and the head address of the dual-ring lock-free queue into the first area of the shared memory.
[0101] Specifically, in the embodiment of the present invention, rdma_connect is connected to the daemon module monitor, and the RDMA communication identification number 1 (RDMAid1), ip address (ipAddr) and port number (port) allocated by the sending node are sent to the daemon module, and the daemon module applies for a dual-ring lock-free queue of a receiving node, returns it to the receiving node, and records the allocated RDMA communication identification number 1 (RDMAid1), ip address (ipAddr) and port number (port) and the head address of the dual-ring lock-free queue into the first area of the shared memory, where the first area is the metadata area of the shared memory, so that the receiving node can write the memory block address of the written data into the dual-ring lock-free queue when replying to the message.
[0102] Furthermore, in the above method for improving intelligent computing performance, the function ibv_post_send that needs to be intercepted by the program sending the node in the so file shared library is used to:
[0103] Connect to the daemon module and pass the RDMA communication identification number (RDMAid) assigned by the receiving node obtained from ibv_create_cq;
[0104] The daemon module queries the head address of the corresponding dual-ring lock-free queue from the first area of the shared memory;
[0105] Apply for a memory block from the shared memory of the dual-ring lock-free queue, and write the data to be sent into the memory block;
[0106] Write the memory block address into the dual-loop lock-free queue, and write the id corresponding to the dual-loop lock-free queue into the Completion Queue (cq);
[0107] The function ibv_create_qp that the sending node needs to intercept returns directly.
[0108] Specifically, in the embodiment of the present invention, ibv_post_send is connected to the daemon module monitor to pass the RDMA communication identification number 1 (RDMAid1) allocated by the receiving node obtained from ibv_create_cq. The daemon module monitor queries the head address of the corresponding dual-ring lock-free queue from the metadata area of the shared memory, and then applies for a memory block from the shared memory, writes the data to be sent into the memory block, writes the address of the memory block into the dual-ring lock-free queue, and writes the id corresponding to the dual-ring lock-free queue at this time into the Completion Queue (cq). In this way, the receiving node can obtain the id through the ibv_post_recv function, and then take out the address of the data block from the ring queue, and then read the data. The ibv_create_qp function can return directly without performing any operation.
[0109] Specifically, in an embodiment of the present invention, regarding how the so file shared library can achieve the same function executing different codes in the sending node host1 and the receiving node host2, the relevant code can be added to the code as shown below, and -D__SERVER can be added when using the make command to compile the sending end code.
[0110]
[0111]
[0112] The above method was tested for matrix operations in a simulated CXL environment. In the simulation environment, two virtual machines were created in a host machine according to the modified qemu that supports simulating CXL3.0. The two virtual machines have different IP addresses and can communicate with each other. A libnav.so was written according to the above method, and an application for distributed matrix computing based on the MPI architecture was written. Data was communicated between multiple nodes through RDMA. This shared library was added to the process by using mpiexec-n 2-hosts node1,node2 env LD_PRELOAD=libnav.so. / mpi_rdma_example_test at startup. By comparing whether libnav.so was added or not, it can be found that the improved method can improve the performance by about 3 times that of the original method.
[0113] Device Embodiment
[0114] Figure 3A diagram of a device for improving intelligent computing performance provided by an embodiment of the present invention.
[0115] In a second aspect of the present invention, a device for improving intelligent computing performance is also proposed, which is applied to a system including: a plurality of computing nodes are connected to a shared memory via an interconnection bus, each of the plurality of computing nodes starts a daemon process module, and the device includes:
[0116] Writing module 31: used to write so file shared library.
[0117] Specifically, in the embodiment of the present invention, the so file shared library written by the writing module 31 can be libnav.so, which is loaded through the LD_PRLOAD command. In this way, when the application calls the relevant function in the RDMA api, it will execute the function with the same name in the so, so that it changes the data transmission through the network to directly reading and writing the shared memory. The present invention is transparent to the user application by additionally loading so when starting the task, and does not require additional modification. It is convenient and fast, and does not cause additional burden work.
[0118] Writing module 32: used for a sending node among multiple computing nodes to write data into a shared memory through the so file shared library.
[0119] Specifically, in the embodiment of the present invention, when multiple computing nodes exchange data, the writing module 32 of the sending node can directly write the data into the shared memory through the so file sharing library.
[0120] Reading module 33: used for a receiving node among multiple computing nodes to read data in a shared memory through the so file shared library.
[0121] Specifically, in the embodiment of the present invention, the receiving node among the multiple computing nodes is a node that needs to use data, and the reading module 33 of the receiving node can directly read from the shared memory.
[0122] It should be understood that through the above-mentioned writing module 31, writing module 32 and reading module 33, data interaction between multiple computing nodes no longer requires additional transmission through the network, which greatly improves the efficiency of data interaction. In addition, when pre-decomposing distributed computing tasks, the decomposition of tasks in each stage can make the logic more reasonable, reduce the forced suspension of certain subtasks due to data transmission, and further improve the performance of intelligent computing.
[0123] Among them, the daemon module is used to establish a Completion Queue and a dual-ring lock-free queue for the sending node and the receiving node when writing data into the shared memory and reading data in the shared memory. The functions that need to be intercepted by the program of the receiving node in the so file shared library include: ibv_create_cq, ibv_create_qp, rdma_bind_addr, rdma_listen, rdma_get_cm_event and ibv_post_recv; the functions that need to be intercepted by the program of the sending node in the so file shared library include: ibv_create_cq, ibv_create_qp, rdma_connect, rdma_get_cm_event and ibv_post_send.
[0124] Specifically, in an embodiment of the present invention, when the sending node and the receiving node apply for a queue to the daemon module, the daemon module is also responsible for recording the information of the sending node and the receiving node in the shared memory. In this way, when sending data, it is possible to query the daemon module to obtain whether the receiving node is connected to the shared memory to determine whether to switch to traditional network communication.
[0125] According to a third aspect of the present invention, an electronic device is provided, comprising: a processor and a memory;
[0126] The processor is used to execute a method for improving intelligent computing performance as described in any of the above items by calling the program or instruction stored in the memory.
[0127] In a fourth aspect of the present invention, a computer-readable storage medium is further proposed, wherein the computer-readable storage medium stores a program or instruction, wherein the program or instruction enables a computer to execute a method for improving intelligent computing performance as described in any one of the above items.
[0128] Figure 4 It is a schematic block diagram of an electronic device provided by an embodiment of the present invention.
[0129] like Figure 4 As shown, the electronic device includes: at least one processor 401, at least one memory 402 and at least one communication interface 403. The various components in the electronic device are coupled together through a bus system 404. The communication interface 403 is used to transmit information between external devices. It can be understood that the bus system 404 is used to achieve connection and communication between these components. In addition to the data bus, the bus system 404 also includes a power bus, a control bus and a status signal bus. However, for the sake of clarity, Figure 4 Various buses are labeled as bus system 404 .
[0130] It can be understood that the memory 402 in this embodiment can be a volatile memory or a non-volatile memory, or can include both volatile and non-volatile memories.
[0131] In some implementations, the memory 402 stores the following elements, executable units or data structures, or a subset thereof, or an extended set thereof: an operating system and application programs.
[0132] The operating system includes various system programs, such as a framework layer, a core library layer, a driver layer, etc., which are used to implement various basic services and process hardware-based tasks. The application includes various application programs, such as a media player (Media Player), a browser (Browser), etc., which are used to implement various application services. A program that implements any method of the method for improving intelligent computing performance provided in an embodiment of the present invention can be included in the application.
[0133] In an embodiment of the present invention, the processor 401 calls a program or instruction stored in the memory 402, specifically, a program or instruction stored in an application, and the processor 401 is used to execute the steps of each embodiment of a method for improving intelligent computing performance provided in an embodiment of the present invention.
[0134] Write a so file shared library;
[0135] The sending nodes in multiple computing nodes write data into the shared memory through the so file shared library;
[0136] The receiving nodes in multiple computing nodes read the data in the shared memory through the so file shared library;
[0137] Among them, the daemon module is used to establish a Completion Queue and a dual-ring lock-free queue for the sending node and the receiving node when writing data into the shared memory and reading data in the shared memory. The functions that need to be intercepted by the program of the receiving node in the so file shared library include: ibv_create_cq, ibv_create_qp, rdma_bind_addr, rdma_listen, rdma_get_cm_event and ibv_post_recv; the functions that need to be intercepted by the program of the sending node in the so file shared library include: ibv_create_cq, ibv_create_qp, rdma_connect, rdma_get_cm_event and ibv_post_send.
[0138] Any method in a method for improving intelligent computing performance provided in an embodiment of the present invention can be applied to the processor 401, or implemented by the processor 401. The processor 401 can be an integrated circuit chip with signal processing capabilities. In the implementation process, each step of the above method can be completed by an integrated logic circuit of hardware in the processor 401 or an instruction in the form of software. The above-mentioned processor 401 can be a general-purpose processor, a digital signal processor (DigitalSignal Processor, DSP), an application-specific integrated circuit (Application Specific Integrated Circuit, ASIC), a field programmable gate array (Field Programmable Gate Array, FPGA) or other programmable logic devices, discrete gates or transistor logic devices, discrete hardware components. The general-purpose processor can be a microprocessor or the processor can also be any conventional processor, etc.
[0139] The steps of any method in the method for improving intelligent computing performance provided by the embodiment of the present invention can be directly embodied as being executed by a hardware decoding processor, or being executed by a combination of hardware and software units in the decoding processor. The software unit can be located in a mature storage medium in the art such as a random access memory, a flash memory, a read-only memory, a programmable read-only memory, or an electrically erasable programmable memory, a register, etc. The storage medium is located in the memory 402, and the processor 401 reads the information in the memory 402, and completes the steps of the method in combination with its hardware.
[0140] Those skilled in the art will appreciate that although some embodiments described herein include certain features included in other embodiments but not other features, the combination of features from different embodiments is meant to be within the scope of the present invention and to form different embodiments.
[0141] Those skilled in the art will appreciate that the description of each embodiment has its own emphasis, and for parts not described in detail in a certain embodiment, reference can be made to the relevant descriptions of other embodiments.
[0142] Although the embodiments of the present invention are described in conjunction with the accompanying drawings, those skilled in the art may make various modifications and variations without departing from the spirit and scope of the present invention, and such modifications and variations all fall within the scope defined by the appended claims. The above are only specific embodiments of the present invention, but the protection scope of the present invention is not limited thereto. Any person skilled in the art who is familiar with the technical field can easily think of various equivalent modifications or substitutions within the technical scope disclosed by the present invention, and these modifications or substitutions should be included in the protection scope of the present invention. Therefore, the protection scope of the present invention shall be subject to the protection scope of the claims.
[0143] The above are only specific embodiments of the present invention, but the protection scope of the present invention is not limited thereto. Any technician familiar with the technical field can easily think of various equivalent modifications or replacements within the technical scope disclosed by the present invention, and these modifications or replacements should be included in the protection scope of the present invention. Therefore, the protection scope of the present invention shall be based on the protection scope of the claims.
Claims
1. A method for improving intelligent computing performance, characterized in that: Applied to a system including: a plurality of computing nodes connected to a shared memory via an interconnection bus, each of the plurality of computing nodes starting a daemon process module, the method comprising: Write so file shared library; The sending node among the multiple computing nodes writes the data into the shared memory through the so file shared library; A receiving node among the multiple computing nodes reads data in a shared memory through the so file shared library; Among them, the daemon module is used to establish a Completion Queue and a dual-loop lock-free queue for the sending node and the receiving node when writing data into the shared memory and reading data in the shared memory. The functions that need to be intercepted by the program of the receiving node in the so file shared library include: ibv_create_cq, ibv_create_qp, rdma_bind_addr, rdma_listen, rdma_get_cm_event and ibv_post_recv; the functions that need to be intercepted by the program of the sending node in the so file shared library include: ibv_create_cq, ibv_create_qp, rdma_connect, rdma_get_cm_event and ibv_post_send.
2. A method for improving intelligent computing performance according to claim 1, characterized in that: The program receiving the node in the so file shared library needs to intercept the function ibv_create_cq for: The receiving node among the multiple computing nodes is connected to the daemon process module, and the RDMA communication identification number, IP address and port number assigned to the receiving node are transmitted; The daemon module applies for a Completion Queue in the shared memory and returns the header address of the receiving node’s Completion Queue; The header address, the assigned RDMA communication identification number, the IP address and the port number are recorded in the first area of the shared memory.
3. The method for improving intelligent computing performance according to claim 1, characterized in that: The program receiving the node in the so file shared library needs to intercept the function rdma_bind_addr for: The connection daemon module transfers the assigned RDMA communication identification number; The daemon module applies for a dual-ring lock-free queue in the shared memory and returns the head address of the dual-ring lock-free queue; The allocated RDMA communication identification number and the head address of the dual-ring lock-free queue are recorded in the first area of the shared memory.
4. The method for improving intelligent computing performance according to claim 1, characterized in that: The program receiving the node in the so file shared library needs to intercept the function ibv_post_recv for: Get the ID number of the latest completed transmission data in the dual-ring lock-free queue from the Completion Queue; Read the data storage address from the dual-ring lock-free queue corresponding to the assigned RDMA communication identification number; Get data from the address where the data is stored; The functions ibv_create_qp, rdma_listen, and rdma_get_cm_event intercepted by the receiving node return directly.
5. The method for improving intelligent computing performance according to claim 1, characterized in that: The program sending the node in the so file shared library needs to intercept the function ibv_create_cq for: Connect to the daemon module; The RDMA communication identification number assigned by the receiving node and the head address of the Completion Queue are obtained through the IP address and port number of the receiving node. The sending node and the receiving node share the same Completion Queue.
6. The method for improving intelligent computing performance according to claim 1, characterized in that: The program sending the node in the so file shared library needs to intercept the function rdma_connect for: Connect to the daemon module; Send the RDMA communication identification number, IP address and port number assigned by the sending node to the daemon module; The daemon module applies for a dual-ring lock-free queue of a receiving node, returns it to the receiving node, and records the allocated RDMA communication identification number, IP address and port number and the head address of the dual-ring lock-free queue into the first area of the shared memory.
7. The method for improving intelligent computing performance according to claim 1, characterized in that: The program sending the node in the so file shared library needs to intercept the function ibv_post_send for: Connect to the daemon module and pass the RDMA communication identification number assigned by the receiving node obtained from ibv_create_cq; The daemon module queries the head address of the corresponding dual-ring lock-free queue from the first area of the shared memory; Apply for a memory block from the shared memory of the dual-ring lock-free queue, and write the data to be sent into the memory block; Write the memory block address into the dual-loop lock-free queue, and write the id corresponding to the dual-loop lock-free queue into the CompletionQueue; The function ibv_create_qp that the sending node needs to intercept returns directly.
8. A device for improving intelligent computing performance, characterized in that: The device is applied to a system including: a plurality of computing nodes connected to a shared memory via an interconnection bus, each of the plurality of computing nodes starts a daemon process module, and the device includes: Writing module: used to write so file shared library; Writing module: used for a sending node in multiple computing nodes to write data into a shared memory through the so file shared library; Reading module: used for a receiving node among multiple computing nodes to read data in a shared memory through the so file shared library; Among them, the daemon module is used to establish a Completion Queue and a dual-loop lock-free queue for the sending node and the receiving node when writing data into the shared memory and reading data in the shared memory. The functions that need to be intercepted by the program of the receiving node in the so file shared library include: ibv_create_cq, ibv_create_qp, rdma_bind_addr, rdma_listen, rdma_get_cm_event and ibv_post_recv; the functions that need to be intercepted by the program of the sending node in the so file shared library include: ibv_create_cq, ibv_create_qp, rdma_connect, rdma_get_cm_event and ibv_post_send.
9. An electronic device, characterized in that: include: Processor and memory; The processor is used to execute a method for improving intelligent computing performance as described in any one of claims 1 to 7 by calling the program or instruction stored in the memory.
10. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores a program or instruction, and the program or instruction enables a computer to execute a method for improving intelligent computing performance as described in any one of claims 1 to 7.
Citation Information
Cited By
RDMA dual-network-card main-standby switching method and equipment
CN120743638A
Data storage method and apparatus, and computing node and storage medium
WO2026118820A1
