[Paper Review] Optimizing Memory-Access Patterns for Deep Learning Accelerators
This paper proposes a global, polyhedral-model-based optimization framework to minimize memory accesses in deep learning workloads on custom accelerators. By eliminating redundant data movements and coherently mapping tensors across memory banks, the approach reduces on-chip and off-chip memory copies by up to 76% and 37%, respectively, on the AWS Inferentia chip.
Deep learning (DL) workloads are moving towards accelerators for faster processing and lower cost. Modern DL accelerators are good at handling the large-scale multiply-accumulate operations that dominate DL workloads; however, it is challenging to make full use of the compute power of an accelerator since the data must be properly staged in a software-managed scratchpad memory. Failing to do so can result in significant performance loss. This paper proposes a systematic approach which leverages the polyhedral model to analyze all operators of a DL model together to minimize the number of memory accesses. Experiments show that our approach can substantially reduce the impact of memory accesses required by common neural-network models on a homegrown AWS machine-learning inference chip named Inferentia, which is available through Amazon EC2 Inf1 instances.
Motivation & Objective
- To address the performance bottleneck caused by inefficient memory access in deep learning accelerators, especially those with software-managed scratchpads.
- To overcome the limitations of existing compilers that optimize memory access per-operator but ignore cross-operator data movement opportunities.
- To systematically reduce redundant memory copies and maximize on-chip memory bandwidth utilization through global optimization.
- To enable efficient execution of deep learning models on domain-specific accelerators like AWS Inferentia by coherently managing data layout across multiple operators.
Proposed method
- Leverages the polyhedral model to represent tensor accesses as affine functions, enabling formal analysis of data dependencies and memory access patterns.
- Applies data-movement elimination by identifying and removing redundant load-store pairs through affine function composition and index space mapping.
- Uses reverse affine mapping to transform load operations from intermediate tensors to source tensors, eliminating intermediate storage.
- Employs fixed-point iteration to propagate memory bank mappings across operators based on data dependencies, ensuring consistency in bank allocation.
- Maps outer tensor dimensions to different memory banks and inner dimensions to elements within the same bank to support sequential access and maximize parallelism.
- Introduces explicit memory copies only when conflicting bank mapping requirements arise between consecutive operators.
Experimental results
Research questions
- RQ1Can global optimization of memory-access patterns across multiple operators reduce redundant data movements in deep learning accelerators?
- RQ2How effective is the polyhedral model in enabling cross-operator memory access optimization for domain-specific accelerators?
- RQ3To what extent can global memory-bank mapping reduce on-chip and off-chip memory copies compared to local, per-operator mapping?
- RQ4What is the performance impact of eliminating intermediate tensor storage on real-world deep learning models?
Key findings
- The proposed method eliminated 123 out of 124 load-store pairs in Parallel WaveNet, reducing intermediate tensor storage by 145 MB out of 146 MB.
- Data-movement elimination saved 10% of on-chip memory copies and 11% of off-chip memory copies in Parallel WaveNet.
- Global memory-bank mapping reduced on-chip data copies by 76% and off-chip copies by 37% compared to local mapping in ResNet-50.
- The approach significantly improves memory bandwidth utilization by minimizing inter-bank data movement and maintaining data locality across operators.
- The optimization is effective on real hardware, as demonstrated on the AWS Inferentia chip available via EC2 Inf1 instances.
Read this paper
Open the full text in the Nubint reader and ask about any passage as you read.
Read this paper on NubintThis review was generated by AI from the original paper. Please check the paper before citing it.