Hardware platform and method for constructing brain simulation network and storage medium

By virtually creating neurons and synapses and optimizing communication rules and resource allocation, the problem of large resource consumption and long time consumption in existing brain simulation platforms is solved, enabling rapid construction and efficient simulation, and generating portable network snapshot files.

CN116341604BActive Publication Date: 2026-02-06CHINA NANHU ACAD OF ELECTRONICS & INFORMATION TECH
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202310229310.X
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2023-03-06
Publication Date
2026-02-06
Estimated Expiration
2043-03-06

AI Technical Summary

Technical Problem

Existing brain simulation platforms consume excessive memory and take a long time to construct large-scale neuronal and synaptic networks. They cannot quickly generate network snapshot files and cannot reallocate and create them on each machine node, resulting in slow simulation speed and insufficient resource utilization.

Method used

By virtually creating neurons and synapses, generating network snapshot files using a resource scheduling layer, and optimizing inter-process communication rules to reduce communication volume, rapid construction and resource allocation are achieved.

Benefits of technology

It enables the rapid construction of brain simulation networks, reduces communication volume, speeds up simulation, and can quickly generate portable network snapshot files, thus improving the utilization efficiency of computing resources.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN116341604B_ABST
    Figure CN116341604B_ABST
Patent Text Reader

Abstract

The application discloses a hardware platform and a method for constructing a brain simulation network. The method for constructing the brain simulation network is suitable for a hardware platform storing a first communication rule, and comprises the following steps: initializing the hardware platform; virtually creating a brain simulation network of the hardware platform, wherein the brain simulation network comprises neuron clusters and synapses; and assigning processes to the neuron clusters according to the first communication rule, and actually creating the brain simulation network by using the processes. The application can improve the creation speed of the brain simulation network, reduce the communication volume, accelerate the simulation speed, and quickly obtain network snapshot information.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the field of simulation technology, and in particular to a hardware platform and a method and storage medium for constructing brain simulation networks. Background Technology

[0002] Brain simulation involves using computers to model the brain's microscopic units (neurons, synapses, ion channels, etc.) to construct complex neural network systems, simulating the functions and processes of neural signals from generation to transmission to motor behavior. The idea of ​​building machines that approach or even surpass human intelligence by mimicking the human brain is a fundamental human aspiration. However, simulating large-scale neurons requires significant resources, making the efficient and rational use of computing resources crucial when constructing brain simulation networks.

[0003] Currently, the main brain simulation platforms include the NEURON platform, GENESIS platform, NEST platform, and NiMiBrainCloud platform. The NEST platform, which supports large-scale brain simulation, is based on a parallel computing architecture using a CPU (central processing unit) supercomputing system, such as... Figure 1 As shown, neurons and synapses are actually created at the interface layer, while the hardware platform actually creates them at the hardware kernel layer. The proposed approach is to distribute neurons within a neuron cluster evenly across processes during creation, aiming for balanced resource utilization. However, as the scale of brain simulation tasks continues to expand on the NEST platform, the excessive memory consumption of neurons and synapses leads to prolonged simulation times. Furthermore, it's impossible to reallocate the number of neurons created on each machine node during the actual creation of the brain simulation network. Additionally, generating network snapshot files requires waiting for the actual construction of the brain simulation network, making the generation of network snapshot files difficult.

[0004] Therefore, how to quickly construct a brain simulation network and make full and rational use of computing resources is the problem that this invention aims to solve. Summary of the Invention

[0005] The purpose of this invention is to provide a hardware platform and a method for constructing a brain simulation network. On the one hand, it can quickly build a virtual network. After the virtual network is built, the entire network information can be obtained, and resource allocation algorithms can be used to allocate resources to the entire network, ultimately reducing communication volume and speeding up simulation. On the other hand, it can quickly obtain snapshot information of large-scale networks without waiting for the actual network to be built. The generated network snapshot files can be used to load the network model again and can also be applied to different platforms, showing strong portability. It effectively achieves the beneficial effects of quickly building brain simulation networks and making full and rational use of computing resources.

[0006] According to an aspect of the present application, at least one embodiment provides a method for constructing a brain simulation network, applicable to a hardware platform for storing a first communication rule, comprising: initializing the hardware platform; virtually creating a brain simulation network of the hardware platform, wherein the brain simulation network comprises neuron clusters and synapses; and assigning processes to the neuron clusters according to the first communication rule, and actually creating the brain simulation network by using the processes.

