Towards Automatic HBM Allocation Using LLVM: A Case Study with Knights Landing
Authors:
- Dounia KhaldiDKDounia Khaldi
- Barbara ChapmanBCBarbara Chapman
- 1 November 2016
- conference paper
- Published by Institute of Electrical and Electronics Engineers (IEEE)
- p. 12-20
Abstract
In this paper, we introduce a new LLVM analysis, called Bandwidth-Critical Data Analysis (BCDA), to decide when it is beneficial to allocate data in High-Bandwidth Memory (HBM) and then transform allocation calls into specific HBM allocation calls, for increased performance in parallel systems. High-Bandwidth Memory (HBM) is a new memory technology that features stacked 3D chips on processor dies.The well-known SSA-based compilation infrastructure for sequential and parallel languages LLVM will be used to detect frequently used data and patterns of memory accesses in order to decide on which level to allocate the data: HBM or DDR. BCDA core analysis counts the number of data uses and detects irregular and simultaneous accesses, generating a priority value for every variable. Using this priority value information, LLVM will generate memkind_alloc function calls, to transform mallocs to HBM allocations if HBM is present and a sufficient size of HBM is available.As a use case for validating our approach, we show how the Conjugate Gradient (CG) benchmark from the NAS Parallel suite can be optimized for the use of MCDRAM, as the HBM on the Knights Landing Xeon Phi processors is called. We implement BCDA in the LLVM compiler and apply it on CG to detect when it is beneficial to allocate data in the HBM. Then, we allocate the data in the MCDRAM using hbwmalloc library calls. Using the priority generated by BCDA, we achieved a 2.29× performance improvement using the LLVM compiler and 2.33× using Intel's compiler compared to the DDR version of CG.Keywords
This publication has 12 references indexed in Scilit:
- Regent2015
- POLLY — PERFORMING POLYHEDRAL OPTIMIZATIONS ON A LOW-LEVEL INTERMEDIATE REPRESENTATIONParallel Processing Letters, 2012
- Legion: Expressing locality and independence with logical regions2012
- Optimizing memory hierarchy allocation with loop transformations for high-level synthesis2012
- Combined loop transformation and hierarchy allocation for data reuse optimization2011
- DRDUACM Transactions on Design Automation of Electronic Systems, 2007
- Sequoia: Programming the Memory Hierarchy2006
- Multi-level on-chip memory hierarchy design for embedded chip multiprocessors2006
- LLVM: A compilation framework for lifelong program analysis & transformation2004
- Efficiently computing static single assignment form and the control dependence graphACM Transactions on Programming Languages and Systems, 1991