Fusion system and fusion method of large-scale brain simulation communication library
By designing a fusion system of large-scale brain simulation communication library, the problems of efficient communication and application migration between different hardware platforms are solved, and efficient and compatible brain simulation application deployment is achieved.
Patent Information
- Application Number
- CN202311109157.3
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2023-08-30
- Publication Date
- 2025-02-28
- Estimated Expiration
- 2043-08-30
AI Technical Summary
During the process of large-scale brain simulation, it is difficult for the existing technology to achieve efficient communication and application migration between different hardware platforms, resulting in high migration costs and low efficiency.
A converged system for large-scale brain simulation communication library is designed, including a unified application interface layer, hardware adaptation layer, back-end layer and hardware layer. Through the unified interface and hardware adaptation layer, communication unification of different hardware platforms is achieved, reducing the difficulty of application migration.
The system simplifies user programming, improves application compatibility and portability, supports large-scale brain simulation of different hardware platforms, and achieves efficient operation.
Smart Images

Figure CN119537046A_ABST
Abstract
Description
Technical Field
[0001] The present invention belongs to the technical field of large-scale brain simulation, and in particular to large-scale brain simulation fusion of different hardware platforms. Background Art
[0002] When performing large-scale brain simulation, developers usually divide the huge neural network into different computing chips, and use multiple chips to perform calculations together to complete large-scale simulations. Therefore, in the process of large-scale brain simulation, it is necessary to use collective communication libraries to synchronize the calculation results of multiple computing chips. Common communication libraries include Open MPI (Open Message Passing Interface), MPICH, MVAPICH, etc. based on the message passing interface standard (MPI) 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, allowing developers to perform parallel computing in distributed memory systems. The NVIDIA Collective Communications Library (NCCL) used in NVIDIA GPU platform simulation is a parallel communication library developed by NVIDIA for high-performance GPU acceleration clusters. NCCL is mainly used to achieve efficient data transmission and communication operations between GPUs, and supports parallel computing and deep learning training on multiple GPUs.
[0003] There are certain differences in the implementation methods and interfaces of communication libraries on different hardware platforms. In addition, 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 urgently need to migrate existing brain simulation applications to chips that are more suitable for brain simulation computing characteristics. When users migrate brain simulation applications originally based on a certain platform such as CPU to another platform such as NVIDIA GPU, they need to completely modify the interface of the communication library originally used, such as OpenMPI, to the interface of another platform's communication library such as NCCL. Due to the certain gap between the interface design of OpenMPI and NCCL, a large amount of source code needs to be modified. Because the source code of brain simulation applications is relatively large and complex, the cost of application migration is extremely high. Therefore, it is necessary to develop a set of fusion communication libraries with unified interfaces that support large-scale brain simulation, reduce the difficulty of migration of brain simulation applications, and enable brain simulation applications to be quickly deployed on suitable chips to achieve efficient operation. Summary of the invention
[0004] In view of this, the present invention proposes a fusion system of large-scale brain simulation communication library for large-scale brain simulation on different hardware platforms; the system comprises: a unified application interface layer, a hardware adaptation layer, a backend layer and a hardware layer; wherein,
[0005] Unified application interface layer, defining 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 by establishing a unified communicator, realizing the kernel layer and managing communication resources in a unified manner;
[0008] The backend layer encapsulates the communication interface of the communication backend based on different hardware platforms to realize specific communication functions;
[0009] The hardware layer includes hardware and its drivers, and software development kits.
[0010] Furthermore, the unified application interface layer includes: initialization and resource release interface, information reading interface, communication primitive interface and communication synchronization interface; wherein,
[0011] The initialization and resource release interfaces include: initialization communication environment interface Init and resource release interface Finalize;
[0012] The information initialized by the initialization communication environment interface Init is stored in a communicator data structure, and the communication resources of the corresponding hardware are released by operating the communicator in the resource release interface;
[0013] The information reading interface includes: Get_comm_rank interface for obtaining the communication entity number, Get_comm_size interface for obtaining the communication entity quantity, and Get_device_id interface for obtaining the device number;
[0014] The communication primitive interface includes: point-to-point communication primitives and collective communication primitives; supports common data types and common data operations;
[0015] The communication synchronization interface is used to perform communication synchronization after calling the asynchronous interface.
[0016] Furthermore, 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; wherein,
[0017] The backend initialization and release unit completes the selection and initialization of the communication backend according to the backend selected by initialization;
[0018] A globally unique ID and device relationship mapping unit, used to correspond a globally unique ID to a device, and to establish a mapping relationship between a process and a globally unique ID as well as a device for a single process with multiple devices;
[0019] A communication context management unit, used to store communication resources required by different backends by defining a unified communication sub-data structure;
[0020] Among them, 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 to specify the device corresponding to the globally unique ID identifier to complete a specific calculation or communication task;
[0021] The data type conversion unit is used to convert and map the 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] Further, the encapsulation of the backend layer includes: defining a backend data structure including initialization, resource release, communication primitives and synchronization functions;
[0023] On the basis of the defined backend data structure, create a backend data structure array for storing communication backend information of different platforms; encapsulate the initialization, resource release, communication primitives and synchronization functions of the communication backend of a certain platform, assign the encapsulated function to the backend variable, and store it 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 is provided to the unified application interface layer.
[0025] The present invention also provides a method for integrating a large-scale brain simulation communication library, which is used for large-scale brain simulation on different hardware platforms; the method comprises:
[0026] Step S1: abstract interface functions, design unified application interfaces, unified data types and data operators;
[0027] Step S2: Data management is performed by establishing a unified communicator, realizing the kernel layer and unified management of communication resources;
[0028] Step S3: abstract the commonality of multiple actual backends, design a unified backend data structure, and fill the relevant data structure with data when using specific devices;
[0029] Step S4: Mapping 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 functions as the designed application interface.
[0031] Furthermore, the unified application interface (API), unified data type and data operator of step S1 are specifically:
[0032] The unified interfaces include: initialization communication environment interface Init, resource release interface Finalize, communication entity number acquisition interface Get_comm_rank, communication entity number acquisition interface Get_comm_size, device number acquisition interface Get_device_id, point-to-point sending interface Send, point-to-point receiving interface Recv, broadcast interface Bcast, all-toall interface All_to_all, all-gather interface All_gather, all-reduce interface All_reduce, reduce-scatter interface Reduce_scatter, and synchronization interface Synchronize;
[0033] The unified data type is specifically the character type char; including integer type and floating point type;
[0034] Unified data operators include: sum, product, max, min, and avg.
[0035] Furthermore, the kernel layer of step S2 includes a unified communicator, whose data type is nhcclComm_t, which saves the communication backend type, the globally unique ID and device ID of the communication entity, and the communication resources required by the specific communication backend. Through the backend type of the unified communicator, the corresponding backend interface is called to implement the function of the unified application interface.
[0036] Furthermore, the unified backend data structure of step S3 includes declarations of different backends and a common interface declaration.
[0037] Furthermore, the mapping of step S4 includes:
[0038] S401: Mapping data types of different backends;
[0039] S402: Map data operators of different backends.
[0040] Furthermore, the encapsulation of step S5 includes: transmitting the buffer address, message size, and unified communicator passed in by the defined unified interface to the interface of the actual communication backend, converting the passed in data type and data operator and then transmitting them to the interface of the actual communication backend.
[0041] The solution of the present invention simplifies user programming, improves the compatibility and portability of applications, and provides a unified communication interface for upper-level applications by constructing a unified aggregate communication interface library (NanhuCCL) that is independent of the specific hardware platform. It is backward compatible with different hardware platforms and can support large-scale brain simulation on different hardware platforms. BRIEF DESCRIPTION OF THE DRAWINGS
[0042] Figure 1 It is a block diagram of the composition of the fusion system of large-scale brain simulation of the present invention;
[0043] Figure 2 It is a schematic diagram of the backend layer of the fusion system of large-scale brain simulation of the present invention;
[0044] Figure 3 is a flow chart of the fusion method of large-scale brain simulation of the present invention;
[0045] Figure 4 A test network diagram of a large-scale brain simulation fusion system of the present invention;
[0046] Figure 5 This is a single machine test result diagram of the CPU platform of the present invention;
[0047] Figure 6 It is a multi-machine test result diagram of the CPU platform of the present invention;
[0048] Figure 7 This is a single machine test result diagram of the GPU platform of the present invention;
[0049] Figure 8 This is a multi-machine test result diagram of the GPU platform of the present invention;
[0050] Fig. 9 This is a diagram of the brain simulation application test results of the present invention. DETAILED DESCRIPTION
[0051] In order to make the purpose, technical solution and advantages of the embodiments of the present invention clearer, the technical solution in the embodiments of the present invention will be clearly and completely described below in conjunction with the drawings in the embodiments of the present invention. Obviously, the described embodiments are only part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by those skilled in the art without creative work are within the scope of protection of the present invention.
[0052] Figure 1 FIG. 2 shows a block diagram of the composition of the fusion system of large-scale brain simulation of the present invention. 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 following is a detailed description of each component in the system.
[0053] 1. Unified Application Interface (API) Layer
[0054] The unified application interface (API) layer defines the unified application interface (API) for users. Users can call the unified application interface (API) layer to pass the buffer address, data size and other information required for communication to the specific communication backend. The unified application interface (API) layer mainly includes: initialization and resource release interface, information reading interface, communication primitive interface, and communication synchronization interface. Among them,
[0055] The initialization and resource release interface includes: initialization communication environment interface Init, resource release interface Finalize. In the initialization interface, different backends can be selected for different hardware, such as mpi\nccl\brainlikeccl (brainlikeccl is a collection communication library for brain-like computing chips). For nccl and brainlikeccl, you can also choose a process to control a computing chip or a process to control multiple computing chips, so as to support different application scenarios. The initialization information is stored in the communication sub-data structure defined in this system, and the communication resources of the corresponding hardware are released by operating the communicator in the resource release interface.
[0056] The information reading interface includes: Get_comm_rank interface for obtaining the communication entity number, Get_comm_size interface for obtaining the number of communication entities, and Get_device_id interface for obtaining the device number, which can return corresponding information to facilitate application programming.
[0057] The communication primitive interfaces include: point-to-point communication primitives and collective communication primitives. Among them, the point-to-point communication primitives include the point-to-point sending interface Send and the point-to-point receiving interface Recv; the collective communication primitives include the broadcast interface Bcast, the all-toall interface All_to_all, the all-gather interface All_gather, the all-reduce interface All_reduce, and the reduce-scatter interface Reduce_scatter. The communication primitives used are defined according to the mainstream communication primitive functions, supporting the transmission of common data types such as characters, integers, floating-point numbers, and common data operations such as summation and product, so they can support a variety of current application scenarios such as brain simulation and deep learning.
[0058] The communication synchronization interface is the Synchronize interface, which is synchronized after calling the asynchronous interface to ensure that the communication is completed. The use of asynchronous interfaces can achieve parallel communication and computing, thereby improving the overall performance of the application.
[0059] 2. Hardware Adaptation Layer
[0060] The hardware adaptation layer is used to provide a unified device access interface, device context management interface, and establish hardware device layer information. It implements an interface layer that includes unified interface descriptions, operators, and data types, and a kernel layer that performs unified resource management. The unified interface description abstracts and encapsulates the functions of the hardware, fills the relevant data structures with data when using specific devices, and then calls the corresponding device functions based on the filled data. The hardware adaptation layer includes: a back-end initialization and release unit, a globally unique ID identification (rank) and device (device) relationship mapping unit, a communication context management unit, and a data type conversion unit. Among them,
[0061] The backend initialization and release unit completes the selection and initialization of the communication backend according to the backend selected for initialization. For example, nccl is selected as the communication backend. The hardware adaptation layer initializes the communicator customized by this system and completes the initialization of the communication environment through the initialization interface of nccl to ensure that the computing chip used can use the corresponding communication resources. After the communication is completed, the backend resources are released through the resource release interface of the communicator and the corresponding communication backend.
[0062] The mapping unit between the globally unique ID and the device supports one globally unique ID corresponding to one device, and establishes the mapping relationship between the process and the globally unique ID and the device for the case of single process and multiple devices. The globally unique ID is an entity participating in the communication, which is identified by the globally unique ID (0, 1, 2, ..., n-1). For example, in the message passing interface (MPI), a globally unique ID represents a message passing interface (MPI) process, and in NCCL, a globally unique ID represents a GPU. The device represents a PCIe device, such as a GPU or a brain-like computing chip. The device ID is usually a local number within a single node, so it is necessary to bind the global globally unique ID to the local device, and the binding information is stored in the communicator customized by this system. The user obtains the communication entity number interface Get_comm_rank obtained in the information reading interface of the unified application interface (API) layer and passes it into the communication sub-information to obtain the globally unique ID identifier (rank), and then specifies the corresponding device (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 saves the MPI communication sub-MPI_Comm, communication request MPI_Request, and communication status MPI_Status; on the GPU platform, it saves the NCCL communication sub-ncclComm_t, CUDA asynchronous stream cudaStream_t, and other information required in the communication process.
[0064] The data type conversion unit is used to implement conversion mapping between the 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 interface of the communication backend based on different hardware platforms to implement specific communication functions. The encapsulation of the backend layer mainly includes:
[0067] Figure 2 The backend layer class of the fusion system of large-scale brain simulation of the present invention is shown. Figure 2As shown, the backend layer class includes initialization, communication primitives (such as sending, receiving), synchronization, and resource release. The encapsulation of the backend layer defines a backend data structure, which includes the functions of initialization, resource release, communication primitives, and synchronization.
[0068] Based on the defined backend data structure, create a backend data structure array to store the communication backend information of different platforms.
[0069] Encapsulate the initialization, resource release, communication primitives, and synchronization functions of the communication backend of a certain platform such as CPU, such as MPI, assign the encapsulated functions to the backend variables, and store them 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 is provided to the unified API layer for specific function implementation.
[0071] 4. Hardware layer
[0072] The hardware layer, including hardware and its drivers, software development kit (SDK), etc., currently supports CPU and GPU, and is expanding support for brain-like computing chips. Other hardware can also be adapted in the same way, with good scalability.
[0073] Figure 3 The fusion method of the large-scale brain simulation communication library of the present invention is shown. Figure 3 As shown, the method comprises the following steps:
[0074] Step S1: Abstract interface functions, design unified application interface (API), unified data types and data operators.
[0075] Step S2: Data management is performed by establishing a unified communicator, realizing the kernel layer and managing communication resources in a unified manner.
[0076] Step S3: Abstract the commonality of multiple actual backends, design a unified backend data structure, and fill the relevant data structure with data when using specific devices.
[0077] Step S4: Map the data types and data operators in each platform backend.
[0078] Step S5: Encapsulate the interface in each platform backend that has the same function as the designed API.
[0079] The above steps 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: initialization communication environment interface Init, resource release interface Finalize, communication entity number acquisition interface Get_comm_rank, communication entity quantity acquisition interface Get_comm_size, device number acquisition interface Get_device_id, point-to-point sending interface Send, point-to-point receiving interface Recv, broadcast interface Bcast, all-to-all sending interface All_to_all, all-gathering interface All_gather, all-reduce interface All_reduce, reduce-scatter interface Reduce_scatter, and synchronization interface Synchronize.
[0082] 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, product, max, min, and avg.
[0084] The kernel layer of step S2 mainly includes: a unified communicator, whose data type is nhcclComm_t, which stores the communication backend type, the globally unique ID of the communication entity (rank) and the device ID, and the communication resources required by the specific communication backend, such as the communicator MPI_Comm, the communication request MPI_Request, and the communication status MPI_Status of the message passing interface (MPI); the communicator ncclComm_t of NCCL, and the CUDA asynchronous stream cudaStream_t. By unifying the backend type of the communicator, the corresponding backend interface is called to realize the function of the unified application interface.
[0085] The unified backend data structure of step S3 mainly includes: declarations of different backends and general interface declarations, which serve as a bridge between the kernel layer and the actual communication backend to achieve the process of shielding hardware details.
[0086] The mapping of step S4 mainly includes:
[0087] S401: Mapping data types of different backends, for example, mapping the integer type MPI_INT used in MPI to Int, mapping the floating point data type ncclFloat used in NCCL to Float, etc. When the user uses Int or Float, the data type actually passed into the communication backend will be the corresponding integer or floating point type.
[0088] S402: Map the data operators of different backends, for example, map the summation operator MPI_SUM used in the message passing interface (MPI) to Sum, and map the summation operator ncclSum used in NCCL to Sum, etc. When the user uses Sum, the data type actually passed into the communication backend will be the corresponding data operator.
[0089] The encapsulation of step S5 mainly includes: passing the buffer address, message size, and unified communicator passed in by the defined unified interface (API) to the interface of the actual communication backend, and converting the passed in data type and data operator and then passing them to the interface of the actual communication backend.
[0090] The following continues to describe the system testing process of the present invention.
[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 of this system
[0096]
[0097] The test network of this system is as follows Figure 4 shown.
[0098] 2. Test results
[0099] The system was tested for performance on the CPU platform and GPU platform respectively. The test contents include: Performance test P1: single machine 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 contents described in performance test P1 mainly include:
[0105] P101: Use two processes to send and receive data with a minimum of 8 Byte and a maximum of 128 MByte. The two processes are located on the same server to test the transmission delay of the point-to-point interfaces Send and Recv in a single-machine environment, and compare the test results with the same functional interface of OpenMPI in the same environment.
[0106] P102: Eight processes are used, with one process as the root process to send data with a minimum of 8 Byte and a maximum of 128 MByte to the other seven processes. The other seven processes receive the data. The eight processes are located on the same server to test the transmission delay of the broadcast interface Bcast in a single-machine environment, and compare the test results with the same functional interface of OpenMPI in the same environment.
[0107] P103: Eight processes are used to send and receive data with a minimum of 8 Byte and a maximum of 128 MByte. The eight processes are located on the same server to test the transmission delay of the All_to_all interface in a single-machine environment. The test results are compared with the test results of the same functional interface of OpenMPI in the same environment.
[0108] P104: Eight processes are used to send and receive data with a minimum of 8 Byte and a maximum of 128 MByte. The eight processes are located on the same server to test the transmission delay of the Allgather interface All_gather in a single-machine environment, and the test results are compared with the test results of the same functional interface of OpenMPI in the same environment.
[0109] P105: Eight processes are used to send and receive data with a minimum of 8 Byte and a maximum of 128 MByte to each other, and perform sum calculations. The eight processes are located on the same server to test the transmission and calculation delays of the Allreduce interface All_reduce in a single-machine environment, and compare the test results with the same functional interface of OpenMPI in the same environment.
[0110] P106: Eight processes are used to send and receive data with a minimum of 8 Byte and a maximum of 128 MByte to each other, and perform sum calculations. The eight processes are located on the same server to test the transmission and calculation delay of the Reducescatter interface Reduce_scatter in a single-machine environment, and compare the test results with the same functional interface of OpenMPI in the same environment.
[0111] The test results of performance test P1 are basically consistent with those of OpenMPI. Figure 5 shown.
[0112] (2) Performance Test P2
[0113] The test contents described in performance test P2 mainly include:
[0114] P201: Use two processes to send and receive data with a minimum of 8 Byte and a maximum of 128 MByte. The two processes are located on different servers and the servers are connected through an Infiniband network to test the transmission delay of the point-to-point interface Send and Recv in the network environment, and compare the test results with the same functional interface of OpenMPI in the same environment.
[0115] P202: Eight processes are used, with one process as the root process sending data with a minimum of 8 Byte and a maximum of 128 MByte 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 through an Infiniband network to test the transmission delay of the broadcast interface Bcast in a network environment, and compare it with the test results of the same functional interface of OpenMPI in the same environment.
[0116] P203: Eight processes are used to send and receive data with a minimum of 8 Byte and a maximum of 128 MByte. Four of the eight processes are on the same server, and the other four processes are on another server. The servers are connected through an Infiniband network to test the transmission delay of the All_to_all interface in the network environment, and compare the test results with the same functional interface of OpenMPI in the same environment.
[0117] P204: Eight processes are used to send and receive data with a minimum of 8 Byte and a maximum of 128 MByte. Four of the eight processes are on the same server, and the other four processes are on another server. The servers are connected through an Infiniband network to test the transmission delay of the Allgather interface All_gather in the network environment, and compare the test results with the same functional interface of OpenMPI in the same environment.
[0118] P205: Eight processes are used to send and receive data with a minimum of 8 Byte and a maximum of 128 MByte to each other, and perform sum calculations. Four of the eight processes are on the same server, and the other four processes are on another server. The servers are connected through an Infiniband network to test the transmission and calculation delay of the All_reduce interface in the network environment, and compare the test results with the same functional interface of OpenMPI in the same environment.
[0119] P206: Eight processes are used to send and receive data with a minimum of 8 Byte and a maximum of 128 MByte to each other, and perform sum calculations. Four of the eight processes are on the same server, and the other four processes are on another server. The servers are connected through an Infiniband network to test the transmission and calculation delay of the Reducescatter interface Reduce_scatter in a network environment, and compare the test results with the same functional interface of OpenMPI in the same environment.
[0120] The test results of performance test P2 are basically consistent with those of OpenMPI. Figure 6 shown.
[0121] (3) Performance Test P3
[0122] The test contents described in performance test P3 mainly include:
[0123] P301: Use two GPUs to send and receive data with a minimum of 8 Byte and a maximum of 128 MByte. The two GPUs are located in the same server to test the transmission delay of the point-to-point interfaces Send and Recv in a single-machine environment, and compare the test results with the test results of the same functional interface of NCCL in the same environment.
[0124] P302: Eight GPUs are used, with one GPU as the root to send data with a minimum of 8 Byte and a maximum of 128 MByte to the other seven GPUs, and the other seven GPUs receive the data. The eight GPUs are located in the same server to test the transmission delay of the broadcast interface Bcast in a single-machine environment, and compare the test results with the same functional interface of NCCL in the same environment.
[0125] P303: Eight GPUs are used to send and receive data with a minimum of 8 Byte and a maximum of 128 MByte. The eight GPUs are located in the same server to test the transmission delay of the All_to_all interface in a single-machine environment, and the test results are compared with the test results of the same functional interface of NCCL in the same environment.
[0126] P304: Eight GPUs are used to send and receive data with a minimum of 8 Byte and a maximum of 128 MByte. The eight GPUs are located in the same server to test the transmission delay of the Allgather interface All_gather in a single-machine environment, and the test results are compared 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 with a minimum of 8 Byte and a maximum of 128 MByte to each other and perform sum calculations. The eight GPUs are located in the same server to test the transmission and calculation delay of the Allreduce interface All_reduce in a single-machine environment, and compare the test results with the same functional interface of NCCL in the same environment.
[0128] P306: Eight GPUs are used to send and receive data with a minimum of 8 Byte and a maximum of 128 MByte to each other and perform sum calculations. The eight GPUs are located on the same server to test the transmission and calculation delay of the Reducescatter interface Reduce_scatter in a single-machine environment, and compare the test results with the same functional interface of NCCL in the same environment.
[0129] The test results of performance test P3 are basically consistent with those of NCCL. Figure 7 shown.
[0130] (4) Performance test P4
[0131] The test contents described in performance test P4 mainly include:
[0132] P401: Use two GPUs to send and receive data with a minimum of 8 Byte and a maximum of 128 MByte. The two GPUs are located in different servers connected by an Infiniband network to test the transmission delay of the point-to-point interface Send and Recv in a network environment, and compare the test results with the same functional interface of NCCL in the same environment.
[0133] P402: Eight GPUs are used, with one GPU as the root to send data with a minimum of 8 Byte and a maximum of 128 MByte to the other seven GPUs, and the other seven GPUs receive the data. Four of the eight GPUs are in the same server, and the other four GPUs are in another server. The servers are connected through the Infiniband network to test the transmission delay of the broadcast interface Bcast in the network environment, and compare it with the test results of the same functional interface of NCCL in the same environment.
[0134] P403: Eight GPUs are used to send and receive data with a minimum of 8 Byte and a maximum of 128 MByte. Four of the eight GPUs are in the same server, and the other four GPUs are in another server. The servers are connected through an Infiniband network to test the transmission delay of the All_to_all interface in the network environment. The test results are compared with the test results of the same functional interface of NCCL in the same environment.
[0135] P404: Eight GPUs are used to send and receive data with a minimum of 8 Byte and a maximum of 128 MByte. Four of the eight GPUs are in the same server, and the other four GPUs are in another server. The servers are connected through an Infiniband network to test the transmission delay of the Allgather interface All_gather in the network environment, and compare the test results with the same functional interface of NCCL in the same environment.
[0136] P405: Eight GPUs are used to send and receive data with a minimum of 8 Byte and a maximum of 128 MByte to each other and perform sum calculations. Four of the eight GPUs are in the same server, and the other four GPUs are in another server. The servers are connected through an Infiniband network to test the transmission and calculation delay of the All_reduce interface in the network environment, and compare the test results with the same functional interface of NCCL in the same environment.
[0137] P406: Eight GPUs are used to send and receive data with a minimum of 8 Byte and a maximum of 128 MByte to each other and perform sum calculations. Four of the eight GPUs are in the same server, and the other four GPUs are in another server. The servers are connected through an Infiniband network to test the transmission and calculation delay of the Reducescatter interface Reduce_scatter in the network environment, and compare the test results with the same functional interface of NCCL in the same environment.
[0138] The test results of performance test P4 are basically consistent with those of NCCL. Figure 8 shown.
[0139] In summary, the method used in this system does not have a negative impact on the performance of OpenMPI and NCCL while supporting multiple hardware platforms, and still maintains the performance of these two communication libraries.
[0140] This system also tests brain simulation applications and conducts comparative tests with OpenMPI.
[0141] The test content includes:
[0142] Application Test A1: Use CPU to simulate microcircuit model for 1 second biological time.
[0143] The test results of application test A1 are basically consistent with those of OpenMPI. Fig. 9 shown.
[0144] Please note that the technical features of the above embodiments can be combined arbitrarily. In order to make the description concise, all possible combinations of the technical features in the above embodiments are not described. However, as long as there is no contradiction in the combination of these technical features, they should be considered to be within the scope of this specification. The above embodiments only express several implementation methods of the present application, and their descriptions are relatively specific and detailed, but they cannot be understood as limiting the scope of the invention patent. It should be pointed out that for those skilled in the art, without departing from the concept of the present application, several variations and improvements can be made, which all belong to the scope of protection of the present application. Therefore, the scope of protection of the patent in this application shall be based on the attached claims.
Claims
1. A fusion system of large-scale brain simulation communication libraries, used for large-scale brain simulation on different hardware platforms; characterized in that: The system includes: a unified application interface layer, a hardware adaptation layer, a backend layer and a hardware layer; wherein, Unified application interface layer, defining a unified application interface for users; 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; The hardware adaptation layer manages data by establishing a unified communicator, realizing the kernel layer and managing communication resources in a unified manner; The backend layer encapsulates the communication interface of the communication backend based on different hardware platforms to realize specific communication functions; The hardware layer includes hardware and its drivers, and software development kits.
2. The fusion system of large-scale brain simulation communication library as claimed in claim 1, characterized in that: The unified application interface layer includes: initialization and resource release interface, information reading interface, communication primitive interface and communication synchronization interface; among them, The initialization and resource release interfaces include: initialization communication environment interface Init and resource release interface Finalize; The information initialized by the initialization communication environment interface Init is stored in a communicator data structure, and the communication resources of the corresponding hardware are released by operating the communicator in the resource release interface; The information reading interface includes: Get_comm_rank interface for obtaining the communication entity number, Get_comm_size interface for obtaining the communication entity quantity, and Get_device_id interface for obtaining the device number; The communication primitive interface includes: point-to-point communication primitives and collective communication primitives; supports common data types and common data operations; The communication synchronization interface is used to perform communication synchronization after calling the asynchronous interface.
3. The fusion system of large-scale brain simulation communication library as claimed in claim 1, characterized in that: 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; wherein, The backend initialization and release unit completes the selection and initialization of the communication backend according to the backend selected by initialization; A globally unique ID and device relationship mapping unit, used to correspond a globally unique ID to a device, and to establish a mapping relationship between a process and a globally unique ID as well as a device for a single process with multiple devices; A communication context management unit, used to store communication resources required by different backends by defining a unified communication sub-data structure; Among them, 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 to specify the device corresponding to the globally unique ID identifier to complete a specific calculation or communication task; The data type conversion unit is used to convert and map the 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.
4. The fusion system of the large-scale brain simulation communication library according to any one of claims 1 to 3, characterized in that: The encapsulation of the backend layer includes: defining a backend data structure including initialization, resource release, communication primitives and synchronization functions; On the basis of the defined backend data structure, create a backend data structure array for storing communication backend information of different platforms; encapsulate the initialization, resource release, communication primitives and synchronization functions of the communication backend of a certain platform, assign the encapsulated function to the backend variable, and store it 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 is provided to the unified application interface layer.
5. A method for integrating 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 unified application interfaces, unified data types and data operators; Step S2: Data management is performed by establishing a unified communicator, realizing the kernel layer and unified management of communication resources; Step S3: abstract the commonality of multiple actual backends, design a unified backend data structure, and fill the relevant data structure with data when using specific devices; Step S4: Mapping 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 functions as the designed application interface.
6. A method for integrating a large-scale brain simulation communication library as claimed in claim 5, characterized in that: The unified application interface (API), unified data type and data operator of step S1 are specifically: The unified interfaces include: initialization communication environment interface Init, resource release interface Finalize, communication entity number acquisition interface Get_comm_rank, communication entity number acquisition interface Get_comm_size, device number acquisition interface Get_device_id, point-to-point sending interface Send, point-to-point receiving interface Recv, broadcast interface Bcast, all-toall interface All_to_all, all-gather interface All_gather, all-reduce interface All_reduce, reduce-scatter interface Reduce_scatter, and synchronization interface Synchronize; The unified data type is specifically the character type char; including integer type and floating point type; Unified data operators include: sum, product, max, min, and avg.
7. A method for integrating a large-scale brain simulation communication library as claimed in claim 5, characterized in that: The kernel layer of step S2 includes a unified communicator, whose data type is nhcclComm_t, which saves the communication backend type, the globally unique ID and device ID of the communication entity, and the communication resources required by the specific communication backend. Through the backend type of the unified communicator, the corresponding backend interface is called to implement the function of the unified application interface.
8. A method for integrating a large-scale brain simulation communication library as claimed in claim 5, characterized in that: The unified backend data structure of step S3 includes declarations of different backends and a common interface declaration.
9. A method for integrating a large-scale brain simulation communication library as claimed in claim 5, characterized in that: The mapping of step S4 includes: S401: Mapping data types of different backends; S402: Map data operators of different backends.
10. A method for integrating a large-scale brain simulation communication library as claimed in any one of claims 5 to 9, characterized in that: The encapsulation of step S5 includes: transmitting the buffer address, message size, and unified communicator passed in by the defined unified interface to the interface of the actual communication backend, converting the passed in data type and data operator and then transmitting them to the interface of the actual communication backend.
Citation Information
Patent Citations
Communication framework, service event processing method and device
CN113542315A