[0007] According to another aspect of the present application, at least one embodiment further provides a hardware platform, comprising: a processor adapted to implement instructions; and a memory adapted to store a plurality of instructions, the instructions being adapted to be loaded by the processor and execute the above-mentioned method for constructing a brain simulation network.

[0008] According to another aspect of the present application, at least one embodiment further provides a brain simulation system, comprising: the above-mentioned hardware platform of the present application.

[0009] According to another aspect of the present application, at least one embodiment further provides a computer readable nonvolatile storage medium storing computer program instructions, when the computer executes the program instructions, the above-mentioned method for constructing a brain simulation network of the present application is executed.

[0010] Through the above-mentioned embodiments of the present application, when the neurons and synapses are virtually created, a large amount of memory or video memory is not actually occupied, the creation is relatively rapid, the creation time is relatively stable, and will not increase with the increase of the network size; after the brain simulation network is constructed, reasonable resource allocation is performed on the entire network, each process actually creates a specified neuron cluster, so as to achieve the beneficial effects of reducing the communication volume and accelerating the simulation speed; the network snapshot information can be quickly obtained without waiting for the actual brain simulation network to be constructed, and the network snapshot information can be used for network recovery. BRIEF DESCRIPTION OF DRAWINGS

[0011] In order to more clearly illustrate the specific embodiments of the present application or the technical solutions in the prior art, the drawings needed in the following specific embodiments or prior art description will be briefly introduced. Obviously, the drawings in the following description are some embodiments of the present application, and those skilled in the art can also obtain other drawings according to these drawings without creative labor.

[0012] Figure 1 is a schematic diagram of a NEST platform architecture in the prior art;

[0013] Figure 2 is a schematic diagram of a brain simulation system according to an embodiment of the present application;

[0014] Figure 3 is a schematic diagram of a hardware platform according to an embodiment of the present application;

[0015] Figure 4 is a flow chart of a method for constructing a brain simulation network according to an embodiment of the present application;

[0016] Figure 5 is a schematic diagram of a brain simulation system architecture according to an embodiment of the present application. DETAILED DESCRIPTION

[0017] The technical solutions of the present application will be described clearly and completely below with reference to the drawings. Obviously, the described embodiments are part of the embodiments of the present application, rather than all the embodiments. Based on the embodiments in the present application, all other embodiments obtained by those skilled in the art without creative work fall within the scope of the present application.

[0018] It should be noted that the terms "first", "second", and the like in the specification and claims of the present application and the above-described drawings are used to distinguish similar objects, and do not necessarily indicate a specific order or a chronological sequence. It should be understood that the data thus used can be interchanged under appropriate circumstances, so that the embodiments of the present application described herein can be implemented in an order other than that illustrated or described herein. In addition, the terms "include" and "have" and any variations thereof are intended to cover non-exclusive inclusion, for example, a process, method, system, product, or device that includes a series of steps or units does not necessarily have to be limited to those steps or units clearly listed, but can include other steps or units that are not clearly listed or inherent to these processes, methods, products, or devices.

[0019] For a long time, research on the brain has mainly relied on experimental methods, and the brain tissue is observed on different spatiotemporal scales. In recent years, brain-inspired artificial intelligence (BI-AI) technology represented by deep learning has rapidly developed in application fields, but the development bottleneck has also been highlighted. How to develop artificial intelligence with more brain or brain-like functions (also known as general artificial intelligence, or brain-like intelligence, or strong intelligence, or Brain-Like AI) has become the core problem of the next generation of artificial intelligence technology, and computational neuroscience is becoming an important cornerstone for solving this core problem. In view of any theory and guess of the working principle of the brain, it can only be recognized through the computational neuroscience experimental platform-brain simulation platform, so it is urgent to strengthen the research on the brain simulation platform.

[0020] In the process of studying the brain simulation platform, it is found that when the brain simulation platform supports a large-scale brain simulation network, due to a large number of neuron clusters and a large number of synapses, a large amount of memory and time is consumed in actual creation of the hardware platform, so that the generation of network snapshot information needs to wait for a long time; and once actually created, resource adjustment cannot be performed again to adapt to the optimal communication rule; due to the large network, it is difficult to temporarily store the network, and the network and multi-platform transplantation cannot be loaded again.

