Abstract
Swarm intelligence optimization algorithms have gained significant attention due to their ability to solve complex optimization problems. However, the efficiency of optimization in large-scale problems limits the use of related methods. This paper presents a GPU-accelerated version of the Multi-Guiding Spark Fireworks Algorithm (MGFWA), which significantly improves the computational efficiency compared to its traditional CPU-based counterpart. We benchmark the GPU-MGFWA on several neural network black-box optimization problems and demonstrate its superior performance in terms of both speed and solution quality. By leveraging the parallel processing power of modern GPUs, the proposed GPU-MGFWA results in faster convergence and reduced computation time for large-scale optimization tasks. The proposed implementation offers a promising approach to accelerate swarm intelligence algorithms, making them more suitable for real-time applications and large-scale industrial problems.
Introduction
Swarm intelligence algorithms, such as the Fireworks Algorithm (FWA), are highly effective at navigating complex, high-dimensional "black-box" landscapes. These environments are often challenging for gradient-based methods, which may become trapped in local optima or prove inapplicable when gradients are unavailable. Despite their robustness, these algorithms are traditionally computationally expensive. In standard CPU-based implementations, potential solutions (sparks) are evaluated serially or in small batches. As the search space expands—particularly in deep neural network optimization—the cost of generating and evaluating thousands of sparks creates a significant bottleneck. This research addresses the scalability challenge by migrating the entire Multi-Guiding Spark Fireworks Algorithm (MGFWA) process to the GPU.
Methods: Parallelizing the Swarm
The core contribution of this work is the GPU-MGFWA implementation, built using PyTorch and CUDA. The transition from CPU to GPU involves a fundamental shift in how data is structured and processed.
Key architectural changes include:
- Batch Dimension Integration: Every variable within the algorithm is assigned a "batch dimension," allowing for simultaneous processing rather than serial iteration.
- Parallel Spark Generation: The "explosion" and "guiding" phases, which create new potential solutions, are executed across thousands of GPU cores concurrently.
- Parallel Fitness Evaluation: The most computationally intensive step—calculating the fitness of every spark—is performed in parallel using optimized tensor operations.
Experimental Setup
To evaluate the performance of GPU-MGFWA, the researchers utilized 12 synthetic neural network "black boxes" as optimization landscapes. These networks varied in scale:
- Small: 465 to ~5,000 parameters.
- Medium: ~35,000 to ~141,000 parameters.
- Large: ~914,000 to ~3.6 million parameters.
The optimization goal was to find an input vector $x$ that minimizes the output of these fixed-parameter networks, simulating complex non-linear engineering problems.
Results and Discussion
The GPU-MGFWA demonstrates a clear advantage in both convergence speed and solution quality. Because swarm intelligence is inherently parallel—each spark's behavior is independent of others in the same generation—the GPU serves as an ideal hardware platform.
Speed and Convergence
In small-scale scenarios, GPU-MGFWA achieved convergence in under one second. As problem complexity increased, the "efficiency gap" between CPU and GPU widened significantly. On "Large" testbeds with millions of parameters, the CPU-based MGFWA struggled to optimize effectively within the time limit, whereas the GPU version continued to find high-quality solutions within 5 seconds.
Consistency and Quality
The GPU implementation consistently reached lower fitness values across all tested timeframes. Furthermore, it exhibited more robust convergence with narrower standard deviations, likely due to its ability to process a much higher volume of sparks within the same temporal window.
Conclusion
By leveraging modern deep learning hardware, GPU-MGFWA transforms swarm intelligence from a computationally prohibitive method into a viable tool for large-scale, real-time industrial applications. Future work may explore hybrid strategies combining MGFWA with other optimization techniques or more granular memory management to support even larger populations.
Source Code: The authors have released the implementation at https://github.com/mxxxr/MGFWA.
Summary updated