A fusion system and fusion method of a large-scale brain simulation communication library

By designing a fusion system for a large-scale brain simulation communication library, the interface differences when migrating brain simulation applications to different hardware platforms were resolved, simplifying user programming, improving compatibility and portability, and achieving efficient communication between hardware platforms.

CN119537046BActive Publication Date: 2026-02-10CHINA NANHU ACAD OF ELECTRONICS & INFORMATION TECH
View PDF 1 Cites 0 Cited by

Patent Information

Application Number
CN202311109157.3
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2023-08-30
Publication Date
2026-02-10
Estimated Expiration
2043-08-30

AI Technical Summary

Technical Problem

In large-scale brain simulation, when migrating brain simulation applications to different hardware platforms, the differences in the interface design of existing communication libraries lead to high migration costs. It is necessary to develop a unified communication library with a unified interface to reduce migration difficulty and improve efficiency.

Method used

Design a fusion system for a large-scale brain simulation communication library, including a unified application interface layer, a hardware adaptation layer, a backend layer, and a hardware layer. This system provides a method to implement the hardware adaptation layer and the backend layer, encapsulate the communication backend interfaces of different hardware platforms, and realize specific communication functions.

Benefits of technology

It simplifies user programming, improves application compatibility and portability, supports large-scale brain simulation on different hardware platforms, reduces migration costs, and achieves efficient operation.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119537046B_ABST
    Figure CN119537046B_ABST
Patent Text Reader

Abstract

The application provides a fusion system and fusion method of a large-scale brain simulation communication library, and the system comprises: a unified application interface layer which defines a unified application interface for users, and the users transmit buffer address and data size information required for communication to a specific communication back end by calling the unified application interface layer; a hardware adaptation layer which comprises an interface layer of unified interface description, operator and data type and a kernel layer for unified resource management; a back end layer which encapsulates communication interfaces of communication back ends based on different hardware platforms and realizes specific communication functions; and a hardware layer which comprises hardware and its driver and a software development kit. The scheme of the application simplifies user programming, improves application compatibility and portability, provides a unified communication interface for upper layer application by constructing a unified aggregated communication interface library independent of specific hardware platforms, is compatible with different hardware platforms, and can support large-scale brain simulation of different hardware platforms.
Need to check novelty before this filing date? Find Prior Art

Description

TECHNICAL FIELD

[0001] The present application belongs to the technical field of large-scale brain simulation, and particularly relates to large-scale brain simulation fusion of different hardware platforms. BACKGROUND

[0002] In the process of large-scale brain simulation, developers usually divide a huge neuron network into different computing chips, and use multiple chips to perform computation together to complete large-scale simulation. Therefore, in the process of large-scale brain simulation, a collective communication library is needed to synchronize the computation results of multiple computing chips. Common communication libraries include Open MPI (Open Message Passing Interface) based on the Message Passing Interface (MPI) standard, MPICH, MVAPICH, etc. used in CPU platform simulation. Open MPI, MPICH, and MVAPICH are all open source high-performance Message Passing Interface (MPI) implementations. They provide libraries and runtime environments for writing parallel programs, so that developers can perform parallel computation in a distributed memory system. NCCL (NVIDIA Collective Communications Library) used in NVIDIA GPU platform simulation. NCCL is a parallel communication library developed by NVIDIA for high-performance GPU-accelerated clusters. NCCL is mainly used to implement efficient data transmission and communication operations between GPUs, and supports parallel computation and deep learning training on multiple GPUs.

[0003] The implementation and interface of communication libraries of different hardware platforms are different, and new computing chips are constantly emerging, such as domestic computing chips and TPUs. In order to further improve the accuracy and efficiency of large-scale brain simulation, developers need to migrate existing brain simulation applications to chips that are more suitable for brain simulation computation characteristics. When users migrate brain simulation applications originally based on a platform such as CPU to another platform such as NVIDIA GPU, they need to completely modify the interface of the original communication library such as OpenMPI to the interface of another platform's communication library such as NCCL. Since there is a certain gap between the interface design of OpenMPI and NCCL, a large amount of source code needs to be modified. Because brain simulation application source code is more complex, the cost of application migration is extremely high. Therefore, a unified interface fusion communication library that supports large-scale brain simulation is needed to reduce the difficulty of brain simulation application migration, so that brain simulation applications can be quickly deployed on suitable chips and run efficiently. SUMMARY

[0004] In view of this, the present application provides a large-scale brain simulation communication library fusion system for large-scale brain simulation of different hardware platforms; the system comprises a unified application interface layer, a hardware adaptation layer, a backend layer and a hardware layer; wherein,

