# Runtime Construction of Large-Scale Spiking Neuronal Network Models on GPU Devices
## 3 Results
### Cortical Microcircuit Model  
Figure 3 directly compares the two approaches for network construction implemented in NEST GPU, i.e., _onboard_ and _offboard_, in terms of the network construction time (panel A) and the real-time factor obtained using a simulation of the network dynamics (panel B). Panel A shows that the novel method for network construction enables a speed up by two orders of magnitude with respect to the previous network construction algorithm. The overhead of the _offboard_ method (used in [9; 13]) transferring the network from CPU to GPU becomes obsolete with the proposed approach to generate the connections directly on the GPU. Moreover, the _onboard_ version shows lower network construction times across all hardware configurations without compromising the simulation times (panel B). An additional detail to take note of with the novel algorithm is that the calibration phase is now by far the longest compared to the node creation and node connection (3-5 times longer, depending on the hardware used). However, this is only due to the fact that both  
the creation and connection phases are now only used to instantiate data structures in GPU memory, whereas the calibration phase takes charge of the connection sorting as described in Section 2.2. Both versions have real-time factors of less than one second (sub-real-time simulation), thus showing also an improvement in the simulation time compared to the results of [9] obtained with the prototype NeuronGPU library. Additionally, in some cases, it is possible to see a small improvement when simulating using the novel network construction approach due to some code optimization related to the simulation phase. While the network construction times are independent of the choice of external drive, the DC input as expected leads to faster simulations of the network dynamics compared to the Poisson generators. Comparing the different hardware configuration, the smallest real-time factor obtained with NEST GPU (_onboard_) is achieved with DC input on the latest consumer GPU RTX 4090, 0.386(0.001) (mean (standard deviation)). The respective result for Poisson input is 0.4707(0.0008). For completeness, we also measure the real-time factor of NEST and GeNN simulations using the same framework used for Figure 3B. These results are shown in Tables 2-4 and depicted in Appendix C.  
Figure 4 compares the network construction times of the full-scale cortical microcircuit model obtained using NEST GPU (_onboard_), NEST 3.3, and GeNN 4.8.0 on different  
Figure 3: Comparison of network construction phase and simulation of the network dynamics for the two versions of NEST GPU on the cortical microcircuit model. (**A**) Performance comparison of the network construction phase using different hardware configurations. (**B**) Real-time factor defined as \(T_{\text{wall}}/T_{\text{model}}\). The biological model time we use to compute the real-time factor is \(T_{\text{model}}=10\,\text{s}\). The external drive is provided via Poisson spike generators (left bars, pink) or DC input (right bars, dark red). Error bars show the standard deviation of the simulation phase over ten simulations using different random seeds. hardware configurations; for details on the hardware and software configurations, see Section 2.5. The settings are the same as in Figure 3. While panel A resolves the contributions of the different stages (defined in Section 2.6) using a linear y-axis, panel B shows the same data with logarithmic y-axis to facilitate a comparison of the absolute numbers. As mentioned in Section 2.4, the external input to the cortical microcircuit implementations in both the CPU and GPU versions of NEST can be provided via either generators of Poisson signals or DC input. We run simulations comparing both approaches. However, Figure 4 only shows the results for the case of Poisson generators because the network construction times with DC input are similar. GeNN, in contrast, mimics the incoming Poisson spike trains via a current directly applied to each neuron.