Fast and Efficient Implementation of Neural Networks using CUDA and OpenMP

CUDA와 OPenMP를 이용한 빠르고 효율적인 신경망 구현

  • Published : 2009.04.15

Abstract

Many algorithms for computer vision and pattern recognition have recently been implemented on GPU (graphic processing unit) for faster computational times. However, the implementation has two problems. First, the programmer should master the fundamentals of the graphics shading languages that require the prior knowledge on computer graphics. Second, in a job that needs much cooperation between CPU and GPU, which is usual in image processing and pattern recognition contrary to the graphic area, CPU should generate raw feature data for GPU processing as much as possible to effectively utilize GPU performance. This paper proposes more quick and efficient implementation of neural networks on both GPU and multi-core CPU. We use CUDA (compute unified device architecture) that can be easily programmed due to its simple C language-like style instead of GPU to solve the first problem. Moreover, OpenMP (Open Multi-Processing) is used to concurrently process multiple data with single instruction on multi-core CPU, which results in effectively utilizing the memories of GPU. In the experiments, we implemented neural networks-based text extraction system using the proposed architecture, and the computational times showed about 15 times faster than implementation on only GPU without OpenMP.

컴퓨터 비전이나 패턴 인식 분야에서 이용되고 있는 많은 알고리즘들이 최근 빠른 수행시간을 위해 GPU에서 구현되고 있지만, GPU를 이용하여 알고리즘을 구현할 경우 크게 두 가지 문제점을 고려해야 한다. 첫째, 컴퓨터 그래픽스 분야의 지식이 필요한 쉐이딩(shading) 언어를 알아야 한다. 둘째, GPU를 효율적으로 활용하기 위해 CPU와 GPU간의 데이터 교환을 최소화해야 한다. 이를 위해 CPU는 GPU에서 처리할 수 있는 최대 용량의 데이터를 생성하여 GPU에 전송해야 하기 때문에 CPU에서 많은 처리시간을 소모하며, 이로 인해 CPU와 GPU 사이에 많은 오버헤드가 발생한다. 본 논문에서는 그래픽 하드웨어와 멀티코어(multi-core) CPU를 이용한 빠르고 효율적인 신경망 구현 방법을 제안한다. 기존 GPU의 첫 번째 문제점을 해결하기 위해 제안된 방법은 복잡한 쉐이팅 언어 대신 그래픽스적인 기본지식 없이도 GPU를 이용하여 응용프로그램 개발이 가능한 CUDA를 이용하였다. 두 번째 문제점을 해결하기 위해 멀티코어 CPU에서 공유 메모리 환경의 병렬화를 수행할 수 있는 OpenMP를 이용하였으며, 이의 처리시간을 줄여 CPU와 GPU 환경에서 오버 헤드를 최소화할 수 있다. 실험에서 제안된 CUDA와 OpenMP기반의 구현 방법을 신경망을 이용한 문자영역 검출 알고리즘에 적용하였으며, CPU에서의 수행시간과 비교하여 약 15배, GPU만을 이용한 수행시간과 비교하여 약 4배정도 빠른 수행시간을 보였다.

Keywords

References

  1. K.S. Oh and K. Jung, 'GPU Implementation of Neural Network,' Pattern Recognition, Vol.37, Issue 6, pp. 1311-1314, 2004 https://doi.org/10.1016/j.patcog.2004.01.013
  2. K. Moreland and E. Angel, 'The FFT on a GPU,' Proceedings of SIGGRAPH Conference on Graphics Hardware, pp. 112-119, 2003
  3. J. Mairal, R. Keriven, and A. Chariot, 'Fast and Efficient Dense Variational Stereo on GPU,' Proceedings of International Symposium on 3D Data Processing, Visualization, and Transmission, pp. 697-704, 2006
  4. I. Geys and L.V. Gool, 'View Synthesis by the Parallel Use of GPU and CPU,' Image and Vision Computing, Vol.25, Issue 7, pp. 1154-1164, 2007 https://doi.org/10.1016/j.imavis.2006.07.023
  5. R. Yang and G. Welch, 'Fast Image Segmentation and Smoothing using Commodity Graphics Hardware,' Journal of Graphics Tools, Vol.17, Issue 4, pp. 91-100, 2002
  6. http://ati.amd.com/developer/
  7. http://developer.nvidia.com/object/cg_toolkit.html/
  8. http://www.opengl.org/documentation/glsl/
  9. http://graphics.stanford.edu/projects/brookgpu/
  10. http://www.nvidia.com/object/cuda_home.html/
  11. http://www.openmp.org/
  12. K. Jung, 'Neural Network-based Text Localization in Color Images,' Pattern Recognition Letters, Vol.22, Issue 4, pp. 1503-1515, 2001 https://doi.org/10.1016/S0167-8655(01)00096-4