[0005] The unified application interface layer defines a unified application interface for users;

[0006] The user transmits the buffer address and data size information required for communication to the specific communication backend by calling the unified application interface layer;

[0007] The hardware adaptation layer manages data through the establishment of a unified communication sub, realizes the kernel layer and uniformly manages communication resources;

[0008] The backend layer encapsulates the communication interface of the communication backend based on different hardware platforms and realizes specific communication functions;

[0009] The hardware layer comprises hardware and its driver, a software development kit.

[0010] Further, the unified application interface layer comprises an initialization and resource release interface, an information reading interface, a communication primitive interface and a communication synchronization interface; wherein,

[0011] The initialization and resource release interface comprises an initialization communication environment interface Init and a resource release interface Finalize;

[0012] The information initialized through the initialization communication environment interface Init is stored in a communication sub data structure, and the communication resources of the corresponding hardware are released through the operation of the resource release interface on the communication sub;

[0013] The information reading interface comprises a communication entity number acquisition interface Get_comm_rank, a communication entity quantity acquisition interface Get_comm_size and a device number acquisition interface Get_device_id;

[0014] The communication primitive interface comprises a point-to-point communication primitive and a set communication primitive; common data types and common data operations are supported;

[0015] The communication synchronization interface is used for communication synchronization after the calling of an asynchronous interface.

[0016] Further, the hardware adaptation layer comprises a backend initialization and release unit, a globally unique ID identification and device relationship mapping unit, a communication context management unit and a data type conversion unit; wherein,

[0017] The backend initialization and release unit completes the selection and initialization of the communication backend according to the selected backend during initialization;

[0018] The globally unique ID identifier and device relationship mapping unit is used to map one globally unique ID identifier to one device, and to establish a mapping relationship between processes, globally unique ID identifiers and devices in the case of a single process with multiple devices.

[0019] The communication context management unit is used to store the communication resources required by different backends by defining a unified communication sub-data structure.

[0020] In this process, the user obtains the communication entity number interface Get_comm_rank through the information reading interface of the unified application interface layer, and passes the communication entity number interface Get_comm_rank into the communication sub-information to obtain a globally unique ID identifier, so as to specify the device corresponding to the globally unique ID identifier to complete the specific calculation or communication task.

[0021] The data type conversion unit is used to convert and map communication data types and communication data operators used by different backends by defining a unified communication data type data structure and a unified communication data operator data structure.

[0022] Furthermore, the encapsulation of the backend layer includes: defining a backend data structure that includes initialization, resource release, communication primitives, and synchronization functions;

[0023] Based on the defined backend data structure, create a backend data structure array to store communication backend information for different platforms; encapsulate the initialization, resource release, communication primitives, and synchronization functions of the communication backend for a certain platform, assign the encapsulated functions to backend variables, and store them in the defined backend data structure array;

[0024] The defined backend data structure array is initialized and released by the backend initialization and release unit of the hardware adaptation layer, and provided to the unified application interface layer.

[0025] This invention also provides a method for fusing large-scale brain simulation communication libraries for large-scale brain simulation on different hardware platforms; the method includes:

[0026] Step S1: Abstract interface functions, design a unified application interface, unified data type and data operator;

[0027] Step S2: Data management is achieved by establishing a unified communication sub-sub ...

[0028] Step S3: Abstract the commonalities among multiple actual backends, design a unified backend data structure, and populate the relevant data structure with data when using specific devices;

[0029] Step S4: Map the data types and data operators in the backend of each platform;

[0030] Step S5: Encapsulate the interfaces in the backend of each platform that have the same function as the designed application interface.

[0031] Furthermore, the unified application interface (API), unified data type, and data operators in step S1 are specifically as follows:

[0032] The unified interfaces include: Initialize communication environment (Init), Finalize resource release (Finalize), Get_comm_rank (Get_comm_rank), Get_comm_size (Get_comm_size), Get_device_id (Get_device_id), Send (Point-to-point send), Recv (Point-to-point receive), Bcast (Bcast), Alltoall (All_to_all), Allgather (All_gather), Allreduce (All_reduce), Reducescatter (Reduce_scatter), and Synchronize (Synchronize).

[0033] The unified data type is specifically the character type char; it includes integer and floating-point types.

[0034] Unified data operators include: sum, prod, max, min, and avg.

[0035] Furthermore, the kernel layer in step S2 includes a unified communication sub-sub ...