[0021] For example, after the NEST platform receives an instruction to create a neuron cluster, the neurons are evenly distributed to multiple processes to create, which has a disadvantage that the communication between the neurons in the neuron cluster will cross multiple processes, and since the intra-process communication is much faster than the cross-process communication, the more the cross-process communication times, the greater the communication cost, and the more time-consuming. At the same time, the communication between clusters is the same, and if two closely connected neuron clusters are allocated to the same process, the communication amount will be greatly reduced, but in the NEST framework, each neuron cluster is distributed in each process, and it is impossible to place two neuron clusters in the same process, which will increase the communication amount and slow down the simulation speed. In the NEST platform, if the network is to be temporarily stored, the network needs to be actually built, and in a large-scale scenario, a large amount of resources are consumed and a long time is consumed to build the network, so that it is difficult to temporarily store the network, and the entire network is huge, and the storage will consume a large amount of resources and time. Therefore, how to quickly build a brain simulation network and fully and reasonably utilize the computing resources needs to be solved urgently.

[0022] Based on this, the present application provides a brain simulation system, which virtually creates neurons and synapses, can quickly create a brain simulation network, and occupies very few physical resources; after the virtual construction of the brain simulation network is completed and the global network information is obtained, resource allocation is performed on the entire network, and the purpose of minimizing the global communication amount between neuron clusters and accelerating the simulation speed is finally achieved; a format for virtually creating a brain simulation network in memory is defined; a file format for temporarily storing a brain simulation network is defined; network snapshot information of a large-scale network can be quickly generated, the generation time is fast, and will not increase with the increase of the network size, the network snapshot information can be applied to different hardware platforms; the network can be restored by loading the network snapshot information. Optionally, the brain simulation system can include an environment as shown in Figure 2 The hardware environment includes a hardware platform 100 and a server 200, and the hardware platform 100 can operate the server 200 through corresponding instructions, so as to read, change, add data, etc.

[0023] The hardware platform 100 can be one or more, and can include a plurality of processing nodes which can be regarded as a whole externally. Optionally, the hardware platform 100 can send the acquired data to the server 200 to enable the server 200 to execute the method for constructing a brain simulation network according to the present application. Optionally, the hardware platform 100 can be connected to the server 200 through a network. The network includes a wired network and a wireless network. The wireless network includes, but is not limited to, a wide area network, a metropolitan area network, a local area network or a mobile data network. Typically, the mobile data network includes, but is not limited to, a global system for mobile communications (GSM) network, a code division multiple access (CDMA) network, a wideband code division multiple access (WCDMA) network, a long term evolution (LTE) communication network, a WIFI network, a ZigBee network, a Bluetooth technology-based network and the like. Different types of communication networks can be operated by different operators. The type of communication network does not constitute a limitation on the embodiments of the present application.

[0024] The hardware platform 100 can quickly construct the entire brain simulation network model by means of virtual creation of neurons and synapses, and the construction time is relatively stable and does not change with the increase of the network scale. After the construction is completed, resource allocation is performed on the entire brain simulation network, and a specified process is used to actually create neurons and synapses, so as to achieve the purposes of reducing the communication amount and accelerating the simulation speed. At the same time, since the hardware platform 100 can quickly construct the network virtually, the network snapshot information can be quickly obtained without waiting for the actual network construction to be completed. The network snapshot file can be loaded for network use next time, or can be applied to different platforms. Optionally, as shown in FIG. 3, the hardware platform 100 can include a processor 301 and a memory 303 configured to store computer program instructions adapted to be loaded by the processor and execute the method for constructing a brain simulation network developed by the present application (which will be described in detail later). Figure 3

[0025] The processor 301 can be various applicable processors, for example, implemented in the form of a central processing unit, a microprocessor, an embedded processor and the like, and can adopt an X86, ARM or the like architecture. The memory 303 can be various applicable storage devices, for example, non-volatile storage devices including, but not limited to, magnetic storage devices, semiconductor storage devices, optical storage devices and the like, and can be arranged as a single storage device, an array of storage devices or a distributed storage device, and the embodiments of the present application do not limit these.

[0026] Those skilled in the art can understand that the structure of the hardware platform 100 described above is only schematic, and does not limit the structure of the device. For example, the hardware platform 100 can further include more than one processor 301, more than one memory 303, or more than one communication interface 305. Figure 3 ​More or less components (such as a transmission device) can be included in the system. The transmission device is used to receive or send data via a network. In one example, the transmission device is a radio frequency (RF) module, which is used to communicate with the Internet wirelessly.

[0027] Through the above-mentioned embodiments of the present application, when the neurons and synapses of the brain simulation system are virtually created, a large amount of memory or display memory is not actually occupied, the creation is relatively rapid, the creation time is relatively stable, and the creation time does not increase with the increase of the network scale. After the brain simulation network is constructed, reasonable resource allocation is performed on the entire network, and each process actually creates a specified neuron cluster to achieve the beneficial effects of reducing communication volume and accelerating simulation speed. Network snapshot information can be quickly obtained without waiting for the actual brain simulation network to be constructed, and the network snapshot information can be used to restore the network.

