최근 딥러닝(Deep Learning)의 보편화에 따라 임베디드 시스템에서의 딥러닝 수행의 필요성이 커지고 있다. 자율주행 자동차에서의 객체인식, 스마트폰에서 필기체 인식 등, 여러 응용들을 위해서는 실시간으로 딥러닝 추론이 가능해야 한다. 한편 임베디드 GPU는 서버 GPU에 비해 매우 적은 코어 수와, 부족한 컴퓨팅 파워로 성능이 매우 많이 떨어진다. 반면 멀티코어를 활용하는 임베디드 CPU는 코어가 제공하는 벡터명령어를 사용하게 되면 성능면에서 임베디드 GPU와 비슷하거나 심지어 더 빠른 경우도 있다. 따라서, CNN(Convolutional Neural Network) 수행을 위해 임베디드 GPU만 활용하기 보다는 GPU와 CPU 를 동시에 사용할 필요가 있다. 본 논문에서는 CNN을 수행하기 위해 GPU와 CPU를 동시에 활용하는 기법을 제안한다. 네트워크의 각 레이어를 GPU 또는 CPU가 담당하는 방법, 하나의 레이어를 GPU와 CPU가 동시에 수행하는 방법, 그리고 GPU와 CPU의 성능을 고려해 각각 네트워크를 분할하여 담당한 후 파이프라인 방식으로 중첩하여 수행하는 방법이 있다. Caffe 및 Tensorflow와 같이 널리 사용되고 있는 딥러닝 프레임워크는 메모리 요구량이 많으며 임베디드 시스템에서 추론엔진으로 사용되기에는 비효율적이다. 따라서 Caffe 모델을 읽을 수 있으며, 입력 및 출력 데이터를 지정한대로 효율적으로 전송하여 각 레이어를 CPU 또는 GPU에서 처리하거나 CPU 및 GPU에서 동시에 처리할 수 있는 추론 엔진을 구현하였다. 엑시노스5422 기반 플랫폼에서 SqueezeNet을 대상으로 실험을 수행한 결과, 레이어 그룹별 파이프라이닝으로 수행한 것이 가장 빠르게 수행되는 것을 확인하였고, 이미지 100장 수행 기준, GPU 단독보다 1.97배, CPU 단독보다 1.7배 가속할 수 있었다. 주요어: GPU, CPU, 임베디드, 네트워크, 레이어, 추론
ABSTRACTS Accelerating Deep Learning Inference on CPU-GPU Heterogeneous Embedded Systems
Recently, the necessity of deep learning in embedded system has been increased due to the generalization of deep learning. For various applications such as object recognition in autonomous vehicles and user''s face recognition for security in smartphones, deep learning inference should be processed in real time. Meanwhile, embedded GPUs suffer from very low cores and very low performance with insufficient computing power compared to server GPUs. On the other hand, embedded CPUs that utilize multi-cores are similar in performance to, or even faster than, embedded GPUs when using vector instructions provided by cores. Therefore, it is necessary to use the GPU and the CPU at the same time, rather than using only the embedded GPU for deep learning using CNN (Convolutional Neural Network). In this paper, we propose methods to simultaneously use GPU and CPU for CNN. In the first method, each layer of the network is processed by either CPU or GPU. In the second method, one layer can be processed by both CPU and GPU at the same time. Lastly, by considering the performance of the GPU and the CPU, the network is divided into two layer-groups, each of which are assigned to GPU and CPU. The computation of the layer-groups is overlapped and processed in a pipeline manner Widely used deep learning frameworks such as Caffe and Tensorflow require large memory and are inefficient to use as an inference engine on embedded systems. Therefore, we implemented inference engine that can read Caffe models and can process each layer either on CPU or GPU, or at the same on CPU and GPU, as specified, transferring input and output data efficiently. Experiments with SqueezeNet on Exynos 5422-based platforms showed that the fastest performance was achieved by layer-grouped pipelining. The performance of deep learning inference using 100 images was 1.97 times that of GPU alone and 1.7 times that of CPU alone.
제 1 장 서 론 1제 2 장 관련 연구 3제 3 장 배경 지식 5제 1 절 임베디드 시스템 5제 2 절 Exynos 5422 SoC 6제 3 절 딥러닝과 CNN 8제 4 절 SqueezeNet 12제 5 절 ACL(ARM Compute Library) 라이브러리 14제 6 절 Caffe-HRT(Heterogeneous Run Time) 프레임워크 15제 4 장 제안 기법 17제 1 절 CIE(C++ Inference Engine) 프레임워크 17제 2 절 레이어별 매핑 25제 3 절 레이어내 분할 매핑 27제 4 절 레이어 그룹별 파이프라이닝 31제 5 장 실험 결과 34제 1 절 실험 환경 34제 2 절 CPU 및 GPU 단독 실험 34제 3 절 레이어별 매핑 실험 35제 4 절 레이어내 분할 매핑 실험 37제 5 절 레이어 그룹별 파이프라이닝 39제 6 장 결 론 42참고문헌 44ABSTRACTS 46감사의 글 47