[0036] Furthermore, the unified backend data structure in step S3 includes declarations of different backends and declarations of common interfaces.

[0037] Furthermore, the mapping in step S4 includes:

[0038] S401: Mapping data types for different backends;

[0039] S402: Mapping data operators for different backends.

[0040] Furthermore, the encapsulation in step S5 includes: passing the buffer address, message size, and unified communication sub-interface of the defined unified interface to the interface of the actual communication backend, and converting the passed data type and data operator before passing them to the interface of the actual communication backend.

[0041] The solution of this invention simplifies user programming, improves application compatibility and portability, and provides a unified communication interface for upper-layer applications by constructing a unified aggregate communication interface library (NanhuCCL, Nanhu Collective CommunicationLibrary) that is independent of specific hardware platforms, while being backward compatible with different hardware platforms, thus supporting large-scale brain simulation on different hardware platforms. Attached Figure Description

[0042] Figure 1 This is a block diagram of the fusion system for large-scale brain simulation of the present invention.

[0043] Figure 2 This is a schematic diagram of the backend layer class of the fusion system for large-scale brain simulation of the present invention;

[0044] Figure 3 This is a flowchart of the large-scale brain simulation fusion method of the present invention;

[0045] Figure 4 This is a test network diagram of the fusion system for large-scale brain simulation of the present invention;

[0046] Figure 5 This is a diagram showing the single-machine test results of the CPU platform of the present invention;

[0047] Figure 6 This is a graph showing the multi-machine test results of the CPU platform of this invention;

[0048] Figure 7 The figure shows the single-machine test results of the GPU platform of this invention;

[0049] Figure 8 This is a graph showing the multi-machine test results of the GPU platform of this invention;

[0050] Figure 9 This is a diagram showing the test results of the brain simulation application of the present invention. Detailed Implementation

[0051] To make the objectives, technical solutions, and advantages of the embodiments of the present invention clearer, the technical solutions of the embodiments of the present invention will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of the present invention, and not all embodiments. Based on the embodiments of the present invention, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of the present invention.

[0052] Figure 1 A block diagram of the fusion system for large-scale brain simulation of the present invention is shown. Figure 1 As shown, the large-scale brain simulation fusion system of the present invention includes: a unified application interface (API) layer, a hardware adaptation layer, a backend layer, and a hardware layer. The various components of the system are described in detail below.

[0053] 1. Unified Application Interface (API) Layer

[0054] The Unified Application Interface (API) layer defines the user-facing unified application interface (API). Users call the API layer to pass information such as the buffer address and data size required for communication to the specific communication backend. The API layer mainly includes: initialization and resource release interfaces, information reading interfaces, communication primitive interfaces, and communication synchronization interfaces.

[0055] The initialization and resource release interfaces include: the `Init` interface for initializing the communication environment and the `Finalize` interface for releasing resources. The initialization interface allows selection of different backends for different hardware, such as MPI, NCCL, and BrainlikeCCL (BrainlikeCCL is a collective communication library for neuromorphic computing chips). For NCCL and BrainlikeCCL, it also allows selecting a process to control one computing chip or a process to control multiple computing chips, thus supporting different application scenarios. Initialization information is stored in the communication sub-data structure defined by this system, and the communication resources of the corresponding hardware are released through operations on this communication sub-data structure in the resource release interface.

[0056] The information reading interfaces include: Get_comm_rank for obtaining the communication entity number, Get_comm_size for obtaining the number of communication entities, and Get_device_id for obtaining the device number. These interfaces can return the corresponding information to facilitate application programming.

[0057] The communication primitive interfaces include point-to-point communication primitives and set communication primitives. Point-to-point communication primitives include the Send interface and the Recv interface; set communication primitives include the Bcast interface, the Alltoall interface, the Allgather interface, the Allreduce interface, and the Reducescatter interface. The communication primitives used are defined according to the functions of mainstream communication primitives, supporting the transmission of common data types such as characters, integers, and floating-point numbers, as well as common data operations such as summation and product, thus supporting various current application scenarios such as brain simulation and deep learning.

[0058] The communication synchronization interface is called `Synchronize`. Synchronization is performed after calling the asynchronous interface to ensure communication completion. Using the asynchronous interface enables parallel communication and computation, thereby improving overall application performance.

[0059] 2. Hardware adaptation layer

[0060] The hardware adaptation layer provides a unified device access interface and device context management interface, establishing hardware device layer information. It implements an interface layer containing unified interface descriptions, operators, and data types, and a kernel layer for unified resource management. The unified interface description abstracts and encapsulates hardware functionality, populating relevant data structures when using a specific device, and then invoking the corresponding device functions based on the populated data. The hardware adaptation layer includes: a backend initialization and release unit, a globally unique ID (rank) and device relationship mapping unit, a communication context management unit, and a data type conversion unit.