[0028] Under the above-mentioned operating environment, at least one embodiment of the present application proposes a method for constructing a brain simulation network, which can be loaded and executed by the processor 301 of the hardware platform 100, and at least solves the problems of rapidly constructing a brain simulation network and fully and reasonably utilizing computing resources. As shown in the flowchart of the method for constructing a brain simulation network, Figure 4 It should be noted that the steps shown in the flowchart of the drawing can be executed in a computer system such as a group of computer executable instructions, and although a logical order is shown in the flowchart, in some cases, the steps shown or described herein can be executed in an order different from that shown herein. The method can include the following steps:

[0029] Step S402, initializing the hardware platform;

[0030] Step S404, virtually creating a brain simulation network of the hardware platform, wherein the brain simulation network includes neuron clusters and synapses;

[0031] Step S406, allocating processes to the neuron clusters according to a first communication rule, and actually creating the brain simulation network by using the processes.

[0032] In view of the fact that the brain simulation network mainly includes neurons, synapses, and ion channels, etc., the present application virtually creates the neurons and synapses of the brain simulation network in the above-mentioned manner. The virtual creation does not actually occupy a large amount of memory or display memory, is relatively rapid, has a relatively stable creation time, and does not increase with the increase of the network scale. Meanwhile, the present application can perform reasonable resource allocation on the entire network after the brain simulation network is constructed, and each process actually creates a specified neuron cluster (including ion channels) to achieve the beneficial effects of reducing communication volume and accelerating simulation speed. In this way, network snapshot information can be quickly obtained without waiting for the actual brain simulation network to be constructed.

[0033] In step S402, the hardware platform is initialized. For example, if the hardware platform has a first network snapshot file, the first network snapshot file can be loaded, where the first network snapshot file is a json file, the json file includes a first neuron cluster list and a first synapse list, the first neuron cluster list stores a plurality of first dictionaries corresponding to a plurality of first neuron clusters, the first dictionary includes configuration parameters, the number of neurons, the type of neurons, the neuron cluster id and / or the neuron start id in the neuron cluster; the first synapse list stores a plurality of second dictionaries corresponding to a plurality of first synapses, the second dictionary includes connection parameters, synapse parameters, source neuron cluster id and / or target neuron cluster id. Thus, the present application can initialize and record the hardware platform and its CPU, GPU (graphics processing unit, graphics processor) and the like by using a plurality of first dictionaries and a plurality of second dictionaries, and the recorded information can be used for the hardware platform (or other platform) to actually build a brain simulation network subsequently.

[0034] Optionally, the above-mentioned loading of the first network snapshot file can include: traversing the first neuron cluster list to cyclically create initial neuron clusters, and traversing the first synapse list to cyclically create initial synapses.

[0035] In step S404, the brain simulation network of the hardware platform is virtually created, which includes neuron clusters and synapses, such as a plurality (N) of second neuron clusters and a plurality (M) of second synapses. The present application divides the hardware platform into an interface layer, a resource scheduling layer and a hardware kernel layer, wherein the interface layer cyclically creates second neuron clusters, and obtains a second neuron cluster list in the resource scheduling layer, wherein the second neuron cluster list includes a plurality of second neuron clusters; the interface layer cyclically creates second synapses, and obtains a second synapse list in the resource scheduling layer, wherein the second synapse list includes a plurality of second synapses; the resource scheduling layer generates a second network snapshot file, wherein the second network snapshot file is a json file, the json file includes the second neuron cluster list and the second synapse list; the resource scheduling layer generates a json format second network snapshot file according to the second neuron cluster list: [second neuron cluster class instance 1, second neuron cluster class instance 2,..., second neuron cluster class instance N] and the second synapse list: [synapse class instance 1, synapse class instance 2,..., synapse class instance M]; in the case that the resource scheduling layer allocates processes to the N second neuron clusters based on the first communication rule, the hardware kernel layer actually creates the brain simulation network by using the processes. For example, Figure 5As shown, relative to the brain simulation system in the prior art, "neurons, synapses are actually created in the interface layer, and are actually created by the hardware platform in the hardware kernel layer", the application adds a resource scheduling layer "obtains the entire brain simulation network information in the resource scheduling layer, generates a network snapshot file, and processes resource allocation", modifies the interface layer to "virtually create neurons and synapses", can quickly build the entire network model, speeds up the simulation, and can quickly obtain network snapshot information.

