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 · DOI

Abstract

Most AI projects start with a Python notebook running on a single laptop; however, one usually needs to go through a "mountain of pains" to scale it to handle larger datasets for both experimentation and production deployment. These usually entail many manual and error-prone steps for data scientists to fully take advantage of available hardware resources (e.g., SIMD instructions, multi-processing, quantization, memory allocation optimization, data partitioning, distributed computing, etc.). To address this challenge, we have open-sourced BigDL 2.0. Using BigDL 2.0, users can build conventional Python notebooks on their laptops, which can then be transparently accelerated on a single node (with up to 9.6x speedup) and seamlessly scaled out to a large cluster. BigDL 2.0 has already been adopted by many real-world users, such as Mastercard, Burger King, and Inspur, in production.

Introduction: The "Mountain of Pains" in AI Scaling

Moving an AI project from a prototype on a laptop to a production-ready pipeline on a distributed cluster is notoriously difficult. It often involves manual code rewrites, complex hardware tuning, and the headache of managing distributed environments. BigDL 2.0 is an integrated framework designed to make this transition seamless, allowing data scientists to use standard APIs like PyTorch and TensorFlow while transparently leveraging high-performance computing resources.

BigDL-Nano: Local Acceleration

The first component, BigDL-Nano, focuses on single-node performance. It "wraps" standard frameworks like PyTorch Lightning or TensorFlow Keras. By changing just a few lines of import code, it automatically applies optimizations such as:

  • Low-precision quantization: Automatically converting models to INT8 for faster inference.
  • Runtime optimizations: Seamlessly integrating ONNX Runtime or OpenVINO.
  • Hardware-specific tuning: Utilizing SIMD instructions and improved memory allocation.

BigDL-Orca: Seamless Distributed Scaling

The second component, BigDL-Orca, handles the transition to distributed clusters. It acts as a bridge between the AI ecosystem (PyTorch, TensorFlow) and the Big Data ecosystem (Apache Spark, Ray).

The BigDL-Orca architecture bridges standard AI frameworks with distributed big data runtimes like Spark and Ray.

Orca introduces two key abstractions:

  1. XShards: Allows users to process large-scale data using familiar Python/Pandas-style code, which is then automatically sharded and executed across a cluster.
  2. Estimator API: Provides a scikit-learn-style interface that manages distributed training and inference, automatically handling data partitioning and model replication.

By running Ray on top of Spark (RayOnSpark), the framework allows users to perform heavy data preprocessing and complex deep learning training within a single, unified program, eliminating the need to move data between different clusters.

Performance and Real-World Impact

Quantitative benchmarks demonstrate significant efficiency gains across different hardware configurations. On a 28-core server container, BigDL-Nano achieved up to a 9.6x speedup for inference by combining INT8 quantization with the ONNX Runtime.

Performance speedups achieved by BigDL-Nano on a 28-core server, showing up to 9.6x improvement in inference throughput.

In transfer learning scenarios, the toolkit provided up to a 5.8x speedup in training throughput. These improvements translate directly to real-world productivity. For instance, at Mastercard, BigDL 2.0 enabled AI training jobs processing billions of records to complete in just 5 hours across several hundred Intel Xeon servers.

Conclusion

BigDL 2.0 addresses the friction between local development and large-scale deployment. By automating low-level optimizations and providing a unified bridge to distributed runtimes, it allows data scientists to focus on modeling rather than infrastructure "plumbing." Future work will continue to integrate emerging AI libraries to maintain this transparent scaling experience.

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