[0061] The backend initialization and release unit selects and initializes the communication backend based on the selected backend. For example, if nccl is selected as the communication backend, the hardware adaptation layer initializes the custom communication sub-sub ...

[0062] The globally unique ID (rank) and device mapping unit supports one globally unique ID (rank) corresponding to one device. It establishes a mapping relationship between processes and globally unique IDs (rank) and devices for single-process, multi-device scenarios. A globally unique ID (rank) is an entity participating in communication, represented by a globally unique ID (0, 1, 2, ..., n-1). For example, in a Message Passing Interface (MPI), one globally unique ID (rank) represents an MPI process; in NCCL, one globally unique ID (rank) represents a GPU. A device represents a PCIe device, such as a GPU or a neuromorphic computing chip. Device IDs are typically local numbers within a single node; therefore, it is necessary to bind the globally unique ID (rank) to the local device. This binding information is stored in a system-defined communication sub-unit. Users can obtain a globally unique ID (rank) by passing the communication entity number obtained from the information reading interface Get_comm_rank in the unified application interface (API) layer, and then specify the corresponding device to complete a specific computing or communication task.

[0063] The communication context management unit is used to store the communication resources required by different backends by defining a unified communication sub-data structure. On the CPU platform, it stores the MPI communication sub-MPI_Comm, the communication request MPI_Request, and the communication status MPI_Status. On the GPU platform, it stores the NCCL communication sub-ncclComm_t, the CUDA asynchronous stream cudaStream_t, and other information needed during the communication process.

[0064] The data type conversion unit is used to convert and map communication data types and communication data operators used by different backends by defining a unified communication data type data structure and a unified communication data operator data structure.

[0065] 3. Backends layer

[0066] The backend layer encapsulates the communication interfaces of communication backends based on different hardware platforms, implementing specific communication functions. The backend layer encapsulation mainly includes:

[0067] Figure 2 The backend layer class of the fusion system for large-scale brain simulation of the present invention is shown. For example... Figure 2As shown, the Backends layer classes include initialization, communication primitives (such as sending and receiving), synchronization, and resource release. The Backends layer encapsulation defines a backend data structure that includes the functions of initialization, resource release, communication primitives, and synchronization.

[0068] Based on the defined backend data structure, create an array of backend data structures to store communication backend information for different platforms.

[0069] The initialization, resource release, communication primitives, and synchronization functions of the communication backend of a platform such as CPU are encapsulated, and the encapsulated functions are assigned to backend variables and stored in the defined backend data structure array.

[0070] The defined backend data structure array is initialized and released by the backend initialization and release unit of the hardware adaptation layer, and provided to the unified API layer for specific function implementation.

[0071] 4. Hardware layer

[0072] The hardware layer includes hardware and its drivers, software development kits (SDKs), etc. It currently supports CPUs and GPUs, and is expanding its support to neuromorphic computing chips. Other hardware can also be adapted in the same way, making it highly scalable.

[0073] Figure 3 The fusion method of the large-scale brain simulation communication library of the present invention is illustrated. For example... Figure 3 As shown, the method includes the following steps:

[0074] Step S1: Abstract interface functions, design a unified application interface (API), unified data types, and data operators.

[0075] Step S2: Data management is achieved by establishing a unified communication sub-sub ...

[0076] Step S3: Abstract the commonalities among multiple actual backends, design a unified backend data structure, and populate the relevant data structure with data when using specific devices.

[0077] Step S4: Map the data types and data operators in the backend of each platform.

[0078] Step S5: Encapsulate the interfaces in the backend of each platform that have the same functionality as the designed API.

[0079] The steps described above are described in more detail below.

[0080] Step S1, "Unified Application Interface (API), Unified Data Types, and Data Operators," mainly includes:

[0081] The unified interfaces include: Initialize communication environment (Init), Finalize resource release (Finalize), Get_comm_rank (Get_comm_rank), Get_comm_size (Get_comm_size), Get_device_id (Get_device_id), Send (Point-to-point send), Recv (Point-to-point receive), Bcast (Bcast), Alltoall (All_to_all), Allgather (All_gather), Allreduce (All_reduce), Reducescatter (Reduce_scatter), and Synchronize (Synchronize).

