BigDL 2.0: Seamless Scaling of AI Pipelines from Laptops to Distributed Cluster

Jason Jinquan Dai, Ding Ding, Dongjie Shi, Shengsheng Huang, Jiao Wang, Xin Qiu, Kai Huang, Guoqiong Song, Yang Wang, Qiyuan Gong, Jiaming Song, Shan Yu, Le Zheng, Yina Chen, Junwei Deng, Ge Song

TL;DR

BigDL 2.0 is an open-source Big Data AI toolkit designed to seamlessly scale AI pipelines from a single laptop to a distributed cluster without requiring intrusive code changes. By combining transparent single-node hardware acceleration (yielding up to a 9.6x speedup) with automated distributed scaling via Apache Spark and Ray, it allows data scientists to transition effortlessly from local prototyping to production-scale deployment.

What Problem Does This Paper Address?

Most AI projects begin as Python notebooks running locally on a data scientist's laptop. However, scaling these prototypes to handle massive production-scale datasets is notoriously difficult.

To fully exploit modern hardware, developers typically have to navigate a complex maze of low-level optimizations, such as SIMD instructions, multi-processing, quantization, and memory allocation tuning. Furthermore, moving from a single machine to a distributed cluster usually requires completely rewriting data ingestion and training loops to fit distributed frameworks. This manual, error-prone process creates a massive gap between AI development and production deployment.

Methods

BigDL 2.0 bridges this gap by introducing two core libraries that preserve standard APIs (like PyTorch, TensorFlow, and Keras) while optimizing performance under the hood:

  1. BigDL-Nano: Focuses on single-node acceleration. It transparently injects hardware-specific optimizations (such as Intel Extension for PyTorch, ONNX Runtime, OpenVINO, and INT8 quantization) into standard deep learning code. Often, users only need to change their import statements to see a performance boost. It also includes built-in AutoML for automated hyperparameter tuning.
Figure 1. BigDL-Nano architecture
  1. BigDL-Orca: Handles seamless scaling to distributed clusters by automatically provisioning Apache Spark and Ray. It supports distributed, in-memory data pipelines and introduces XShards, an API that automatically partitions standard Python objects (like Pandas DataFrames or Numpy arrays) across a cluster, allowing users to run data-parallel code without rewriting their core logic.
Figure 7. BigDL-Orca architecture

Datasets

The authors evaluated the single-node performance of BigDL-Nano using a classic image classification pipeline (cats vs. dogs) based on the ResNet50 architecture.

While no new benchmarks were introduced, the paper highlights massive, real-world production datasets used by early adopters. For instance, Mastercard utilized BigDL 2.0 to process data for up to 2.2 billion users and hundreds of billions of records.

Key Insights and Ideas

  • Drop-in Acceleration: Data scientists shouldn't have to become systems engineers. By intercepting standard framework APIs, BigDL-Nano applies advanced optimizations like INT8 quantization and graph optimization automatically with just a couple of extra lines of code.
Figure 3. Example of PyTorch inference with quantization and onnx using BigDL-Nano. Only 2 extra lines of code are needed to enable quantization [6] and ONNX Runtime [7] at the same time.
  • Reorganize, Don't Rewrite: Instead of forcing users to learn entirely new distributed data APIs, BigDL-Orca's XShards allows existing Python code to be executed in a data-parallel fashion simply by wrapping the local functions.
Figure 10. Example of using XShards. The original transforma- tion df[column name] = df[column name] * (-1) is reorganized into a function negative and applied on shard par- titions using transform shard.
  • Ray on Spark Co-location: To avoid the heavy serialization and network overhead of moving data between separate big data storage and deep learning clusters, BigDL-Orca launches Ray processes directly inside Spark executors. This allows deep learning applications to run directly on top of in-memory Spark RDDs or DataFrames.

Key Results

The authors evaluated BigDL 2.0 across two hardware environments: a standard 8-core laptop and a 28-core server container.

  • Laptop Performance: BigDL-Nano achieved up to a 1.66x speedup in training throughput (via transfer learning) and a 5.29x speedup in inference throughput using INT8 quantization.
Figure 5. Speedup of BigDL-Nano for training and inference on Laptop
  • Container Performance: On more powerful hardware, the acceleration scaled even better, delivering up to a 5.85x speedup in training and a massive 9.65x speedup in inference.
Figure 6. Speedup of BigDL-Nano and training and inference on Container
  • Production Impact:
  • Mastercard successfully scaled their deep learning workflows across standard Intel Xeon clusters, keeping AI training times under 5 hours for billions of records without needing specialized hardware.
  • Inspur built a smart transportation solution that achieved 30% higher performance and 40% lower costs for an end-to-end computer vision pipeline.

Limitations and Future Work

Not discussed in the paper.

Summary updated

BibTeX
@misc{dai2022bigdl,
  author = {Jason Jinquan Dai and Ding Ding and Dongjie Shi and Shengsheng Huang and Jiao Wang and Xin Qiu and Kai Huang and Guoqiong Song and Yang Wang and Qiyuan Gong and Jiaming Song and Shan Yu and Le Zheng and Yina Chen and Junwei Deng and Ge Song},
  title = {{BigDL 2.0: Seamless Scaling of AI Pipelines from Laptops to Distributed Cluster}},
  year = {2022},
  eprint = {2204.01715},
  archivePrefix = {arXiv},
  url = {https://arxiv.org/abs/2204.01715},
}
Figure