[0036] Here, the interface layer cyclically creates the second neuron cluster, and obtaining the second neuron cluster list in the resource scheduling layer can include: obtaining a first instruction for virtually creating the second neuron cluster, wherein the first instruction is Population(model_name, num_neuron_per_pop, info), Population is a neuron cluster class, model_name is a neuron model name, num_neuron_per_pop is the number of neurons in the neuron cluster, and info is a neuron parameter; storing model_name, num_neuron_per_pop, a neuron id range neuron_range, a starting id of a neuron in the neuron cluster, a global_id of the neuron cluster, and / or info in a virtually created second neuron cluster class instance according to the first instruction; cyclically creating a plurality of second neuron clusters, and adding the plurality of second neuron cluster class instances to the second neuron cluster list in the resource scheduling layer to obtain the second neuron cluster list.

[0037] For example, the plurality of second neuron clusters are cyclically created, the global neuron cluster list is changed during the cycle, and the id in each neuron cluster is also globally updated. In a large-scale scenario, cyclically creating the plurality of second neuron clusters changes the number of neurons in the neuron cluster (which is a 64-bit integer number):

[0038] S1: Obtain a neuron cluster virtual creation instruction Population(model_name, num_neuron_per_pop, info). The Population instruction specifies the number of neurons in the second neuron cluster and the configuration parameters of the neurons. Virtual creation only stores the corresponding parameter information in the function, so it does not occupy too much memory and is relatively fast.

[0039] Wherein, Population is a neuron cluster class, model_name is a neuron model name, which is a string type, num_neuron_per_pop is the number of neurons in the neuron cluster, which is an int type, and info is a neuron parameter, which is a dictionary type, such as {“tau_m”: 10.0, “V_reset”: -65.0}. After the Population instruction is run, the following parameters are stored in the Population initialization function: model_name (neuron model name, string type), num_neuron_per_pop (number of neurons in the neuron cluster, int type), neuron_range (neuron id range, list type), id (neuron cluster starting id, int type), global_id (neuron cluster id, int type), and info (neuron parameter, dictionary type);

[0040] S2: Start building a virtual second neuron cluster class instance with the parameters passed in S1. The virtual second neuron cluster will have a corresponding class that can store the corresponding parameters. After instantiation, the second neuron cluster list will store the class instance, and step S3 is entered after completion;

[0041] S3: Set the second neuron cluster id. Set the current cluster id as the global cluster id and increase the global cluster id by 1. The first neuron cluster id is 0. Step S4 is entered after completion;

[0042] S4: Update the starting id of the neurons in the second neuron cluster. The starting id of the neurons in the first neuron cluster is 0. The last element from the global neuron cluster list, which is the instance of the previous neuron cluster, is taken out. The neuron cluster id and neuron range in the instance are taken out. For example, if N neuron clusters are created and each neuron cluster has Q neurons, the first neuron cluster has an id of 0, a starting id of 0, and a neuron range of 0-Q-1. The second neuron cluster has an id of 1, a starting id of Q, and a neuron id range of Q-Q+Q-1. Step S5 is entered after completion;

[0043] S5: Store the number of neurons and neuron configuration parameters in the second neuron cluster class instance object;

[0044] S6: Add the current neuron cluster class instance to the global cluster list;

[0045] S7: Update the global cluster id dictionary. The second neuron cluster id is the key and the current instance is the value stored in the global cluster id dictionary;

[0046] S8: return to S1 to continue creating the second neuron cluster, after creating one neuron cluster, the global cluster list length is updated and the global neuron cluster id is increased by 1.

[0047] It can be seen that, in the virtual creation of the application, a neuron cluster is taken as a unit, the number of neurons in each neuron cluster can be represented by a 64-bit integer number, a neuron cluster contains a neuron cluster start id, a neuron number, and neuron configuration parameters, and the occupied memory is within 100 bytes. The increase of the number of neurons in a single cluster will not affect the memory occupation. Since a large amount of memory is not allocated, the time consumption is shorter. The virtual creation does not involve process communication, and the purpose is to describe the entire network. After the description is completed, the resource allocation algorithm can be used to minimize the communication amount between neuron clusters of different processes, and finally the actual creation is performed. In this way, after the actual creation, the communication amount between processes can be guaranteed to be small, and the simulation speed can be accelerated.

