Skip to main content
QUICK REVIEW

[Paper Review] SparkNet: Training Deep Networks in Spark

Philipp Moritz, Robert Nishihara|arXiv (Cornell University)|Nov 19, 2015
Advanced Neural Network ApplicationsComputer Science18 references75 citations
TL;DR

SparkNet enables scalable, out-of-the-box training of deep neural networks in Apache Spark by integrating with Caffe and using a lightweight, communication-efficient parallelization of stochastic gradient descent (SGD). It achieves significant speedup on large-scale datasets like ImageNet even in bandwidth-limited environments, with minimal tuning and seamless integration into existing data pipelines.

ABSTRACT

Training deep networks is a time-consuming process, with networks for object recognition often requiring multiple days to train. For this reason, leveraging the resources of a cluster to speed up training is an important area of work. However, widely-popular batch-processing computational frameworks like MapReduce and Spark were not designed to support the asynchronous and communication-intensive workloads of existing distributed deep learning systems. We introduce SparkNet, a framework for training deep networks in Spark. Our implementation includes a convenient interface for reading data from Spark RDDs, a Scala interface to the Caffe deep learning framework, and a lightweight multi-dimensional tensor library. Using a simple parallelization scheme for stochastic gradient descent, SparkNet scales well with the cluster size and tolerates very high-latency communication. Furthermore, it is easy to deploy and use with no parameter tuning, and it is compatible with existing Caffe models. We quantify the dependence of the speedup obtained by SparkNet on the number of machines, the communication frequency, and the cluster's communication overhead, and we benchmark our system's performance on the ImageNet dataset.

Motivation & Objective

  • To enable distributed training of deep networks in general-purpose batch processing frameworks like Spark, which are not natively optimized for communication-intensive deep learning workloads.
  • To address the challenge of high-latency communication in cluster environments by designing a communication-efficient SGD parallelization scheme.
  • To provide a user-friendly interface that allows training deep networks directly on data from Spark RDDs, SQL queries, or graph computations without data movement.
  • To ensure compatibility with existing Caffe models and enable deployment on standard cloud infrastructure like EC2 without specialized hardware.
  • To demonstrate that a simple, lightweight approach can achieve near-optimal performance in real-world, bandwidth-limited settings.

Proposed method

  • SparkNet uses a simple parallelization scheme for stochastic gradient descent (SGD) that minimizes communication overhead by reducing the frequency and volume of parameter synchronization between workers and parameter servers.
  • It integrates natively with Apache Spark via a Scala API that exposes data loading from RDDs, model training, and evaluation in a functional style.
  • The framework leverages Caffe’s deep learning capabilities through Java Native Access (JNA) and Protocol Buffers to dynamically construct and execute deep networks at runtime.
  • It employs a lightweight multi-dimensional tensor library to manage model weights and gradients efficiently within the Spark execution model.
  • Communication between workers and parameter servers is handled via batched parameter synchronization, tolerating high-latency networks by minimizing round-trip frequency.
  • The system is designed to work out-of-the-box on standard clusters, including cloud environments like EC2, without requiring low-latency interconnects like InfiniBand.

Experimental results

Research questions

  • RQ1Can deep learning training be effectively and efficiently scaled in general-purpose batch processing frameworks like Spark, despite their design limitations for communication-intensive workloads?
  • RQ2How does the performance of SparkNet scale with increasing cluster size, communication frequency, and network latency in bandwidth-limited environments?
  • RQ3To what extent can a simple, lightweight SGD parallelization scheme achieve competitive performance compared to custom, low-level deep learning frameworks?
  • RQ4Can SparkNet seamlessly integrate model training into existing data processing pipelines involving SQL, graph computations, or streaming data without data shuffling or disk I/O?
  • RQ5What is the practical trade-off between communication frequency and training speed in real-world cluster deployments?

Key findings

  • SparkNet achieves significant speedup on the ImageNet benchmark even with a small number of GPUs, demonstrating effective scaling on real-world datasets.
  • On a five-node EC2 cluster, parameter broadcasting and collection take approximately 20 seconds for several-hundred-megabyte models, and a single minibatch computation takes about 2 seconds for AlexNet.
  • The system performs well in bandwidth-limited environments, tolerating high-latency communication without requiring specialized hardware like InfiniBand.
  • The approach enables end-to-end training pipelines that integrate data from SQL, graph, or streaming sources directly into deep learning workflows, avoiding costly I/O and data movement.
  • The implementation is compatible with existing Caffe models and requires minimal code changes, enabling easy adoption and integration.
  • The framework demonstrates that a simple, communication-optimized SGD scheme can achieve near-optimal performance in practice, even when compared to systems relying on low-latency communication.

Read this paper

Open the full text in the Nubint reader and ask about any passage as you read.

Read this paper on Nubint

This review was generated by AI from the original paper. Please check the paper before citing it.