[Paper Review] Measuring scheduling efficiency of RNNs for NLP applications
This paper introduces Data Reuse Efficiency (DRE) as a metric to measure scheduling inefficiency in RNN inference on CPUs, revealing that current RNN scheduling causes 30–50× more memory traffic than the working set size. By splitting the G matrix into G1 and G2 to improve data reuse, the authors reduce memory bandwidth usage by up to 2.9× in large models like LM and 1.65× in GNMT, significantly improving energy efficiency on mobile SoCs.
Recurrent neural networks (RNNs) have shown state of the art results for speech recognition, natural language processing, image captioning and video summarizing applications. Many of these applications run on low-power platforms, so their energy efficiency is extremely important. We observed that cache-oblivious RNN scheduling during inference typically results in 30-50x more data transferred on and off the CPU than the application's working set size. This can potentially impact its energy efficiency. This paper presents a new metric called Data Reuse Efficiency to gauge the RNN scheduling efficiency of a platform and shows the factors that influence the DRE value. Additionally, this paper discusses an optimization to improve reuse in RNNs and highlights the positive impact of this optimization on the total amount of memory read from or written to the memory controller (and, hence, the DRE value) during the execution of an RNN application for a mobile SoC.
Motivation & Objective
- To quantify the inefficiency of current RNN scheduling on CPUs, particularly in terms of excessive memory bandwidth usage.
- To identify that cache-oblivious scheduling leads to 30–50× more data movement than the working set size in RNN inference.
- To propose a novel optimization—splitting the G matrix into G1 and G2—to improve data reuse and reduce memory traffic.
- To evaluate the impact of the optimized scheduler on memory system efficiency using analytical modeling on mobile SoC-like caches.
- To establish DRE as a new metric for assessing scheduling efficiency in RNN workloads on low-power platforms.
Proposed method
- Proposes Data Reuse Efficiency (DRE) as a metric: DRE = working set size / total memory traffic (reads + writes), measuring scheduling efficiency.
- Uses performance counters on a Haswell platform to measure memory bandwidth usage and working set size for 320 LSTM benchmarks with varying configurations.
- Introduces a G-matrix splitting optimization: decomposing the concatenated weight matrix G into G1 and G2 to enable repeated reuse of G1 across time steps.
- Applies cache-blocking techniques to matrix-vector multiplication to maximize data reuse in a 12 MB LRU cache, emulating a mobile SoC.
- Develops an analytical model that generates memory access patterns based on scheduling algorithms and simulates cache misses and writebacks.
- Evaluates the optimized schedule (Schedule A+) on four real-world NLP workloads: GNMT, DeepSpeech1, LM, and byteNER, comparing against standard TensorFlow/MKL scheduling (Schedule A).
Experimental results
Research questions
- RQ1How much more data do current RNN scheduling schemes transfer compared to the actual working set size?
- RQ2What factors contribute to high memory bandwidth usage in RNN inference on CPUs?
- RQ3Can splitting the G matrix into two parts improve data reuse and reduce memory traffic?
- RQ4How effective is the G-matrix splitting optimization in reducing memory bandwidth across diverse NLP workloads?
- RQ5To what extent does the new DRE metric reflect real-world scheduling inefficiencies in RNN inference?
Key findings
- Current RNN scheduling on CPUs results in 30–50× more data movement than the working set size, indicating severe scheduling inefficiency.
- The G-matrix splitting optimization reduces memory traffic by up to 2.9× in the language modeling (LM) benchmark, particularly benefiting larger layers with smaller G1 matrices.
- For GNMT, the optimization improves DRE by a factor of 1.45 to 1.65 in encoder layers, where the optimization is applicable.
- In byteNER, a small 9.4 MB model that fits in cache, both Schedule A and A+ perform similarly due to inherent cache reuse, showing the optimization's limited benefit on small, cache-friendly models.
- The analytical model confirms that the optimized scheduler significantly reduces cache misses and memory traffic, especially in large models with high G-matrix sizes.
- The DRE metric successfully identifies scheduling inefficiencies and quantifies the impact of architectural optimizations on memory bandwidth consumption.
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.