TL;DR
This paper introduces MicroRec, an efficient recommendation inference engine that tackles the memory-bound nature of deep learning recommendation systems. By combining hardware acceleration on FPGAs with novel data structures, MicroRec achieves significant speedups and drastically reduces latency, making real-time recommendations more feasible.
What Problem Does This Paper Address?
Modern recommendation systems heavily rely on deep neural networks (DNNs). However, unlike typical DNN inference, recommendation inference is particularly challenging because it's memory-bound. This is due to the need to perform numerous random memory accesses to retrieve embedding tables, which store dense vector representations of sparse features (like user IDs or item categories). These lookups are further constrained by strict latency requirements – recommendations often need to be generated within tens of milliseconds. Existing solutions, like using CPUs or GPUs, struggle to meet these demands efficiently, either due to memory bottlenecks or high overheads, especially with small batch sizes that are often necessary to meet latency SLAs.
Methods
MicroRec addresses these challenges through a two-pronged approach:
- Hardware Acceleration on FPGA with Hybrid Memory:
- FPGA Implementation: The core inference engine is implemented on an FPGA, allowing for custom hardware acceleration.
- Hybrid Memory System: MicroRec leverages a hybrid memory architecture combining on-chip memory (BRAM/URAM), off-chip DDR DRAM, and High-Bandwidth Memory (HBM). HBM, with its numerous memory banks and high bandwidth, is crucial for parallelizing embedding lookups.
- Deeply Pipelined Dataflow: The DNN computation itself is implemented using a highly pipelined architecture, processing items individually rather than in batches to minimize latency.
- Data Structure Optimization:
- Cartesian Products: The paper introduces a novel technique of applying Cartesian products to combine multiple embedding tables. This allows a single memory access to retrieve multiple embedding vectors simultaneously, effectively reducing the number of costly random memory accesses.
- Heuristic Algorithm for Table Combination and Allocation: To manage the complexity of combining tables and allocating them across the hybrid memory system, a rule-based heuristic algorithm is proposed. This algorithm efficiently explores combinations and placements to minimize lookup latency while considering memory constraints.
Datasets
The paper evaluates MicroRec on two classes of models:
- Production Models from Alibaba: Two models with a large number of embedding tables (47 and 98 tables) were used.
- Facebook Recommendation Benchmark: Specifically, the DLRM-RMC2 model class was used for evaluation.
Key Insights and Ideas
- Embedding Lookups are the Primary Bottleneck: The paper strongly emphasizes that the random memory accesses for embedding lookups are the dominant performance bottleneck in recommendation inference, far more so than the DNN computation itself.
- HBM is Key for Parallelism: High-Bandwidth Memory (HBM) is shown to be instrumental in scaling up the concurrency of embedding lookups due to its numerous memory channels.
- Cartesian Products Offer a Novel Solution: The idea of using Cartesian products to reduce the number of memory accesses is a significant data structure innovation. It's counter-intuitive that combining tables can reduce the need for memory operations, but it does so by making each access more productive.
- Hybrid Memory is Essential: No single memory type is sufficient. The combination of fast on-chip memory, high-bandwidth HBM, and larger DDR DRAM allows for an optimized trade-off between speed, capacity, and cost.
- FPGA Enables Low Latency: The FPGA implementation, with its deeply pipelined architecture and ability to customize hardware, is critical for achieving microsecond-level latencies, far surpassing the millisecond requirements.
Key Results
- Embedding Lookup Speedup: MicroRec achieves a significant speedup of 13.8~14.7× on embedding lookups compared to an optimized CPU baseline.
- End-to-End Inference Speedup: The overall recommendation inference throughput is improved by 2.5~5.4× compared to the CPU baseline.
- Latency Reduction: End-to-end inference latency is reduced to 16.3~31.0 microseconds, which is 3 to 4 orders of magnitude lower than the typical millisecond requirements for real-time recommendations.
- Cartesian Product Benefits: Applying Cartesian products further improves lookup performance by 1.39~1.69× with minimal storage overhead (1.9~3.2%).
- HBM Benefits: HBM alone provides 8.2~11.1× speedup over the CPU baseline for embedding lookups.
Limitations and Future Work
- FPGA Prototyping: The current implementation relies on caching input features on the FPGA due to limitations in the Vitis hardware development platform for direct streaming from the host.
- Resource Utilization: The FPGA implementation shows high resource utilization (over 80% for some resources), which necessitates cross-die routing and limits the clock frequency.
- Future Work: The authors suggest that the heuristic algorithm for table combination and allocation can be expanded and modified for different models. Further optimization of the DNN computation modules and exploration of different precision levels are also potential avenues. The paper also notes that while their current models don't have bottom FC layers, future work could extend MicroRec to handle such architectures.
Summary updated