Abstract
HPC 어플리케이션과 컴퓨터 구조의 복잡도가 늘어가면서 어플리케이션의 동작을 이해하는 노력에 대한 비용 또한 점차 증가하고 있다. 이 논문에서는 performance를 효율적으로 이해하고 예측하기 위한 APMT(Automatic Performance Modeling Tool)을 소개한다. APMT에서는 hardware counter 기반 프로파일링을 사용하여 key kernel 과 non-scalable kernel를 구분하여 performance model을 만든다. 또한, CPI(Cycles-Per-Instruction)을 더욱 자세하게 계산하기 위해 선택적 개선 모델링 프레임워크(optional refinement modeling framwork)를 제공한다.
APMT는 몇 가지 소규모 프로파일링만 수행하여 모델링을 수행한다. 논문에서 APMT를 검증한 결과 NPB(NAS Parallel Benchmark), CESM(Community Earth System Model)의 대기(atmosphere) 모델과 얼음(ice) 모델 등 다양한 시나리오에서 평균 perfromance overhead가 3%였으며 평균 error rate가 약 15%로 나타났다. APMT는 strong scaling 테스트에서 유명한 analytical model과 empirical model에 비해 모델 예측 정확도가 25-52% 높았다.
Introduction
어플리케이션의 알고리즘과 구현을 분석하기 위해 어플리케이션의 동작을 이해하는 것은 매우 어려우며, 대체로 이러한 작업은 소수의 전문가들에 의해서 performance model을 구하여 해결하였다.
- Marathe et al. 2017; Performance modeling under resource constraints using deep transfer learning. In Proceedings of the: ACM/IEEE International Conference for High Performance Computing
- Balaprakash et al. 2016; Automomml: Automatic multi-objective modeling with machine learning. In International Conference on High Performance Computing
- Xingfu et al. 2014; Multiple metrics modeling infrastructure. Springer, MuMMI (2014)
- Jones et al. 2005; Practical performance portability in the parallel ocean program (pop). Concurr. Comput.
- Craig et al. 2015; Improved parallel performance of the cice model in cesm1. Int. J. High Perfor. Comput.
- Bhattacharyya et al. 2014; Pemogen: automatic adaptive performance modeling during program runtime. In Proceedings of the 23rd International Conference on Parallel Architectures and Compilation
- Bauer et al. 2012; Performance modeling and comparative analysis of the milc lattice qcd application su3_rmd.
In Cluster, Cloud and Grid Computing (CCGrid) - Nan et al. 2014; Cesmtuner: an autotuning framework for the community earth system model. In High
Performance Computing and Communications (HPCC) - Pallipuram et al. 2015, 2014; Subjective versus objective: classifying analytical models for productive heterogeneous performance prediction Supercomput. (2015). A regression-based performance prediction framework for synchronous iterative algorithms on general purpose graphical processing unit clusters. Concurr. Comput. (2014)
- Knüpfer et al. 2012; Knüpfer, A., Rössel, C., an Mey, D., Biersdorf, S., Diethelm, K., Eschweiler, D., Geimer, M., Gerndt, M., Lorenz, D., Malony, A. et al.: Score-p: a joint performance measurement run-time infrastructure for periscope, scalasca, tau, and vampir. In Tools for High Performance Computing, pp. 79–91. Springer, Amsterdam (2012)
- Hong and Kim 2009; Hong, S., Kim, H.: An analytical model for a gpu architecture with memory-level and thread-level parallelism awareness. In ACM SIGARCH Computer Architecture News, vol. 37, pp. 152–163. ACM (2009)
- Barnes et al. 2008; Barnes, B.J., Rountree, B., Lowenthal, D.K., Reeves, J., De Supinski, B., Schulz, M.: A regression-based approach to scalability prediction. In Proceedings of the 22nd annual international conference on Supercomputing, pp. 368–377. ACM (2008)
- Balaprakash et al. 2016; Balaprakash, P., Tiwari, A., Wild, S.M., Carrington, L., Hovland, P.D.: Automomml: Automatic multi-objective modeling with machine learning. In International Conference on High Performance Computing, pp. 219–239 (2016)
- Xingfu et al. 2014; Xingfu, W., Lively, C., Taylor, V., Hung, C.C., Chun Y.S., Katherine, C., Steven, M., Dan, T., Vince, W.: Multiple metrics modeling infrastructure. Springer, MuMMI (2014)
최근에는 기존의 analytical modeling을 단순화 하기위해 compiler-assisted modeling, domain language-based modeling, fully automatic(analytical and empirical) modeling 방법들을 제안하는 많은 연구들이 있었다. 하지만 어플리케이션의 알고리즘과 구현을 case by case로 논문에서 제안한 구조에 맞춰서 적용해야 했기 때문에, 어플리케이션의 performance를 직관적으로 이해하기 어려웠다.
Analytical model은 표현된 식을 통해 사용자가 performance를 유추해보기가 쉽다는 장점이 있지만 이러한 수식을 구하기 위해서는 많은 수작업 및 사전 지식이 필요하다는 단점이 있다. Emprical model은 regression과 같은 통계적 방법을 사용하기 때문에 portability는 좋지만 오버헤드가 많다는 단점이 있다. 머신러닝 기술이 도입된 모델은 정확도를 향상 시켰지만 profiling 및 training하는 과정에서 소모되는 cost가 크다는 단점이 있다.
논문에서는 위의 단점들을 보완하기 위해 hardware counter-assisted profiling을 사용하는 offline performance modeling 도구인 APMT를 제안하였다. 기존의 hardware counter-assisted profiling을 적용한 도구들의 목록은 아래와 같다.
- HPCtoolkit; Hpctoolkit: tools for performance analysis of optimized parallel programs. Concurr. Comput.
- LIKWID; Likwid: a lightweight performanceoriented tool suite for x86 multicore environments. In Parallel
Processing Workshops (ICPPW) - Intel Vtune; Using intel® vtuneTM performance analyzer events/ratios & optimizing applications
- PAPI; Papi: A portable interface to hardware performance counters. In Proceedings of the department of defense HPCMP users group conference
- perf; Linux perf_event features and overhead. The 2nd International workshop on performance analysis of workload optimized systems, FastPath
또한 hardware counter는 아래의 여러 상용 프로세서들에서 지원하고 있다.
- Intel; PMU Intel. Profling tools.
- IBM; Performance monitor counter data analysis using counter analyzer. IBM developerWorks (2009)
- AMD; Accuracy of performance counter measurements. In Performance Analysis of Systems and Software, ISPASS (2009)
Contribution
- Expensive and non-scalable kernel을 세 종류(key kernels; large run time proportion, non-scalable kernels, sum of rest functions)로 분류하기 위해 hardware counter-assisted technique을 사용하는 방법을 제안함. 이를 통해 loop-level kernel(Bhattacharyya et al. 2015, 2014)의 수를 10배이상 줄일 수 있었음
- Bhattacharyya, A., Kwasniewski, G., Hoefer, T.: Using compiler techniques to improve automatic performance modeling. In Proceedings of the 24th International Conference on Parallel Architectures and Compilation. ACM (2015)
- Bhattacharyya, A., Hoefer, T.: Pemogen: automatic adaptive performance modeling during program runtime
- Malony et al. 에서는 10% 오버헤드 있었지만, APMT는 평균 3%의 오버헤드만 있음
- Malony, A.D., Shende, S.S.: Overhead compensation in performance profiling. In European Conference on Parallel Processing, Springer, pp. 119–132 (2004)
- CPI, blocking factor for compuatation, blocking factor for communication 파라미터를 사용하여 performance를 이해하는 새로운 스키마를 사용. kernel’s instructions throughput, memory traffic, and computation/communication overlap을 이해하는 방법을 제안함
- Real-world 어플리케이션 2개, proxy 어플리케이션 1개에 적용했을때 예전의 모델(Nan et al. 2014; Worley et al. 2011)에 비해 52% 높은 정확도를 얻음
- HOMME (Dennis et al. 2012), the dynamical core of the Community Atmosphere System Model; Dennis, J.M., Edwards, J., Evans, K.J., Guba, O., Lauritzen, P.H., Mirin, A.A., St-Cyr, A., Taylor, M.A., Worley, P.H.: Cam-se: a scalable spectral element dynamical core for the community atmosphere model. Int. J. High Perform. Comput. Appl. 26(1), 74–89 (2012)
- Los Alamos CICE model (Hunke et al. 2010), a full simulation of sea ice which is used in coupled global
climate models; Hunke, E.C., Lipscomb, W.H., Turner, A.K., et al. Cice: the los alamos sea ice mode documentation and software user’s manual version 4.1 la-cc-06-012. T-3 Fluid Dynamics Group, Los Alamos National Laboratory, pp. 675 (2010) - NAS parallel benchmarks (Bailey et al. 1991).
- Nan et al. 2014; Cesmtuner: an autotuning framework for the community earth system model.
- Worley, P.H., Craig, A.P., Dennis, J.M., Mirin, Arthur A., Taylor, M.A., Vertenstein, M.: Performance of the community earth system model. In High Performance Computing, Networking, Storage and Analysis (SC), pp. 1–11. IEEE (2011)