[0048] Here, the interface layer cyclically creates the second synapse, and the second synapse list obtained in the resource scheduling layer can include: obtaining a second instruction for virtually creating the second synapse, wherein the second instruction is Connection(src, tgt, connspec, synspec), src is a source neuron cluster of Population type, tgt is a target neuron cluster of Population type, connspec is a connection parameter of dictionary type, and synspec is a synapse parameter; storing the source neuron cluster id, the target neuron cluster id, and / or the connspec in the virtually created second synapse class instance according to the second instruction; cyclically creating a plurality of second synapses, and adding a plurality of second synapse class instances to the second synapse list in the resource scheduling layer to obtain the second synapse list.

[0049] In a large-scale scenario, cyclically creating a plurality of second synapses changes the connection number in the connection parameter (the connection number is also a 64-bit integer number), and an example is as follows:

[0050] S1: Get the virtual creation of synapse instruction Connection(src, tgt, connspec, synspec), the Connection instruction will specify the source neuron cluster, the target neuron cluster, and the connection parameter. Among them, src (source neuron cluster, Population type); tgt (target neuron cluster, Population type); connspec (connection parameter, dictionary type, such as {“rule”:“fixed_total_numer”,“N”:1000}, rule is the connection rule, N is the number of synapse connections); synspec (synapse parameter, {“synapse_model”:“static_synapse”,“weight”:1.0,“delay”:1.0}, synapse_model is the synapse model, string type, weight is the weight, float type, delay is the delay, float type).

[0051] Since the Population object occupies less memory, only the above four attributes of src, tgt, connspec, and synspec are included in the Connection class, so the Connection class occupies less memory, and the synapse in the prior art is in units of a synapse connection between two neurons, and each synapse connection object occupies 40 bytes. At the same time, it can be seen that the present application represents the synapse connection by a connection object, which contains the source neuron cluster object, the target neuron cluster object, the connection parameter, and the synapse parameter. These parameters will not occupy more memory as the network size increases. The neuron cluster and the synapse object can be easily serialized, and the neuron cluster and the synapse can be conveniently stored when the network is temporarily stored.

[0052] S2: Start virtual construction of the second synapse class instance with the parameters passed in S1.

[0053] S3: Store the source neuron cluster id, the target neuron cluster id, and the connection parameter.

[0054] S4: Add the current synapse class instance to the global synapse list.

[0055] S5: Return to S4 to continue creating the second synapse. The global synapse list will increase an element every time a synapse is created.

[0056] In summary, in the virtual creation of the brain simulation network, the attributes contained in the neuron cluster object and the connection object are less, and the occupied memory is below 100 bytes, while the prior art needs to occupy memory for each neuron and synapse object, a neuron object occupies about 1800 bytes, a synapse object occupies about 40 bytes, 4 million neurons and 24.1 billion synapses occupy about 1191G memory, and the virtual creation does not occupy more memory with the increase of the network size, and the total occupied memory is less than 2M.

[0057] In the above manner, the resource scheduling layer of the hardware platform 100 can obtain a second neuron cluster list: [second neuron cluster class instance 1, second neuron cluster class instance 2,..., second neuron cluster class instance N], a second synapse list: [second synapse class instance 1, second synapse class instance 2,..., second synapse class instance M], and store the data in the memory of the hardware platform 100, and the storage format is as follows: the second neuron cluster list: [second neuron cluster class instance 1, second neuron cluster class instance 2,..., second neuron cluster class instance N], wherein the neuron cluster class instance is an object, and contains the following attributes: configuration parameters, the number of neurons, the type of neuron, the neuron cluster id, and the starting id of the neuron in the neuron cluster; the second synapse list: [second synapse class instance 1, second synapse class instance 2,..., second synapse class instance M], wherein the synapse class instance is an object, and contains the following attributes: connection parameters, synapse parameters, source neuron cluster id, and target neuron cluster id; and the cluster id dictionary: {neuron cluster id: neuron cluster class instance}, which is stored as a dictionary with the neuron cluster id as the key and the neuron cluster class instance as the value, and can be used to find the neuron cluster class instance through the neuron cluster id.

[0058] Meanwhile, in view of the fast serialization of the second neuron cluster and the second synapse object and the easy temporary storage of the network, the resource scheduling layer can quickly generate a second network snapshot file in the case of judging the need to generate a network snapshot file. For example, a second network snapshot file in the json format is generated according to the second neuron cluster list: [second neuron cluster class instance 1, second neuron cluster class instance 2,..., second neuron cluster class instance N] and the second synapse list: [second synapse class instance 1, second synapse class instance 2,..., second synapse class instance M], the second network snapshot file can describe the entire network and can be applied on multiple platforms. The second network snapshot file only stores the information of each neuron cluster, the connection information between clusters, and the connection description information of the input device and the recording device, so the snapshot file is not very large and is generated quickly.

