DOI QR코드

DOI QR Code

Efficient Collaboration Method Between CPU and GPU for Generating All Possible Cases in Combination

조합에서 모든 경우의 수를 만들기 위한 CPU와 GPU의 효율적 협업 방법

  • 손기봉 (금오공과대학교 컴퓨터공학과) ;
  • 손민영 (금오공과대학교 컴퓨터공학과) ;
  • 김영학 (금오공과대학교 컴퓨터공학과)
  • Received : 2018.02.07
  • Accepted : 2018.06.26
  • Published : 2018.09.30

Abstract

One of the systematic ways to generate the number of all cases is a combination to construct a combination tree, and its time complexity is O($2^n$). A combination tree is used for various purposes such as the graph homogeneity problem, the initial model for calculating frequent item sets, and so on. However, algorithms that must search the number of all cases of a combination are difficult to use realistically due to high time complexity. Nevertheless, as the amount of data becomes large and various studies are being carried out to utilize the data, the number of cases of searching all cases is increasing. Recently, as the GPU environment becomes popular and can be easily accessed, various attempts have been made to reduce time by parallelizing algorithms having high time complexity in a serial environment. Because the method of generating the number of all cases in combination is sequential and the size of sub-task is biased, it is not suitable for parallel implementation. The efficiency of parallel algorithms can be maximized when all threads have tasks with similar size. In this paper, we propose a method to efficiently collaborate between CPU and GPU to parallelize the problem of finding the number of all cases. In order to evaluate the performance of the proposed algorithm, we analyze the time complexity in the theoretical aspect, and compare the experimental time of the proposed algorithm with other algorithms in CPU and GPU environment. Experimental results show that the proposed CPU and GPU collaboration algorithm maintains a balance between the execution time of the CPU and GPU compared to the previous algorithms, and the execution time is improved remarkable as the number of elements increases.

조합에서 모든 경우의 수를 생성하는 체계적인 방법 중 하나는 조합 트리를 구성 하는 것이며 조합 트리를 구성하는 시간 복잡도는 O($2^n$)이다. 조합 트리는 그래프 동형 문제나 빈발 항목집합을 계산하는 초기 모델 등 다양한 목적으로 활용된다. 그러나 조합의 모든 경우의 수를 탐색해야 하는 알고리즘은 높은 시간 복잡도로 인해 현실적으로 활용되기 어렵다. 그럼에도 불구하고 데이터의 양이 방대해지고 이를 활용하기 위한 다양한 연구가 진행되면서 모든 경우의 수를 탐색해야만 하는 경우가 늘고 있다. 최근 GPU환경이 보급되고 쉽게 접할 수 있게 되면서 직렬 환경에서 높은 시간 복잡도를 가지는 알고리즘들을 병렬화 하여 시간을 줄이려는 다양한 시도가 이루어지고 있다. 조합에서 모든 경우의 수를 생성하는 방법은 순차적으로 진행되고 하부 작업의 크기가 편향되기 때문에 병렬 구현에 적합하지 않다. 병렬 알고리즘의 성능은 모든 스레드가 비슷한 크기의 작업을 가질 때 극대화될 수 있다. 본 논문에서는 모든 경우의 수를 구하는 문제를 병렬화하기 위하여 CPU와 GPU가 효율적으로 협업하기 위한 방법을 제안한다. 제안한 알고리즘의 성능을 검증하기 위하여 이론적인 측면에서 시간 복잡도를 분석하고, CPU와 GPU환경에서 다른 알고리즘과 본 연구에서 제안한 알고리즘의 실험 시간을 비교한다. 실험 결과 본 연구에서 제안한 CPU와 GPU의 협업 알고리즘은 이전 알고리즘에 비하여 CPU의 수행시간과 GPU의 수행시간의 균형을 유지하였고 아이템의 개수가 커질수록 괄목할 만한 시간 개선을 보였다.

Keywords

References

  1. R. Agrawal and R. Srikant, "Fast Algorithms for Mining Association Rules," 20th International Conference on Very Large Data Bases, pp.487-499, 1994.
  2. Y. Jiao, "Research of an improved apriori algorithm in data mining association rules," International Journal of Computer and Communication Engineering, Vol.2, No.1, 2013.
  3. H. Kang, K. Yang, C. Kim, Y. Rhee and B. Lee, "A Time- based Apriori Algorithm," The transactions of The Korean Institute of Electrical Engineers, Vol.59, No.7, pp.1327-1331, 2010.
  4. S. Ko and J. Lee, "Weighted Bayesian Automatic Document Categorization Based on Association Word Knowledge Base by Apriori Algorithm," Journal of Korea Multimedia Society, Vol.4, No.2, pp.171-181, 2001.
  5. F. Ruskey, "Combinatorial generation." Preliminary working draft, University of Victoria, Victoria, BC, Canada, 2003.
  6. K. C. Wei, X. Sun, H. Chu, and C. C. Wu, "Reconstructing permutation table to improve the Tabu Search for the PFSP on GPU." The Journal of Supercomputing, Vol.73, No.11, pp.4711-4738, 2017. https://doi.org/10.1007/s11227-017-2041-7
  7. Y. Ye and C. C. Chiang, "A Parallel Apriori Algorithm for Frequent Itemsets Mining," Proceedings of the Fourth International Conference on Software Engineering Research, 2006.
  8. NVIDIA. "CUDA C Programming Guide version 5.0," NVIDIA, 2012.
  9. Permutations with CUDA and OpenCL [Internet], https://www.codeproject.com/Articles/380399/Permutations- with-CUDA-and-OpenCL, 2016.
  10. F. Bodon, "A Fast Apriori Implementation," IEEE ICDM Workshop on Frequent Itemset Mining Implementations, 2003.
  11. F. Bodon, "Surprising Results of Trie-based FIM Algorithm," IEEE ICDM Workshop on Frequent Itemset Mining Implementations, 2004.
  12. W. Ahn, C. Lee, and C. Yoo, "Changes in the performance of the CUDA simple code according to the configuration of blocks and threads," Proc. of the Korea Information Science Society Fall Conference, Vol.39, No.2(A), pp.19-21, 2012.