TL;DR
This paper introduces MLKV, a novel data storage framework designed to efficiently train massive embedding models that exceed available RAM. By leveraging disk-based key-value stores and democratizing optimizations like bounded staleness and look-ahead prefetching, MLKV significantly improves training throughput and scalability while maintaining extensibility and reusability.
What Problem Does This Paper Address?
Modern machine learning applications, particularly in areas like recommendation systems, knowledge graphs, and graph neural networks, rely heavily on embedding models. These models learn vector representations for entities, and as datasets grow and applications become more sophisticated, these embedding tables can reach enormous sizes – tens of terabytes or more. Training such large models poses significant challenges, primarily:
- Data Stalls: When training synchronously, the neural network must wait for embedding vectors to be fetched from storage and for gradients to be updated, leading to idle GPU time and reduced throughput.
- Staleness: To mitigate data stalls, asynchronous training is often used, but this can lead to outdated embedding vectors, slowing down convergence and degrading model quality.
Existing frameworks often reinvent specialized storage solutions for each task, leading to duplicated engineering effort and difficult deployment. Furthermore, traditional disk-based key-value stores struggle with the scale and performance demands of large-scale embedding model training. MLKV aims to bridge this gap by providing a unified, efficient, and extensible solution.
Methods
MLKV is built upon the FASTER key-value store, a log-structured storage system. Its core innovations lie in democratizing and integrating two key optimizations:
- Bounded Staleness Consistency: MLKV introduces a
staleness_boundparameter that allows users to control the trade-off between training speed and model accuracy. By setting this bound, users can achieve different consistency models: staleness_bound = 0: Bulk Synchronous Parallel (BSP) mode.staleness_bound = infinity: Asynchronous Parallel (ASP) mode.-
Intermediate values: Stale Synchronous Parallel (SSP) mode. This is implemented by augmenting the record format with vector clocks, stealing unused bits to track staleness per key-value pair.
-
Look-Ahead Prefetching: Inspired by read-ahead techniques in databases, MLKV allows applications to proactively load embedding vectors from disk into the storage system's buffer pool ahead of time. This goes beyond conventional prefetching by bringing in data beyond immediate staleness bounds, effectively hiding disk I/O latency during training. A non-blocking
Lookaheadinterface is provided for this purpose.
MLKV also provides a clean separation between the application logic (e.g., neural network training) and the storage management through simple Open, Get, and Put interfaces. This promotes extensibility and reusability.
Datasets
The paper evaluates MLKV using a variety of datasets:
- Open-Source Datasets:
- Criteo-Ad (for DLRM training)
- WikiKG2 (for KGE training)
- Papers100M (for GNN training)
- Freebase86M (for KGE training)
- Criteo-Terabyte (for DLRM training)
- Real-World Production Datasets (from eBay):
- eBay-Trisk (payment transaction risk detection)
- eBay-Payout (seller payment risk detection)
- Benchmark Workload:
- YCSB (for NoSQL benchmarking)
Key Insights and Ideas
- Unified Framework for Diverse Tasks: MLKV demonstrates that a single storage framework can efficiently handle diverse embedding model training tasks (DLRM, KGE, GNN) by abstracting away storage complexities.
- Democratizing Optimizations: Key optimizations like bounded staleness and look-ahead prefetching, previously confined to specialized frameworks, are made accessible and configurable within MLKV, simplifying their adoption.
- Disk-Based Key-Value Stores are Viable: The paper shows that with appropriate optimizations, disk-based key-value stores can be a performant and scalable solution for large embedding model training, challenging the notion that only in-memory solutions are sufficient.
- Staleness-Accuracy Trade-off is Controllable: The
staleness_boundparameter provides a practical mechanism for users to tune performance versus model quality, allowing for significant speedups with minimal accuracy degradation. - Look-Ahead Prefetching's Impact: While bounded staleness is crucial, look-ahead prefetching further boosts throughput, especially when staleness bounds are low, by proactively fetching data.
Key Results
- Performance: MLKV outperforms industrial-strength key-value stores by 1.6-12.6× on larger-than-memory workloads.
- Scalability: MLKV effectively handles embedding models exceeding available RAM, demonstrating significant speedups (e.g., 1.08-2.44× for DLRM, 1.36-4.89× for KGE, 1.53-12.57× for GNN) compared to other solutions on larger datasets.
- Bounded Staleness: Relaxing staleness bounds in MLKV can achieve up to 6.58× speedup with less than 0.1% drop in AUC, whereas traditional asynchronous methods can lead to much larger AUC drops.
- Extensibility & Reusability: MLKV achieves comparable convergence times to specialized frameworks when models fit in memory, showcasing its efficiency and broad applicability.
- Cost-Effectiveness: In eBay's case studies, MLKV enabled comparable training throughput with fewer resources compared to existing distributed solutions.
Limitations and Future Work
- YCSB Overhead: In YCSB workloads, MLKV incurs a performance gap of less than 10% (uniform access) and 20% (skewed access) compared to FASTER, attributed to the overhead of vector clocks, which is more pronounced in skewed access patterns. However, this overhead is eliminated if bounded staleness is disabled.
- Future Work: The paper suggests that MLKV's design principles can be applied to other key-value store backends (e.g., B+trees). Further exploration of customized caching strategies with look-ahead prefetching is also implied. The authors also mention that their work is open-source, inviting community contributions and extensions.
Summary updated