A service system and method for in-network aggregation transmission
By designing a universal in-network aggregation transmission protocol and service system, the problem of coupling with specific applications in the existing technology is solved, multi-tenant, multi-job aggregation services are realized, the system's versatility and resource utilization efficiency are improved, and it is suitable for Wider distributed aggregation job scenarios.
Patent Information
- Application Number
- CN202210561540.1
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2022-05-23
- Publication Date
- 2024-09-10
- Estimated Expiration
- 2042-05-23
AI Technical Summary
The existing aggregation transmission protocol design based on in-network aggregation is coupled with specific distributed machine learning training applications, lacks versatility, cannot effectively support multi-tenant and multi-job scenarios, and has deficiencies in resource management and load balancing.
A general in-network aggregation transmission protocol and service system is designed. The main scheduling thread and worker thread of the receiving server and the sending server work together to generate and distribute aggregation tasks. Hash functions are used to allocate tasks and storage space to achieve multi-tenancy. , multi-job aggregation service, and interacts with application plug-ins through persistence agents to support multi-task scenarios.
It realizes multi-tenant and multi-job aggregation services, improves the system's versatility and resource utilization efficiency, can be applied to a wider range of distributed aggregation job scenarios, and improves the system's flexibility and scalability.
Smart Images

Figure CN115174501B
Abstract
Description
Technical Field
[0001] The present invention relates to the field of computer network transmission and distributed system, and more specifically, to a service system and a service method for in-network aggregate transmission. Background Art
[0002] Different aggregation transmission protocols can provide different types of services. For distributed machine learning training, the current academic community has proposed two solutions based on in-network aggregation, SwitchML and ATP. Both solutions are designed for distributed machine learning training. Specialized aggregation transmission protocols. SwitchML uses static allocation to determine the aggregator corresponding to each set of gradients, and provides single-tenant, single-job aggregation services to upper-level users. If you want to expand it to multi-tenant and multi-job situations, you need to divide the aggregator resources so that each job of each tenant corresponds to an aggregator resource pool. ATP uses a discrete, dynamic, and best-effort approach to provide multi-tenant, multi-job aggregation services to upper-level users, so that effective aggregator resources can be efficiently and equally shared among multiple distributed training jobs running at the same time. The general in-network aggregation transmission protocol proposed in this proposal can also provide multi-tenant, multi-job aggregation services to upper-level users, but its jobs are more widely distributed aggregation jobs, so it has greater versatility.
[0003] SwitchML and ATP are only for distributed machine learning training, so there is no additional design for the service framework. ATP simply uses multi-threading to accelerate packet processing. Each ATP worker node has a centralized scheduler to receive the gradient tensor sent from the application layer. The scheduler assigns the tensor to a thread for sending. The scheduler maintains the total load on each thread to ensure load balancing on each thread.
[0004] The existing designs of aggregation transmission protocols based on in-network aggregation are all coupled with specific applications. For this reason, we designed a general in-network aggregation transmission protocol and a corresponding application service framework. The service framework sets up a persistent agent on the terminal host, and communicates with various distributed aggregation applications through the agent, specifically interacting with different application plug-ins. Applications can submit multiple aggregation tasks at the same time and aggregate them at the same time, so the service framework provides multi-tenant, multi-job aggregation services to upper-level users. Summary of the invention
[0005] In response to the problems in the background technology, a service system for in-network aggregation includes: a receiving server and a sending server, wherein the receiving server generates multiple aggregation tasks, each aggregation task includes: a globally unique ID number, the number of sending servers, the ID number of the sending server, the address of the sending server and information for obtaining key-value pair data; the receiving server prepares a receiving space and notifies the sending server of the receiving space; the receiving server creates a sending task and notifies the sending server of the sending task; the sending server creates a group based on the sending task and the information of the storage space, the group includes the aggregated key-value pair data; after receiving the group sent by the sending server, the receiving server parses the group and puts the data into the storage space.
[0006] The present invention also proposes a service method for in-network aggregation transmission, comprising:
[0007] The receiving server has a main scheduling thread and multiple working threads. The main scheduling thread generates multiple aggregation tasks. Each aggregation task includes: a globally unique ID number, the number of sending servers, the ID number of the sending server, the sending server address, and information for obtaining key-value pair data;
[0008] The receiving server allocates a receiving buffer to the aggregation task, and notifies each sending server of information of the receiving buffer;
[0009] The sending server creates a sending task based on the sending task and the receiving cache, wherein the sending task includes: the ID number of the aggregation task, the information of the sending server and the information of the receiving cache,
[0010] The receiving server has a main scheduling thread and multiple working threads, the sending server has a main scheduling thread and multiple working threads, the main scheduling threads of the receiving server and the sending server share a control channel, and the main scheduling thread of the receiving server and multiple working threads share an exclusive data channel.
[0011] The present invention provides a general implementation method for distributed computing. The interaction process of the method of the present invention is also general and can be applied to other multi-task scenarios with multiple senders and receivers. BRIEF DESCRIPTION OF THE DRAWINGS
[0012] In order to make the present invention more easily understood, the present invention will be described in more detail by referring to the specific embodiments shown in the accompanying drawings. These drawings only depict typical embodiments of the present invention and should not be considered as limiting the scope of protection of the present invention.
[0013] Figure 1 The following is a flow chart of an embodiment of the service system of the present invention.
[0014] Figure 2 A structural principle diagram of an embodiment of the method of the present invention.
[0015] Figure 3 A structural schematic diagram of another embodiment of a service system for implementing the present invention.
[0016] Figure 4 The figure is a schematic diagram of an embodiment of a general packet data format used in the present invention. DETAILED DESCRIPTION
[0017] The following describes the implementation modes of the present invention with reference to the accompanying drawings so that those skilled in the art can better understand the present invention and implement it. However, the enumerated embodiments are not intended to limit the present invention. In the absence of conflict, the following embodiments and the technical features in the embodiments may be combined with each other, wherein the same components are represented by the same figure marks.
[0018] First embodiment
[0019] like Figure 1 As shown, the service system of the present invention includes multiple servers, each server includes: an application interface unit, a main scheduling unit, and a working unit. The server of the present invention can be an agent software implemented by a computer program to serve the upper application software. The application software communicates with the server or is integrated together through a plug-in. Multiple servers can form a server cluster for aggregated tasks.
[0020] The upper layer application generates key-value pairs for aggregation and transmits them to the main scheduling unit of the receiving server through the application interface unit. Each aggregation task has a globally unique ID number task_id. The main scheduling unit creates multiple aggregation tasks, each of which includes: <task_id,num_snd_task,List<dstIP,snd_id,app_data> >, where num_snd_task represents the number of sending servers in the aggregation task, and List records the IP address dstIP of each sending server, the sending server global ID snd_id, and the key-value data app_data (which can also be specific information used to obtain key-value data from the upper-layer application). Each aggregation task is assigned to one of the N work units and processed by the work unit.
[0021] In addition, the main scheduling unit of the receiving server prepares a receiving space for each aggregation task<addr,size> , the receiving space is allocated to one of the N work units. The allocation method can be to perform a hash function operation on the task_id and then allocate it to one of the work units. In the future, the receiving server listens to the packets with task_id, and the packets are placed in the corresponding receiving space. After preparing the receiving space, the receiving server sends the information of the receiving space to each sending server. The main scheduling unit of the receiving server can use metadata<addr,size> Notification List<dstIP,snd_id,app_data> The main scheduling unit data of each sending server in the table has been prepared and stored in the starting position addr and size size of the storage space.
[0022] Then, the main scheduling thread of the receiving server generates num_snd_task sending tasks according to the aggregation task, notifying the List in the aggregation task<dstIP,snd_id,app_data> Each sending server records its sending tasks<dstIP,snd_id,app_data> , the sending task of the sending server<dstIP,snd_id,app_data> Includes the following information: the IP address dstIP of each sending server, the sending server global ID snd_id, and the key-value pair data app_data.
[0023] For the sending server, when List<dstIP,snd_id,app_data> The sending server receives the sending task<dstIP,snd_id,app_data> After that, the main dispatch unit of the sending server creates a sending task<task_id,snd_id,addr,size> , where snd_id represents the global ID of the sending server. The sending task is assigned to one of the N work units of the sending server. The assignment method can be to perform a hash function operation on task_id (hash(task_id)) and then assign it to one of the work units. The hash function used by the sending server and the receiving server can be the same.
[0024] Both the receiving server and the sending server include a main scheduling unit and multiple working units. The main scheduling unit has a control channel (such as an interface or channel) for transmitting control information with other servers or other external devices (such as a network card). The working unit can be set as a sender for sending aggregation tasks, or it can be set as a receiver for receiving aggregation tasks. There is a data channel (such as an interface or channel) between the main scheduling unit and each working unit for transmitting data, that is, the main scheduling unit can distribute the aggregation task to each working unit. In one embodiment, when the server communicates with the network card, each data channel is associated with a transceiver pair (tx / rx send-receive pair) of the network card for transmitting data, such as key-value pair data.
[0025] The sending server and the receiving server also include a network card NIC unit, and each working unit actively polls the network card to exchange data with it. The working unit of the sending server takes tasks from the task queue and processes each sending task in sequence, pushes the data of each sending task to the network, and sends an end signal when the sending task ends. After receiving the packet, the working unit of the receiving server classifies the packet into the corresponding receiving buffer.<addr,size> The switch between the sending server and the receiving server will perform the aggregation operation according to the agreed transmission protocol. The receiving server will collect the end signal of each sending task. Once all the sending tasks are completed, the receiving server will pull the intermediate results from the switch. All the results will be merged together and put into the memory. The aggregation task with the task number task_id will be marked as completed and put into the completion queue.
[0026] Second embodiment
[0027] like Figure 2 As shown, the second embodiment proposes a method.
[0028] S100, the receiving server generates an aggregation task with a globally unique ID number task_id. The aggregation task includes the following information: <task_id,num_snd_task,List<dstIP,snd_id,app_data> >, where num_snd_task represents the number of sending servers in the aggregation task, and the List list records the IP address dstIP of each sending server, the sending server global ID snd_id, and the key-value pair data app_data (it can also be specific information used to obtain the key-value pair data app_data).
[0029] S101, the receiving server prepares a receiving storage space<addr,size> , addr indicates the starting position of the storage space addr, size indicates the size of the storage space, and the metadata<addr,size> The sending server in the list is notified in the form of, where the notification information also includes the aggregation task ID number task_id.
[0030] S102, the receiving server creates num_snd_task sending tasks and notifies each sending server in the List of its sending tasks<dstIP,snd_id,app_data> , the sending task of the sending server<dstIP,snd_id,app_data> The notification includes the following information: the IP address dstIP of each sending server, the sending server global ID snd_id, and the key-value pair data app_data. The notification information also includes the aggregation task ID number task_id.
[0031] S103, the sending server receives the sending task<dstIP,snd_id,app_data> and metadata<addr,size> After that, the sending server creates a sending task<task_id,snd_id,addr,size> , where snd_id represents the global ID of the sending server. The sending task is assigned to one of the N work units of the sending server. The assignment method can be to perform a hash function operation on task_id (hash(task_id)) and then assign it to one of the work units. The hash function used by the sending server and the receiving server can be the same.
[0032] S104, the receiving server listens to the information with task_id, and after receiving the data from the sending server, parses the packet and puts it into the corresponding storage space<addr,size> .
[0033] Third embodiment
[0034] The servers in the first implementation mode can form a distributed service system, such as Figure 3 As shown, the service system includes multiple servers, each of which performs the functions described above.
[0035] A persistent agent is set up on each server to serve the upper-layer application. The application is integrated with the service system through plug-ins, so that multiple aggregation tasks can be submitted to the service system at the same time. Each agent includes a main scheduler thread and multiple worker threads. Figure 3The architecture of the proxy is shown, where the threads in the proxy perform multiple aggregate tasks as senders or receivers in the aggregate task in a persistent manner. In the implementation of the service system, a control channel is built on all scheduling threads, and N data channels are built on each scheduling thread and all worker threads. Each data channel is associated with a tx / rx send-receive pair on the network card. While the control channel transmits the control channel, the N data channels transmit key-value pair data.
[0036] Initialize an aggregation task: The receiver (receiving server) in the application uses the globally unique ID number task_id to initialize an aggregation task. The plugin first submits a request through IPC (Inter-Process Communication). <task_id,num_snd_task,List<dstIP,snd_id,app_data> >Give it a local scheduling thread. num_snd_task indicates the number of senders (sending servers) in the task. The List describes each sender, including its IP address, sender ID, and specific information used to obtain key-value data from the upper-layer application.
[0037] Prepare the receiver (receiving server): The scheduling thread allocates a receiving buffer in memory for the task<addr,size> , the receiving buffer is assigned to one of the N worker threads through a hash function (e.g. hash(task_id)), and then an aggregation task is placed in the receiving task queue. When a packet with task_id in the header is received, the packet will be classified and placed in the corresponding receiving buffer. Then, the receiver's scheduling thread generates num_snd_task sender tasks and notifies the scheduling thread of each sender server of its sender task through the control channel.<task_id,snd_id,app_data> .
[0038] Prepare sender (sending server): The sender's scheduling thread accepts the sending task and notifies the receiver's application plug-in, which listens to the subchannel with the key task_id in the control channel. The plug-in parses app_data and prepares key-value data in memory as metadata.<addr,size> The sender's scheduling thread is notified in the form of data that is ready and stored in the memory at a location of size starting from addr.
[0039] Scheduling sender (sending server): The sender's scheduling thread passes the message<task_id,snd_id,addr,size> Create a sending task and assign it to the corresponding data channel using the same hash function hash(task_id) as the receiver. Each worker thread maintains a task queue, and the sending task is placed in the task queue and processed by the worker thread in a FIFO first-come-first-served manner.
[0040] Execute aggregation tasks: Each worker thread actively polls the network card (switch performs aggregation tasks) to exchange data with it. The sender's worker thread takes tasks from the task queue and processes each sending task in sequence, pushes the data of each sending task to the network, and sends a FIN signal at the end of the sending task. The receiver's worker thread always receives packets and classifies the packets into the corresponding receiving buffer. The switch between the sender and the receiver will perform best-effort aggregation operations according to the general in-network aggregation transmission protocol. The receiver will collect the FIN signal of each sending task. Once all the sending tasks are completed, the receiver will pull the intermediate results from the switch. All the results will be merged together and put into the memory. The aggregation task with the task number task_id will be marked as completed and put into the completion queue.
[0041] Returns the result to the application: The plugin listener of the receiver application controls the subchannel with the key task_id in the channel. Once an aggregation task is completed, the thread will notify the plugin<addr,size> With the key value task_id, the plugin returns the data in memory to the application.
[0042] Among them, in the aggregation task, the grouping format used is as follows Figure 4 As shown, in this packet, the header contains control information, and the payload field contains the key-value pairs to be aggregated.
[0043] Specifically, the task number field (task_id field) stores the task number to be aggregated. The sending node number field (snd_id field) stores the sending node number that sends the packet. The thread number field (thread_id field) stores the specific thread number that sends the packet.
[0044] The packet type field (type field) stores the type of the packet, which includes six types: SYN, FIN, DATA, ACK, QUERY, and RESET. SYN means start, FIN means end, DATA means data, ACK means confirmation, QUERY means query, and RESET means reset.
[0045] The packet sequence number field (sequence field) stores the sequence number of the packet sent by the thread. The payload field (payload field) contains the key-value pair to be aggregated, and there can be multiple key-value pairs.
[0046] The validity field (bitmap field) indicates which key-value pairs in the payload field (payload) are valid. In one embodiment, the bitmap field has the same number of bits as the key-value pairs in the payload field (payload field), and these bits are used to indicate which key-value pairs in the payload field (payload field) are valid (for example, 1 means valid, that is, processed). The payload field (payload field) stores key-value pairs, which are in the form of (key-value pairs). When aggregating, the key is compared, and the bitmap field in the universal packet data format is used to determine whether the value is aggregated by the switch.
[0047] The service system can communicate with the switch. The service system and the switch cooperate to comply with a common transmission protocol to execute each aggregation task. The service system provides a common architecture for distributed aggregation applications, so multiple different tasks can submit aggregation tasks to the service system at the same time. The service system processes the aggregation tasks in a multiplexed manner, which improves the versatility of the system.
[0048] The service system of the present invention can perform six functions: initializing aggregation tasks, preparing receivers, preparing senders, preparing sender tasks, scheduling senders, executing aggregation tasks, and returning results to upper-level applications. It uses the same interaction process to perform aggregation operations on three distributed applications: big data computing applications, distributed training, and high-performance computing, verifying the versatility of the service system interface.
[0049] The embodiments described above are only preferred specific implementations of the present invention. This specification uses the phrases "in one embodiment", "in another embodiment", "in yet another embodiment" or "in other embodiments" to refer to one or more of the same or different embodiments according to the present disclosure. Common changes and substitutions made by those skilled in the art within the scope of the technical solution of the present invention should be included in the protection scope of the present invention.
Claims
1. A service method for in-network aggregation transmission, characterized in that: include: The receiving server generates an aggregation task with a globally unique ID number. The aggregation task also includes the following information: the number of sending servers, the IP address of each sending server, the sending server global ID, and a list of key-value pairs; The receiving server prepares a receiving storage space and notifies the sending servers in the list, wherein the notification information also includes a globally unique ID number of the aggregation task; The receiving server creates a sending task, the number of sending tasks is the number of sending servers in the aggregation task, and notifies each sending server in the list of its sending task, the sending task of the sending server includes the following information: the IP address of each sending server, the sending server global ID, and key-value pair data; After the sending server receives the sending task and the information of the storage space, the sending server creates a sending task, the sending task includes the global ID of the sending server, and the sending task is assigned to one of the multiple work units of the sending server; The receiving server monitors the information with the globally unique ID number, and after receiving the data from the sending server, parses the packet and puts it into the corresponding storage space.
2. The service method according to claim 1, characterized in that: The receiving server has a main scheduling thread and multiple worker threads, and the main scheduling thread generates multiple aggregation tasks; The receiving server allocates a receiving buffer to the aggregation task, and notifies each sending server of information of the receiving buffer; The sending server creates a sending task based on the sending task and the receiving buffer; The receiving server has a main scheduling thread and multiple working threads, the sending server has a main scheduling thread and multiple working threads, the main scheduling threads of the receiving server and the sending server share a control channel, and the main scheduling thread of the receiving server and multiple working threads share an exclusive data channel.
3. The service method according to claim 2, characterized in that: Each data channel is associated with a transceiver pair and the network card, and the data channel is used to transmit key-value pair data.
4. The service method according to claim 2, characterized in that: The receiving server and the sending server use the hashing method of the aggregation task ID to assign the receiving buffer to a worker thread.
5. The service method according to claim 1, characterized in that: The packet includes control information and a payload, the payload includes a key-value pair converted from original data to be sent, and the control information includes a validity field, which can indicate whether the key-value pair in the payload field is aggregated.
6. The service method according to claim 5, characterized in that: The control information also includes: The task number field is used to store the task number to be aggregated; A sending port number field, used to store the sending port number of the packet; A thread number field, used to store the thread number of the sending end that sends the packet; A packet sequence number field is used to store the sequence number of the packet to be sent; The type field is used to store the type of the packet, including: start, end, data, confirmation, query, and reset.
7. The service method according to claim 2, characterized in that: Each worker thread of the sending server and the receiving server actively polls the switch that performs the aggregation task to exchange data with it; The worker thread of the sending server takes tasks from the task queue, processes each sending task in sequence, pushes the data of each sending task to the network, and sends a FIN signal when the sending task is completed; The worker thread of the receiving server always receives packets and classifies them into the corresponding receiving buffer.
8. The service method according to claim 1, characterized in that: In the sending server, when the sending task is assigned to one of the multiple work units of the sending server, the allocation method can be to perform a hash function operation on the globally unique ID number and then assign it to one of the work units. The hash function used by the sending server and the receiving server is the same.
9. The service method according to claim 1, characterized in that: The receiving storage space is metadata<addr,size> , addr indicates the starting position of the storage space, size indicates the size of the storage space, and the sending servers in the list are notified in the form of metadata.
10. A service system for in-network aggregation transmission, characterized in that: include: A receiving server and a sending server, wherein the receiving server and the sending server implement the method described in any one of claims 1-8.