[0059] For example, when the temporary storage network of the application writes the second network snapshot file (in json format) to the disk, when the number of neuron clusters and the number of synapses are relatively large, such as 200 neuron clusters and 200 neuron clusters for full connection, the generated json file is about 14M, and the write speed of a general solid state disk is 500M / S, so the time consumption does not exceed 1 second; the number of neurons in the neuron cluster will not affect the size of the network snapshot file, and the factors affecting the size of the network snapshot file are the number of neuron clusters and the number of connections between neuron clusters, which are much easier than describing a single neuron and a single synapse.

[0060] In step S406, the neuron clusters are allocated to processes according to a first communication rule, and the brain simulation network is actually created by using the processes, wherein the first communication rule is an optimal communication rule, that is, the neuron clusters are moved between processes so that the communication amount between the neuron clusters in the current process is maximum, and finally the communication amount between the processes is minimum, that is, the global communication amount is minimum. Based on the hardware platform information recorded in step S301, the hardware kernel layer actually creates the brain simulation network according to the resource allocation result based on the allocation of the neuron clusters to the processes according to the first communication rule in the resource scheduling layer.

[0061] That is, the virtual creation of the application does not involve process communication, and the process communication is generated when the brain simulation network runs simulation, and the specific process is to first virtually create, then allocate neuron clusters in the process, do resource allocation, finally actually create, and then the entire network runs simulation. If the actual creation is directly used as in the prior art, there is no way to do resource allocation, and the global communication amount cannot be minimized.

[0062] In order to fully illustrate the advantages of the application, the following detection and test verification is made: A brain simulation network, the network structure of which is 24 neuron clusters, each neuron cluster containing more than one million LIF (Leaky integrate and fire) neurons, and the connection mode between the neuron clusters is a mode of in-degree 100 connection.

[0063] The 24 neuron clusters are evenly distributed to 6 processes and simulated, wherein a machine with 512G memory is used in the experiment, 6 A100 GPU cards are inserted, and there are three groups of data, the total number of neurons is 6 million, 24 million and 48 million respectively, the total number of neuron clusters is 24, and the connection mode between the neuron clusters is a mode of in-degree 100 connection (that is, each neuron in the target neuron cluster receives 100 connections).

[0064] Table 1 Comparison of virtual construction and actual construction time

[0065]

[0066] It can be seen that in the experiment, the virtual construction time provided by the application is stable, all around 2 seconds, and does not increase with the increase of network size, but fluctuates around 2 seconds. This is because virtual construction does not actually occupy a large amount of memory and video memory, so after virtual construction, the network snapshot file can be quickly generated, and the network snapshot file size is relatively stable and will not increase significantly with the increase of network size; while the user directly constructs the network, it will occupy a large amount of memory and video memory, and the time consumption will increase with the increase of network size, and it will become difficult to generate a network snapshot file after actual construction, and it cannot quickly generate a network snapshot file.

[0067] Through the above-mentioned embodiments of the application, on the one hand, the network can be quickly virtually constructed, and after the virtual construction of the network is completed, the entire network information can be obtained, and resource allocation is performed on the entire network using a resource allocation algorithm, so as to ultimately achieve the purposes of reducing communication volume and accelerating simulation speed; on the other hand, snapshot information of a large-scale network can be quickly obtained without waiting for the actual network construction to be completed, and the generated network snapshot file can be used for loading the network model next time, and can be applied to different platforms, and has strong portability.

[0068] Optionally, at least one embodiment of the application further provides a computer-readable nonvolatile storage medium storing computer program instructions, when the computer executes the program instructions, the method for constructing a brain simulation network developed by the application is executed.

[0069] Finally, it should be noted that: the above embodiments are only used to illustrate the technical solutions of the application, and not to limit them; although the application has been described in detail with reference to the above embodiments, those skilled in the art should understand that: it can still modify the technical solutions recorded in the above embodiments, or make equivalent replacement for part or all of the technical features; and these modifications or replacements do not make the essence of the corresponding technical solutions deviate from the scope of the technical solutions of the embodiments of the application.

Claims

