Acceleration of Particle Swarm Optimization with AVX Instructions
Abstract
:1. Introduction
2. Particle Swarm Optimization
Parallelization of PSO
- Compiler’s auto-vectorization (scalar);
- Vectorized classes (avavx);
- AVX intrinsics (intavx);
- ASM code with AVX instructions (asmavx).
3. Empirical Analysis Additionally, Experimental Procedure
4. Conclusions
Author Contributions
Funding
Conflicts of Interest
References
- Kretz, M.; Lindenstruth, V. Vc: A C++ library for explicit vectorization. Softw. Pract. Exp. 2012, 42, 1409–1430. [Google Scholar] [CrossRef]
- Krzikalla, O.; Feldhoff, K.; Muller-Pfefferkorn, R.; Nagel, W.E. Scout: A Source-to-Source Transformator for SIMD-Optimizations. In Euro-Par 2011: Parallel Processing Workshops; Springer: Berlin/Heidelberg, Germany, 2012; pp. 137–145. [Google Scholar] [CrossRef]
- McFarlin, D.S.; Arbatov, V.; Franchetti, F.; Puschel, M. Automatic SIMD vectorization of fast fourier transforms for the larrabee and AVX instruction sets. In Proceedings of the International Conference on Supercomputing—ICS ’11, Vienna, Austria, 7–11 July 1997; ACM Press: New York, NY, USA, 2011; p. 265. [Google Scholar] [CrossRef] [Green Version]
- Sha, D.; Lin, H.H. A multi-objective PSO for job-shop scheduling problems. Expert Syst. Appl. 2010, 37, 1065–1070. [Google Scholar] [CrossRef]
- Cagnoni, S.; Bacchini, A.; Mussi, L. OpenCL Implementation of Particle Swarm Optimization. In Applications of Evolutionary Computation; Springer: Berlin/Heidelberg, Germany, 2012; pp. 406–415. [Google Scholar] [CrossRef]
- Tonti, L.; Patti, A. Fast Overlap Detection between Hard-Core Colloidal Cuboids and Spheres. The OCSI Algorithm. Algorithms 2021, 14. [Google Scholar] [CrossRef]
- Holbrook, A.J.; Nishimura, A.; Ji, X.; Suchard, M.A. Computational Statistics and Data Science in the Twenty-first Century. arXiv 2022, arXiv:2204.05530. [Google Scholar]
- Shabanov, B.M.; Rybakov, A.A.; Shumilin, S.S. Vectorization of High-performance Scientific Calculations Using AVX-512 Intruction Set. Lobachevskii J. Math. 2019, 40, 580–598. [Google Scholar] [CrossRef]
- Hemeida, A.; Hassan, S.; Alkhalaf, S.; Mahmoud, M.; Saber, M.; Bahaa Eldin, A.M.; Senjyu, T.; Alayed, A.H. Optimizing matrix-matrix multiplication on intel’s advanced vector extensions multicore processor. Ain Shams Eng. J. 2020, 11, 1179–1190. [Google Scholar] [CrossRef]
- Bramas, B. A fast vectorized sorting implementation based on the ARM scalable vector extension (SVE). PeerJ Comput. Sci. 2021, 7. [Google Scholar] [CrossRef] [PubMed]
- Chen, J.; Gong, Z.; Tang, Y.; Zhang, Y.; Li, B. Optimizing Diffusion Layer with AVX Shuffling: A Study on SKINNY. In Proceedings of the 2022 7th IEEE International Conference on Data Science in Cyberspace (DSC), Guilin, China, 11–13 July 2022; pp. 227–233. [Google Scholar] [CrossRef]
- Carneiro, A.R.; Serpa, M.S.; Navaux, P.O.A. Lightweight Deep Learning Applications on AVX-512. In Proceedings of the 2021 IEEE Symposium on Computers and Communications (ISCC), Athens, Greece, 5–8 September 2021; pp. 1–6. [Google Scholar] [CrossRef]
- Langdon, W.B.; Banzhaf, W. Long-Term Evolution Experiment with Genetic Programming. Artif. Life 2022, 28, 173–204. [Google Scholar] [CrossRef] [PubMed]
- Hossain, M.M.; Saule, E. Impact of AVX-512 Instructions on Graph Partitioning Problems. In Proceedings of the 50th International Conference on Parallel Processing Workshop, Lemont, IL, USA, 9–12 August 2021; pp. 1–9. [Google Scholar] [CrossRef]
- Engelbrecht, A.P. Computational Intelligence, 2nd ed.; John Wiley & Sons: Hoboken, NJ, USA, 2007. [Google Scholar]
- Zhang, G.; Shao, X.; Li, P.; Gao, L. An effective hybrid particle swarm optimization algorithm for multi-objective flexible job-shop scheduling problem. Comput. Ind. Eng. 2009, 56, 1309–1318. [Google Scholar] [CrossRef]
- Harrison, K.R.; Engelbrecht, A.P.; Ombuki-Berman, B.M. Inertia weight control strategies for particle swarm optimization. Swarm Intell. 2016, 10, 267–305. [Google Scholar] [CrossRef]
- Cleghorn, C.W.; Engelbrecht, A. Particle swarm optimizer. In Proceedings of the 2016 IEEE Symposium Series on Computational Intelligence (SSCI), Perth, WA, Australia, 27 November 1995–1 December 1995; pp. 1–7. [Google Scholar] [CrossRef]
- Engelbrecht, A.P. Particle swarm optimization with crossover. Artif. Intell. Rev. 2016, 45, 131–165. [Google Scholar] [CrossRef] [Green Version]
- Engelbrecht, A. Particle Swarm Optimization. In Proceedings of the 2013 BRICS Congress on Computational Intelligence and 11th Brazilian Congress on Computational Intelligence, Ipojuca, Brazil, 8–11 September 2013; pp. 124–135. [Google Scholar] [CrossRef]
- Lim, S.P.; Haron, H. Performance Comparison of Genetic Algorithm, Differential Evolution and Particle Swarm Optimization towards Benchmark Functions. In Proceedings of the 2013 IEEE Conference on Open Systems (ICOS), Kuching, Malaysia, 2–4 December 2013; pp. 41–46. [Google Scholar] [CrossRef]
- Zhou, Y.; He, F.; Hou, N.; Qiu, Y. Parallel ant colony optimization on multi-core SIMD CPUs. Future Gener. Comput. Syst. 2018, 79, 473–487. [Google Scholar] [CrossRef]
- Atashpendar, A.; Dorronsoro, B.; Danoy, G.; Bouvry, P. A scalable parallel cooperative coevolutionary PSO algorithm for multi-objective optimization. J. Parallel Distrib. Comput. 2018, 112, 111–125. [Google Scholar] [CrossRef]
- Nuzman, D.; Dyshel, S.; Rohou, E.; Rosen, I.; Williams, K.; Yuste, D.; Cohen, A.; Zaks, A. Vapor SIMD. In Proceedings of the International Symposium on Code Generation and Optimization (CGO 2011), Chamonix, France, 2–6 April 2011; pp. 151–160. [Google Scholar] [CrossRef] [Green Version]
- Nedjah, N.; de Moraes Calazan, R.; de Macedo Mourelle, L. Particle, Dimension and Cooperation-Oriented PSO Parallelization Strategies for Efficient High-Dimension Problem Optimizations on Graphics Processing Units. Comput. J. 2016, 59, 810–835. [Google Scholar] [CrossRef]
- Govindaraju, V.; Nowatzki, T.; Sankaralingam, K. Breaking SIMD shackles with an exposed flexible microarchitecture and the access execute PDG. In Proceedings of the Proceedings of the 22nd International Conference on Parallel Architectures and Compilation Techniques, Edinburgh, UK, 7–11 September 2013; pp. 341–351. [Google Scholar] [CrossRef]
- Trouvé, A.; Cruz, A.J.; Brahim, D.B.; Fukuyama, H.; Murakami, K.J.; Clarke, H.; Arai, M.; Nakahira, T.; Yamanaka, E. Predicting Vectorization Profitability Using Binary Classification. IEICE Trans. Inf. Syst. 2014, E97.D, 3124–3132. [Google Scholar] [CrossRef] [Green Version]
- Boettcher, M.; Al-Hashimi, B.M.; Eyole, M.; Gabrielli, G.; Reid, A. Advanced SIMD. In Proceedings of the Design, Automation & Test in Europe Conference & Exhibition (DATE), Dresden, Germany, 24–28 March 2014; pp. 1–4. [Google Scholar] [CrossRef]
Param | Value |
---|---|
PSO iterations | 1000 |
Particles in swarm | 32, 64, 128, 256, 512 |
Number of dimensions | 8, 16, 32, 64, 128, 256, 512 |
Inertia weight | 0.729 |
Max. velocity | by problem’s range |
Local weight (c1) | 1.49445 |
Global weight (c2) | 1.49445 |
Benchmark Function | Range | |
---|---|---|
f01 | Absolute | [−100, 100] |
f02 | Ackley | [−32.77, 32.77] |
f03 | Alpine | [0, 20] |
f04 | Egg holder | [−512, 512] |
f05 | Elliptic | [−100, 100] |
f06 | Griewank | [−600, 600] |
f07 | Hyperellipsoid | [−5.12, 5.12] |
f08 | Michalewicz | [0, ] |
f09 | Norwegian | [−1.1, 1.1] |
f10 | Quadratic | [−100, 100] |
f11 | Quadratic | [−1.28, 1.28] |
f12 | Rastrigrin | [−5.12, 5.12] |
f13 | Rosenbrock | [−30, 30] |
f14 | Salomon | [−100, 100] |
f15 | Schaffer 6 | [−100, 100] |
f16 | Schwefel 1.2 | [−100, 100] |
f17 | Schwefel 2.6 | [−100, 100] |
f18 | Schwefel 2.13 | [, ] |
f19 | Schwefel 2.21 | [−100, 100] |
f20 | Schwefel 2.22 | [−10, 10] |
f21 | Shubert | [−10, 10] |
f22 | Spherical | [−5.12, 5.12] |
f23 | Step | [−100, 100] |
f24 | Vincent | [0.25, 10] |
f25 | Weierstrass | [−0.5, 0.5] |
Dimension | Scalar [s] | Avavx [s] | Intavx [s] | Asmavx [s] |
---|---|---|---|---|
8 | 4.32 | 3.54 | 2.25 | 2.32 |
16 | 7.32 | 3.14 | 2.85 | 2.63 |
32 | 1.20 | 5.552 | 5.32 | 5.23 |
64 | 2.42 | 1.05 | 1.01 | 9.76 |
128 | 4.92 | 2.06 | 1.99 | 1.87 |
256 | 9.92 | 4.10 | 3.96 | 3.84 |
512 | 1.99 | 8.12 | 7.78 | 7.55 |
Fn | Avavx | Intavx | Difference | |||
---|---|---|---|---|---|---|
Average [s] | St. Deviation | Average [s] | St. Deviation | Absolute | Relative | |
1 | 7.79 | 9.02 | 8.34 | 1.89 | 5.46 | 6.76% |
2 | 9.93 | 4.65 | 1.14 | 1.39 | 1.45 | 13.64% |
3 | 1.11 | 5.44 | 1.04 | 1.49 | 6.78 | 6.32% |
4 | 1.75 | 3.42 | 1.97 | 2.30 | 2.17 | 11.66% |
5 | 1.20 | 1.95 | 1.23 | 3.08 | 2.91 | 2.40% |
6 | 1.51 | 1.32 | 1.39 | 2.75 | 1.21 | 8.34% |
7 | 8.86 | 8.64 | 9.59 | 1.65 | 7.28 | 7.90% |
8 | 1.03 | 9.35 | 1.12 | 5.17 | 8.52 | 7.93% |
9 | 7.65 | 1.06 | 7.55 | 2.24 | 9.90 | 1.31% |
10 | 7.94 | 2.28 | 8.48 | 5.02 | 5.43 | 6.61% |
11 | 1.13 | 2.32 | 1.94 | 5.90 | 8.06 | 52.51% |
12 | 8.81 | 5.10 | 8.67 | 1.75 | 1.45 | 1.66% |
13 | 7.72 | 4.77 | 7.89 | 5.94 | 1.66 | 2.13% |
14 | 8.13 | 5.63 | 8.42 | 8.00 | 2.99 | 3.61% |
15 | 1.27 | 1.59 | 1.45 | 1.20 | 1.79 | 13.14% |
16 | 7.78 | 7.66 | 7.92 | 5.47 | 1.36 | 1.73% |
19 | 7.53 | 1.02 | 7.81 | 1.32 | 2.86 | 3.72% |
20 | 8.71 | 1.72 | 8.75 | 8.11 | 3.60 | 0.41% |
21 | 1.17 | 4.47 | 2.99 | 3.14 | 1.82 | 87.78% |
22 | 8.74 | 9.44 | 1.25 | 2.15 | 3.75 | 35.34% |
23 | 2.26 | 2.22 | 9.71 | 1.40 | 1.29 | 79.81% |
24 | 9.12 | 3.85 | 9.13 | 1.48 | 1.40 | 0.15% |
25 | 7.66 | 7.13 | 7.48 | 1.15 | 1.83 | 2.42% |
Disclaimer/Publisher’s Note: The statements, opinions and data contained in all publications are solely those of the individual author(s) and contributor(s) and not of MDPI and/or the editor(s). MDPI and/or the editor(s) disclaim responsibility for any injury to people or property resulting from any ideas, methods, instructions or products referred to in the content. |
© 2023 by the authors. Licensee MDPI, Basel, Switzerland. This article is an open access article distributed under the terms and conditions of the Creative Commons Attribution (CC BY) license (https://creativecommons.org/licenses/by/4.0/).
Share and Cite
Safarik, J.; Snasel, V. Acceleration of Particle Swarm Optimization with AVX Instructions. Appl. Sci. 2023, 13, 734. https://doi.org/10.3390/app13020734
Safarik J, Snasel V. Acceleration of Particle Swarm Optimization with AVX Instructions. Applied Sciences. 2023; 13(2):734. https://doi.org/10.3390/app13020734
Chicago/Turabian StyleSafarik, Jakub, and Vaclav Snasel. 2023. "Acceleration of Particle Swarm Optimization with AVX Instructions" Applied Sciences 13, no. 2: 734. https://doi.org/10.3390/app13020734
APA StyleSafarik, J., & Snasel, V. (2023). Acceleration of Particle Swarm Optimization with AVX Instructions. Applied Sciences, 13(2), 734. https://doi.org/10.3390/app13020734