[0082] The unified data types include: character type char, integer types int8, uint8, int32, uint32, int64, uint64, int, and floating-point types float16, half, float32, float64, float, and double.

[0083] Unified data operators include: sum, prod, max, min, and avg.

[0084] Step S2, the kernel layer, mainly includes: a unified communication sub, whose data type is nhcclComm_t, which stores the communication backend type, the globally unique ID (rank) of the communication entity, the device ID, and the communication resources required by the specific communication backend, such as the MPI_Comm, MPI_Request, and MPI_Status communication sub for the Message Passing Interface (MPI); and the ncclComm_t and cudaStream_t communication sub for NCCL. By calling the corresponding backend interface through the unified communication sub's backend type, the functionality of the unified application interface is achieved.

[0085] The unified backend data structure in step S3 mainly includes: declarations of different backends and declarations of common interfaces, which serve as a bridge between the kernel layer and the actual communication backend, thus shielding the hardware details.

[0086] The mapping in step S4 mainly includes:

[0087] S401: Maps data types to different backends. For example, it maps the integer type MPI_INT used in MPI to Int, and the floating-point data type ncclFloat used in NCCL to Float. When a user uses Int or Float, the actual data type passed to the communication backend will be the corresponding integer or floating-point type.

[0088] S402: Maps data operators to different backends. For example, it maps the summation operator MPI_SUM used in the Message Passing Interface (MPI) to Sum, and the summation operator ncclSum used in NCCL to Sum, etc. When a user uses Sum, the actual data type passed to the communication backend will be the corresponding data operator.

[0089] The encapsulation in step S5 mainly includes: passing the buffer address, message size, and unified communication sub-sub ...

[0090] The system testing process of this invention will be described below.

[0091] 1. Test Environment

[0092] The test server configuration and test software configuration of this system are shown in Table 1 and Table 2.

[0093] Table 1. Test server configuration of this system

[0094]

[0095] Table 2. Test software configuration for this system

[0096]

[0097] The test network of this system is as follows: Figure 4 As shown.

[0098] 2. Test Results

[0099] The system underwent performance testing on both CPU and GPU platforms. The test content included: Performance Test P1: Standalone test on the CPU platform.

[0100] Performance Test P2: Multi-machine test of CPU platform.

[0101] Performance Test P3: Single-machine test of GPU platform.

[0102] Performance Test P4: Multi-machine test on GPU platform.

[0103] (1) Performance test P1

[0104] The test content described in performance test P1 mainly includes:

[0105] P101: Two processes are used to send and receive data ranging from a minimum of 8 bytes to a maximum of 128 MBytes. The two processes are located on the same server to test the transmission latency of the point-to-point interfaces Send and Recv in a single-machine environment, and to compare the test results with those of the same OpenMPI interface in the same environment.

[0106] P102: Using eight processes, one process acts as the root process to send data ranging from a minimum of 8 bytes to a maximum of 128 MBytes to the other seven processes. The other seven processes receive the data. All eight processes are located on the same server to test the transmission latency of the broadcast interface Bcast in a single-machine environment and compare the test results with those of the same OpenMPI interface in the same environment.

[0107] P103: Eight processes are used to send and receive data ranging from a minimum of 8 bytes to a maximum of 128 MBytes. The eight processes are located on the same server to test the transmission latency of the Alltoall interface All_to_all in a single-machine environment, and to compare the test results with those of the same OpenMPI interface in the same environment.

[0108] P104: Eight processes are used to send and receive data ranging from a minimum of 8 bytes to a maximum of 128 MBytes. The eight processes are located on the same server to test the transmission latency of the Allgather interface All_gather in a single-machine environment and compare it with the test results of the same OpenMPI interface in the same environment.

[0109] P105: Eight processes send and receive data ranging from a minimum of 8 bytes to a maximum of 128 MBytes and perform summation calculations. The eight processes are located on the same server to test the transmission and calculation latency of the Allreduce interface All_reduce in a single-machine environment, and compare the test results with those of the same OpenMPI interface in the same environment.

[0110] P106: Eight processes send and receive data ranging from a minimum of 8 bytes to a maximum of 128 MBytes and perform summation calculations. The eight processes are located on the same server to test the transmission and calculation latency of the Reduce_scatter interface in a single-machine environment, and compare the test results with those of the same OpenMPI interface in the same environment.

[0111] The performance test results for P1 are basically consistent with those for OpenMPI, as shown in the following figures. Figure 5 As shown.

[0112] (2) Performance Test P2

[0113] The test content described in performance test P2 mainly includes:

