BigDL: A Distributed Deep Learning Framework for Big Data

Jason Jinquan Dai, Yiheng Wang, Xin Qiu, Ding Ding, Yao Zhang, Yanzhang Wang, Xianyan Jia, Cherry Li Zhang, Yan Wan, Zhichao Li, Jiao Wang, Shengsheng Huang, Zhongyuan Wu, Yang Wang, Yuhao Yang, Bowen She, Dongjie Shi, Qi Lu, Kai Huang, Guoqiong SongSoCC 2018 · DOI

Abstract

BigDL is a distributed deep learning framework built natively on top of Apache Spark, allowing users to run deep learning workloads directly on existing big data clusters. By implementing synchronous data-parallel training within Spark’s functional compute model, it eliminates the "impedance mismatch" and data transfer overhead typically found when connecting separate big data and AI systems.

Introduction

In production environments, "big data" usually lives in distributed systems like Apache Hadoop or Spark, which favor coarse-grained, immutable, and functional operations. Conversely, popular deep learning (DL) frameworks like TensorFlow or PyTorch are designed for fine-grained, stateful, in-place updates.

When organizations try to combine these, they usually adopt a "connector" approach (e.g., TensorFlowOnSpark). This leads to several challenges: an impedance mismatch where independent big data tasks clash with coordinated DL tasks, increased operational complexity from managing dual clusters, and massive data transfer overhead when moving datasets between ETL and GPU training environments. BigDL aims to solve this by making deep learning "just another Spark job."

Methods

BigDL is implemented as a library on top of Spark. Its core innovation is proving that efficient distributed training is possible using Spark’s functional, copy-on-write model.

Native Spark Execution

Data is represented as a Sample RDD, while the neural network itself is contained within a Model RDD. These are co-located and cached in memory across the cluster to minimize latency.

Co-location of Sample and Model RDDs across Spark workers.

Synchronous Data-Parallel Training

Training happens in an iterative process. Each iteration consists of two short-lived Spark jobs:

  1. Model Forward-Backward: Tasks compute local gradients on their local data partitions in parallel.
  2. Parameter Synchronization: An AllReduce-like operation implemented using Spark primitives (shuffle, broadcast). It aggregates gradients, updates weights, and broadcasts the new parameters for the next iteration.

This architecture leverages Spark's native resilience; if a task fails, Spark simply re-runs that specific stateless task, avoiding the complex checkpointing required by other frameworks.

Key Results

BigDL was evaluated using standard benchmarks like MovieLens 20Million (for Neural Collaborative Filtering) and ImageNet (for Inception-v1), as well as real-world production data from partners like JD.com and Cray.

Performance comparison showing BigDL NCF outperforming reference PyTorch NCF.
  • Competitive Performance: For NCF training on a single Intel Xeon server, BigDL was 1.6x faster than the reference PyTorch implementation running on a high-end Nvidia P100 GPU.
  • Linear Scalability: Training Inception-v1 on ImageNet showed almost linear throughput scaling up to 96 nodes, and continued to scale well up to 256 nodes.
  • Real-World Impact: JD.com reported that their end-to-end image feature extraction pipeline was 3.83x faster on BigDL compared to their previous Caffe-based GPU solution, largely due to eliminating data transfer bottlenecks.

Discussion and Key Insights

BigDL challenges the conventional wisdom that fine-grained, in-place updates are mandatory for performance. It demonstrates that coarse-grained, functional operations can be highly efficient if synchronization is optimized. Furthermore, by running training as a sequence of short Spark jobs rather than long-running stateful tasks, BigDL is much more robust to cluster dynamics like node preemption.

The primary value proposition is the "Data-Analytics Integrated" model, allowing complex ETL and DL training/inference to occur in a single, unified pipeline without leaving the Spark ecosystem.

Limitations and Future Work

Currently, BigDL only supports data parallelism, assuming the entire model can fit into the memory of a single node. While modern Xeon nodes often have hundreds of gigabytes of RAM, model parallelism remains a future area of exploration. Additionally, because BigDL launches many short Spark jobs, the Spark driver's task scheduling can become a bottleneck at very high scales. The authors suggest using low-latency execution engines like "Drizzle" to mitigate this in the future.

Summary updated

BibTeX
@inproceedings{dai2018bigdl,
  author = {Jason Jinquan Dai and Yiheng Wang and Xin Qiu and Ding Ding and Yao Zhang and Yanzhang Wang and Xianyan Jia and Cherry Li Zhang and Yan Wan and Zhichao Li and Jiao Wang and Shengsheng Huang and Zhongyuan Wu and Yang Wang and Yuhao Yang and Bowen She and Dongjie Shi and Qi Lu and Kai Huang and Guoqiong Song},
  title = {{BigDL: A Distributed Deep Learning Framework for Big Data}},
  booktitle = {SoCC},
  year = {2018},
  doi = {10.1145/3357223.3362707},
}
Figure