DOI QR코드

DOI QR Code

NVIDIA GPU 상에서의 난수 생성을 위한 CUDA 병렬프로그램

Efficient Parallel CUDA Random Number Generator on NVIDIA GPUs

  • 김영태 (강릉원주대학교 컴퓨터공학과) ;
  • 황규현 (강릉원주대학교 컴퓨터공학과)
  • 투고 : 2015.07.06
  • 심사 : 2015.09.17
  • 발행 : 2015.12.15

초록

본 논문에서는 고성능 병렬 계산 장치로 주목받고 있는 GPU에서의 선형 합동 방식(linear congruential)의 병렬 난수 생성 프로그램을 구현하였다. 난수는 임의성을 필요로 하는 모든 분야에서 중요하게 사용되며, 선형 합동 난수 방식은 컴퓨터 계산을 통하여 생성되는 의사 난수(pseudo random numbers) 생성 방식 중에 가장 많이 사용되는 방식이다. 본 논문에서는 NVIDIA CUDA 프로그래밍 모델을 사용하여 구현된 프로그램 및 MPI를 사용한 다중 GPU를 구동하는 병렬프로그램을 설명하고, 생성된 난수들의 임의성과 성능을 알아보았다. 또한 원주율(${\pi}$)을 계산하기 위한 몬테카를로 알고리즘을 사용하여 CUDA 라이브러리 함수인 cuRAND와 성능을 비교하였으며, 다수의 GPU를 동시에 계산한 성능의 변화도 알아보았다.

In this paper, we implemented a parallel random number generation program on GPU's, which are known for high performance computing, using LCG (Linear Congruential Generator). Random numbers are important in all fields requiring the use of randomness, and LCG is one of the most widely used methods for the generation of pseudo-random numbers. We explained the parallel program using the NVIDIA CUDA model and MPI(Message Passing Interface) and showed uniform distribution and performance results. We also used a Monte Carlo algorithm to calculate pi(${\pi}$) comparing the parallel random number generator with cuRAND, which is a CUDA library function, and showed that our program is much more efficient. Finally we compared performance results using multi-GPU's with those of ideal speedups.

키워드

참고문헌

  1. A. Sheldon, A first course in probability, Pearson Education India, 2002.
  2. C. Dutang, and D Wuertz, A note on random number generation, 2009.
  3. S. Mohanty, A. K. Mohanty, and F. Carminati, "Efficient pseudo-random number generation for monte-carlo simulations using graphic processors," Journal of Physics: Conference Series. IOP Publishing, Vol. 368, No. 1, 2012.
  4. W. B. Langdon, "A fast high quality pseudo random number generator for NVIDIA CUDA," Proc. of the 11th Annual Conference Companion on Genetic and Evolutionary Computation Conference: Late Breaking Papers. ACM, 2009.
  5. M. Manssen, M. Weigel, and A. K. Hartmann1, "Random number generators for massively parallel simulations on GPU," The European Physical Journal Special Topics, Vol. 210, No. 1, pp. 53-71, 2012. https://doi.org/10.1140/epjst/e2012-01637-8
  6. D. Kirk, "NVIDIA CUDA software and GPU parallel computing architecture," ISMM, Vol. 7, 2007.
  7. P. S. Pacheco, Parallel Programming with MPI, Morgan Kaufmann, 2001.
  8. NVIDIA, CUDA, Compute United Device Architecture Reference Manual Version 5.0, NVIDIA Corporation, 2012.
  9. D. E. Knuth, The Art of Computer Programming Volume 2 (3rd ed.): Seminumerical Algorithms, Addison-Wesley, Boston, MA, 1997.
  10. G. Fox, M. Johnson, G. Lyzenga, S. Otto, J. Salmon, and D. Walker, Solving Problems on concurrent Processors Vol. 1, Prentice Hall, Englewood Cliffs, NJ, 1988.
  11. B. Kernighan, and D. Ritchie, The C Programming Language: 2nd Edition, Prentice Hall Software Series Englewood Cliffs, 1998.
  12. B. Gough, GNU scientific library reference manual, Network Theory Ltd., 2009.
  13. J. H. Lim, S. H. Lee, and D. K. Kim, "New Randomness Testing Methods using Approximate Periods," KIISE Transactions on Computing Practices (KTCP), Vol. 16, No. 6, pp. 742-746, 2010. (in Korean)
  14. M. H. Kalos, and P. A. Whitlock, Monte Carlo Methods, Wiley-VCH, 2nd edition, 2008.
  15. H. Lee, E. Im, "Parallelization of Path Integral Monte Carlo Simulation on nVidia GPU," Proc. of the Korean Information Science Society Conference, Vol. 36, No. 1, pp. 322-326, 2009. (in Korean)
  16. M. Choi, S. Maeng, "Parallelized PI(${\pi}$) Calculation Algorithm using MPI," Proc. of the Korean Information Science Society Conference, Vol. 31, No. 1, pp. 91-93, 2004. (in Korean)
  17. T. H. Cormen, C. E. Leiserson, R. L. Rivest, and C. Stein, Introduction to Algorithms, MIT Press, 2009.
  18. NVIDIA, CUDA CURAND Library, PG-05328-032_V01 August, 2010.