TL;DR
This paper introduces SEDD, a highly efficient GPU-accelerated framework for dataset deduplication, crucial for improving the quality and training of large language models. SEDD significantly speeds up the process by optimizing MinHash LSH with novel hash functions and a streaming pipeline, outperforming existing CPU and GPU solutions by orders of magnitude.
What Problem Does This Paper Address?
Training large language models (LLMs) requires massive datasets, but these datasets often contain a significant amount of duplicate or near-duplicate content. This redundancy wastes computational resources, skews data distributions, and can negatively impact model performance and generalization. While techniques like MinHash Locality-Sensitive Hashing (LSH) exist for identifying these duplicates, existing frameworks, even GPU-accelerated ones like NVIDIA NeMo Curator, struggle with high communication overhead and underutilization of GPU resources, especially at the trillion-token scale. This paper aims to bridge this gap by proposing a more efficient and scalable GPU-based deduplication framework.
Methods
SEDD introduces several key innovations to optimize the MinHash LSH process for distributed GPU clusters:
- Computationally Efficient Hash Function: SEDD employs a Rabin-Karp rolling hash function. This allows for the reuse of previously computed hash values for adjacent shingles, significantly reducing the computational cost compared to recomputing hashes from scratch for each shingle.
- Hardware-Aware Parameter Tuning: The framework automatically adjusts parameters like storage strategy (in-memory vs. disk-based), concurrent bucket processing, and maximum bucket size to maximize resource utilization based on available CPU and GPU memory.
- Streaming-Based Data Pipeline: Instead of relying on physical data shuffling (a major bottleneck in existing GPU frameworks), SEDD uses an on-the-fly streaming extraction strategy. This allows for communication and computation to be overlapped, hiding data transfer latency.
- Optimized GPU Kernels: SEDD utilizes custom CUDA kernels for pairwise comparison, inspired by GEMM (General Matrix Multiply) designs, to improve data locality and leverage GPU parallelism effectively.
- Dense Bucketing Strategy: SEDD uses a dense bucketing strategy with a carefully chosen number of buckets (K = 4√N) to balance the trade-off between collision probability and management overhead.
Datasets
The paper evaluates SEDD using the following datasets:
- RealNews Dataset: A large English corpus of news articles from Common Crawl.
- C4 Dataset: A filtered version of Common Crawl.
- RedPajama-1T: A dataset comprising 1.2 trillion tokens, used for large-scale experiments.
The paper does not introduce new benchmarks but rather focuses on evaluating its framework against existing tools on these standard large-scale datasets.
Key Insights and Ideas
- Communication is the Bottleneck: The paper strongly emphasizes that for large-scale GPU deduplication, communication overhead (especially data shuffling) is a more significant bottleneck than raw computation. SEDD's success hinges on minimizing this.
- Rolling Hash Efficiency: The rolling hash function is a critical component, offering substantial speedups in MinHash signature generation by avoiding redundant computations.
- Hardware-Awareness is Key: SEDD's ability to adapt its execution strategy based on available hardware resources (CPU/GPU memory) is crucial for achieving optimal performance across different systems.
- Streaming Outperforms Shuffling: The shift from physical data shuffling to a streaming approach dramatically reduces I/O latency and communication volume, leading to significant performance gains.
- Accuracy is Preserved: Despite the aggressive optimizations for speed, SEDD maintains high deduplication fidelity, achieving Jaccard similarities comparable to standard MinHash.
Key Results
- Speedup:
- SEDD outperforms the CPU-based SlimPajama by up to 158x on a single node with four GPUs.
- SEDD achieves up to 7.8x speedup over the GPU-based NVIDIA NeMo Curator on a single node with four GPUs.
- The MinHash signature generation phase alone sees speedups of up to 375x over the CPU baseline.
- Large-Scale Performance: SEDD deduplicated 1.2 trillion tokens in approximately 3 hours on an 8-node, 32-GPU V100 cluster.
- Accuracy: Duplicate document sets identified by SEDD achieved Jaccard similarities of over 0.95 compared to those identified by the standard MinHash algorithm.
- Communication Efficiency: SEDD reduced communication latency by 5.2x and communication volume by 8.6x compared to the GPU baseline.
Limitations and Future Work
- Limitations:
- The paper acknowledges that for smaller datasets, performance saturation can occur beyond a certain number of GPUs due to fixed communication and synchronization overheads.
- While SEDD aims for broad compatibility, its performance is tuned for specific hardware configurations (e.g., V100 GPUs), and further testing on diverse architectures might be beneficial.
- Future Work:
- The authors suggest further investigation into the robustness of SEDD across different GPU architectures, which they briefly touch upon with RTX 3090 tests.
- While not explicitly stated as future work, the paper's focus on optimizing MinHash LSH implies that similar optimization techniques could potentially be applied to other approximate nearest neighbor search algorithms.
Summary updated