1. A method for constructing a brain simulation network, applicable to a hardware platform storing a first communication rule, characterized in that, include: Initialize the hardware platform; A brain simulation network is virtually created on the hardware platform, wherein the brain simulation network includes clusters of neurons and synapses; The neuron clusters are assigned processes according to the first communication rule, and the brain simulation network is actually created using the processes. The hardware platform includes an interface layer and a resource scheduling layer. The brain simulation network that virtually creates the hardware platform includes: The interface layer creates second neuron clusters in a loop and obtains a list of second neuron clusters in the resource scheduling layer. The list of second neuron clusters includes multiple second neuron clusters. The interface layer creates second synapses in a loop and obtains a list of second synapses in the resource scheduling layer, wherein the list of second synapses includes multiple second synapses; The resource scheduling layer generates a second network snapshot file, wherein the second network snapshot file is a JSON file, and the JSON file includes a list of second neuron clusters and a list of second synapses; The first communication rule is the optimal communication rule, which moves neuron clusters between processes to maximize the communication volume between neuron clusters in the current process, and ultimately minimizes the communication volume between processes, which is also the minimum global communication volume.

2. The method according to claim 1, wherein initializing the hardware platform includes: Load a first network snapshot file, wherein the first network snapshot file is a JSON file, the JSON file includes a first neuron cluster list and a first synapse list, the first neuron cluster list stores multiple first dictionaries corresponding to multiple first neuron clusters, the first dictionary includes configuration parameters, number of neurons, neuron type, neuron cluster ID and / or neuron start ID in neuron cluster, the first synapse list stores multiple second dictionaries corresponding to multiple first synapses, the second dictionary includes connection parameters, synapse parameters, source neuron cluster ID and / or target neuron cluster ID; The hardware platform is initialized using multiple first dictionaries and multiple second dictionaries.

3. The method according to claim 2, loading the first network snapshot file includes: The first list of neuron clusters is traversed to create initial neuron clusters in a loop, and the first list of synapses is traversed to create initial synapses in a loop.

4. The method according to claim 1, wherein the interface layer cyclically creates a second neuron cluster, and the resource scheduling layer obtains a list of the second neuron clusters, comprising: Obtain the first instruction for virtually creating a second neuron cluster, wherein the first instruction is Population(model_name,num_neuron_per_pop,info), where Population is the neuron cluster class, model_name is the neuron model name, num_neuron_per_pop is the number of neurons in the neuron cluster, and info is the neuron parameter; According to the first instruction, the model_name, the num_neuron_per_pop, the neuron_range, the neuron start ID in the neuron cluster, the neuron cluster global_id, and / or the info are stored in the virtually constructed second neuron cluster class instance; Multiple second neuron clusters are created in a loop, and multiple instances of the second neuron cluster class are added to the second neuron cluster list in the resource scheduling layer to obtain the second neuron cluster list.

5. The method according to claim 1, wherein the interface layer cyclically creates second synapses and obtains a list of second synapses at the resource scheduling layer, comprising: Obtain the second instruction for virtually creating a second synapse, wherein the second instruction is Connection(src,tgt,connspec,synspec), where src is a source neuron cluster of type Population, tgt is a target neuron cluster of type Population, connspec is a connection parameter of type dictionary, and synspec is a synapse parameter; According to the second instruction, the source neuron cluster id, the target neuron cluster id, and / or the connspec are stored in the virtually constructed second synapse class instance; Multiple second synapses are created in a loop, and multiple instances of the second synapse class are added to the second synapse list in the resource scheduling layer to obtain the second synapse list.

6. The method according to claim 1, wherein the second neuron cluster list is: [second neuron cluster instance 1, second neuron cluster instance 2, ..., second neuron cluster instance N], the second synapse list is: [second synapse instance 1, second synapse instance 2, ..., second synapse instance M], and the resource scheduling layer generates the second network snapshot file including: The resource scheduling layer generates a second network snapshot file in JSON format based on the second neuron cluster list: [second neuron cluster instance 1, second neuron cluster instance 2, ..., second neuron cluster instance N] and the second synapse list: [second synapse instance 1, second synapse instance 2, ..., second synapse instance M].

7. The method according to any one of claims 1-6, wherein the hardware platform further comprises a hardware kernel layer, which utilizes the process to actually create the brain simulation network: When the resource scheduling layer allocates processes to multiple second neuron clusters based on the first communication rule, the hardware kernel layer uses the processes to actually create the brain simulation network.

8. A hardware platform, comprising: A processor, suitable for implementing various instructions; And a memory adapted to store multiple instructions, said instructions adapted to be loaded and executed by a processor: the method for constructing a brain simulation network as described in any one of claims 1-7.

9. A computer-readable non-volatile storage medium storing computer program instructions, which, when executed by a computer, perform: the method for constructing a brain simulation network as described in any one of claims 1-7.

Citation Information

Patent Citations

  • Spiking neural network operation system and method for brain-like intelligence and cognitive calculation

    CN110322010A

  • A parallelization-based brain-like simulation compilation acceleration method

    CN112651504A