[0114] P201: Two processes are used to send and receive data ranging from a minimum of 8 bytes to a maximum of 128 MBytes. The two processes are located on different servers, which are connected via an Infiniband network. This test examines the transmission latency of the point-to-point interfaces Send and Recv in a network environment and compares the results with those of the same OpenMPI interface in the same environment.

[0115] P202: Using eight processes, one process acts as the root process to send data ranging from a minimum of 8 bytes to a maximum of 128 MBytes to the other seven processes. The other seven processes receive the data. Four of the eight processes are on the same server, and the other four processes are on another server. The servers are connected via an Infiniband network to test the transmission latency of the broadcast interface Bcast in a network environment and compare the test results with those of the same OpenMPI interface in the same environment.

[0116] P203: Eight processes are used to send and receive data ranging from a minimum of 8 bytes to a maximum of 128 MBytes. Four of the eight processes are on the same server, and the other four processes are on another server. The servers are connected via an Infiniband network to test the transmission latency of the Alltoall interface in a network environment and compare it with the test results of the same OpenMPI interface in the same environment.

[0117] P204: Eight processes are used to send and receive data ranging from a minimum of 8 bytes to a maximum of 128 MBytes. Four of the eight processes are on the same server, and the other four processes are on another server. The servers are connected via an Infiniband network to test the transmission latency of the Allgather interface All_gather in a network environment and compare the test results with those of the same OpenMPI interface in the same environment.

[0118] P205: Eight processes are used to send and receive data ranging from a minimum of 8 bytes to a maximum of 128 MBytes and perform summation calculations. Four of the eight processes are on the same server, and the other four processes are on another server. The servers are connected via an Infiniband network to test the transmission and calculation latency of the Allreduce interface All_reduce in a network environment, and to compare the test results with those of the same OpenMPI interface in the same environment.

[0119] P206: Eight processes are used to send and receive data ranging from a minimum of 8 bytes to a maximum of 128 MBytes and perform summation calculations. Four of the eight processes are on the same server, and the other four processes are on another server. The servers are connected via an Infiniband network to test the transmission and calculation latency of the Reduce_scatter interface in a network environment, and to compare the test results with those of the same OpenMPI interface in the same environment.

[0120] The performance test results for P2 are basically consistent with those for OpenMPI, as shown in the following figures. Figure 6 As shown.

[0121] (3) Performance test P3

[0122] The performance test content described in P3 mainly includes:

[0123] P301: Using two GPUs to send and receive data ranging from a minimum of 8 bytes to a maximum of 128 MByte, with both GPUs located on the same server, to test the transmission latency of the point-to-point interfaces Send and Recv in a single-machine environment, and to compare the test results with those of the same functional interface of NCCL in the same environment.

[0124] P302: Using eight GPUs, one GPU acts as the root and sends data ranging from a minimum of 8 bytes to a maximum of 128 MBytes to the other seven GPUs. The other seven GPUs receive the data. The eight GPUs are located on the same server to test the transmission latency of the broadcast interface Bcast in a single-machine environment and compare the test results with those of the same functional interface of NCCL in the same environment.

[0125] P303: Eight GPUs are used to send and receive data ranging from a minimum of 8 bytes to a maximum of 128 MBytes. The eight GPUs are located on the same server to test the transmission latency of the Alltoall interface All_to_all in a single-machine environment, and to compare the test results with those of the same functional interface of NCCL in the same environment.

[0126] P304: Eight GPUs are used to send and receive data ranging from a minimum of 8 bytes to a maximum of 128 MBytes. The eight GPUs are located on the same server to test the transmission latency of the Allgather interface All_gather in a single-machine environment and compare it with the test results of the same functional interface of NCCL in the same environment.

[0127] P305: Eight GPUs are used to send and receive data ranging from a minimum of 8 bytes to a maximum of 128 MBytes and perform summation calculations. The eight GPUs are located on the same server to test the transmission and calculation latency of the Allreduce interface All_reduce in a single-machine environment, and to compare the test results with the NCCL interface with the same function in the same environment.

[0128] P306: Eight GPUs are used to send and receive data ranging from a minimum of 8 bytes to a maximum of 128 MBytes and perform summation calculations. The eight GPUs are located on the same server to test the transmission and calculation latency of the Reduce_scatter interface in a single-machine environment, and to compare the test results with the same functional interface of NCCL in the same environment.

[0129] The performance test results for P3 are basically consistent with those for NCCL. The test results are as follows: Figure 7 As shown.

[0130] (4) Performance Test P4

[0131] The performance test described in P4 mainly includes:

[0132] P401: This test utilizes two GPUs to send and receive data ranging from a minimum of 8 bytes to a maximum of 128 MBytes. The two GPUs are located on different servers, which are connected via an Infiniband network. The test aims to evaluate the transmission latency of the point-to-point interfaces Send and Recv in a network environment and compare the results with those of the same functional interface in the NCCL under the same conditions.

[0133] P402: Using eight GPUs, one GPU acts as the root and sends data ranging from a minimum of 8 bytes to a maximum of 128 MBytes to the other seven GPUs. The other seven GPUs receive the data. Four of the eight GPUs are on the same server, and the other four are on another server. The servers are connected via an Infiniband network to test the transmission latency of the broadcast interface Bcast in a network environment and compare the test results with those of the same functional interface of NCCL in the same environment.

[0134] P403: This test utilizes eight GPUs to send and receive data ranging from a minimum of 8 bytes to a maximum of 128 MBytes. Four GPUs are located on the same server, while the other four are on another server. The servers are connected via an Infiniband network to test the transmission latency of the Alltoall interface in a network environment and compare it with the test results of the same functional interface of NCCL in the same environment.

[0135] P404: This test utilizes eight GPUs to send and receive data ranging from a minimum of 8 bytes to a maximum of 128 MBytes. Four GPUs are located on the same server, while the other four are on another server. The servers are connected via an Infiniband network to test the transmission latency of the Allgather interface (All_gather) under network conditions and compare the results with those of the same functional interface in the NCCL under the same environment.

[0136] P405: This test utilizes eight GPUs to send and receive data ranging from a minimum of 8 bytes to a maximum of 128 MBytes and perform summation calculations. Four GPUs are located on the same server, while the other four are located on another server. The servers are connected via an Infiniband network to test the transmission and computation latency of the Allreduce interface All_reduce in a network environment and compare the results with those of the same functional interface of NCCL under the same environment.

[0137] P406: Eight GPUs are used to send and receive data ranging from a minimum of 8 bytes to a maximum of 128 MBytes and perform summation calculations. Four GPUs are on the same server, and the other four GPUs are on another server. The servers are connected via an Infiniband network to test the transmission and calculation latency of the Reduce_scatter interface in a network environment and compare the results with the test results of the same functional interface of NCCL in the same environment.

[0138] The performance test results for P4 are basically consistent with those for NCCL, as shown in the following figures. Figure 8 As shown.

[0139] In summary, the method used in this system supports multiple hardware platforms without negatively impacting the performance of OpenMPI and NCCL, thus preserving the performance of these two communication libraries.

[0140] This system was also tested for brain simulation applications and compared with OpenMPI.

[0141] The test content includes:

[0142] Application Test A1: Simulate 1 second of biological time using a CPU-based microcircuit model.

[0143] The test results for application test A1 are basically consistent with those for OpenMPI, as shown in the test results below. Figure 9 As shown.

[0144] Please note that the technical features of the above embodiments can be combined arbitrarily. For the sake of brevity, not all possible combinations of the technical features in the above embodiments have been described. However, as long as the combination of these technical features does not contradict each other, it should be considered within the scope of this specification. The above embodiments only illustrate several implementation methods of this application, and their descriptions are relatively specific and detailed, but they should not be construed as limiting the scope of the invention patent. It should be pointed out that those skilled in the art can make several modifications and improvements without departing from the concept of this application, and these all fall within the protection scope of this application. Therefore, the protection scope of this patent application should be determined by the appended claims.

Claims

1. A fusion system for a large-scale brain simulation communication library, used for large-scale brain simulation on different hardware platforms; characterized in that, The system comprises: a unified application interface layer, a hardware adaptation layer, a backend layer, and a hardware layer; among which, The unified application interface layer defines a unified application interface for users. In this process, the user transmits the address of the buffer to be communicated and the data size information to the specific communication backend by calling the unified application interface layer. The hardware adaptation layer manages data by establishing a unified communication sub-layer, which is implemented in the kernel layer to uniformly manage communication resources. The hardware adaptation layer includes: a backend initialization and release unit, a globally unique ID identification and device relationship mapping unit, a communication context management unit, and a data type conversion unit; among which, The backend initialization and release unit completes the selection and initialization of the communication backend based on the selected backend. The globally unique ID identifier and device relationship mapping unit is used to map one globally unique ID identifier to one device, and to establish a mapping relationship between processes, globally unique ID identifiers and devices in the case of a single process with multiple devices. The communication context management unit is used to store the communication resources required by different backends by defining a unified communication sub-data structure. In this process, the user obtains the communication entity number interface Get_comm_rank through the information reading interface of the unified application interface layer, and passes the communication entity number interface Get_comm_rank into the communication sub-information to obtain a globally unique ID identifier, so as to specify the device corresponding to the globally unique ID identifier to complete the specific calculation or communication task. The data type conversion unit is used to convert and map communication data types and communication data operators used by different backends by defining a unified communication data type data structure and a unified communication data operator data structure. The backend layer encapsulates the communication interfaces of communication backends based on different hardware platforms, and implements specific communication functions. The hardware layer includes hardware and its drivers, as well as software development kits.

2. The fusion system of the large-scale brain simulation communication library as described in claim 1, characterized in that, The encapsulation of the backend layer includes: defining a backend data structure that includes initialization, resource release, communication primitives, and synchronization functions; Based on the defined backend data structure, create a backend data structure array to store communication backend information for different platforms; encapsulate the initialization, resource release, communication primitives, and synchronization functions of the communication backend for a certain platform, assign the encapsulated functions to backend variables, and store them in the defined backend data structure array; The defined backend data structure array is initialized and released by the backend initialization and release unit of the hardware adaptation layer, and provided to the unified application interface layer.

3. A method for fusing large-scale brain simulation communication libraries for large-scale brain simulation on different hardware platforms; characterized in that, The method includes: Step S1: Abstract interface functions, design a unified application interface, unified data type and data operator; The unified application interface layer includes: initialization and resource release interfaces, information reading interfaces, communication primitive interfaces, and communication synchronization interfaces; among them, The initialization and resource release interfaces include: the Init interface for initializing the communication environment and the Finalize interface for releasing resources; The information initialized through the Initialize Communication Environment Interface Init is stored in the communication sub data structure, and the communication resources of the corresponding hardware are released through the operation of the communication sub in the resource release interface. The information reading interfaces include: Get_comm_rank (for obtaining the communication entity number), Get_comm_size (for obtaining the number of communication entities), and Get_device_id (for obtaining the device number). The communication primitive interface includes: point-to-point communication primitives and set communication primitives; it supports common data types and common data operations; The communication synchronization interface is used to synchronize communication after calling the asynchronous interface; Step S2: Data management is achieved by establishing a unified communication sub-sub ... The kernel layer of step S2 includes a unified communication sub, whose data type is nhcclComm_t. It stores the communication backend type, the globally unique ID of the communication entity and the device ID, as well as the communication resources required by the specific communication backend. Through the backend type of the unified communication sub, the corresponding backend interface is called to realize the function of the unified application interface. Step S3: Abstract the commonalities among multiple actual backends, design a unified backend data structure, and populate the relevant data structure with data when using specific devices; Step S4: Map the data types and data operators in the backend of each platform; Step S5: Encapsulate the interfaces in the backend of each platform that have the same function as the designed application interface.

4. The fusion method for a large-scale brain simulation communication library as described in claim 3, characterized in that, The unified application interface (API), unified data type, and data operators in step S1 are as follows: The unified interface includes: Initialize communication environment interface Init, Finalize resource release interface Finalize, Get_comm_rank interface for obtaining communication entity number, Get_comm_size interface for obtaining communication entity quantity, Get_device_id interface for obtaining device number, Send interface for point-to-point transmission, Recv interface for point-to-point reception, Bcast interface for broadcasting, Alltoall interface All_to_all interface for all transmission, Allgather interface All_gather interface for all collection, Allreduce interface All_reduce interface for all reduction, Reducescatter interface Reduce_scatter interface Reduce_scatter interface Reduce_scatter and Synchronize interface. The unified data type is specifically the character type char; it includes integer and floating-point types. Unified data operators include: sum, prod, max, min, and avg.

5. The fusion method for a large-scale brain simulation communication library as described in claim 3, characterized in that, The unified backend data structure in step S3 includes declarations of different backends and declarations of common interfaces.

6. The fusion method for a large-scale brain simulation communication library as described in claim 3, characterized in that, The mapping in step S4 includes: S401: Mapping data types for different backends; S402: Mapping data operators for different backends.

7. The method for fusing a large-scale brain simulation communication library as described in any one of claims 3-6, characterized in that, The encapsulation in step S5 includes: passing the buffer address, message size, and unified communication sub-interface of the defined unified interface to the interface of the actual communication backend, and converting the passed data type and data operator before passing them to the interface of the actual communication backend.

Citation Information

Patent Citations

  • Communication framework, service event processing method and device

    CN113542315A