JointDNN: An Efficient Training and Inference Engine for Intelligent Mobile Cloud Computing Services

Amir Erfan Eshratifar, Mohammad Saeed Abrishami, Massoud Pedram

TL;DR

JointDNN is an adaptive framework that optimizes Deep Neural Network (DNN) performance by intelligently partitioning computations between mobile devices and cloud servers. By modeling DNNs as graphs and using Integer Linear Programming (ILP), it achieves up to 18x latency reduction and 32x energy savings for both AI inference and on-device training.

What Problem Does This Paper Address?

As deep learning models grow more complex, mobile developers face a "lose-lose" scenario. Mobile-only execution provides privacy and works offline but quickly drains batteries and struggles with high-latency processing. Cloud-only execution offloads the heavy lifting but introduces massive communication overhead (uploading raw video/audio) and leaves the user at the mercy of network congestion and server costs.

Existing solutions often treat offloading as a binary choice or only consider a single "cut" point in the network. Furthermore, most research focuses solely on inference (running a model), ignoring the growing need for online training (adapting a model to a user's environment in real-time). JointDNN addresses these gaps by providing a layer-granular, adaptive partitioning engine for both inference and training.

Methods

The authors propose a three-pronged approach to collaborative computing:

  1. Graph-Based Modeling: The framework treats a DNN as a Directed Acyclic Graph (DAG). Each layer is represented by two nodes: one for mobile execution and one for cloud execution. Edges between nodes represent the "cost"—either the computational time/energy on a specific device or the communication cost of moving data between them.
  2. Optimization via ILP: Finding the best way to split the network is reduced to a Shortest Path Problem. For simple scenarios, this is solved in polynomial time. For complex scenarios with constraints (e.g., "minimize latency but stay under 500mW of power"), the authors use Integer Linear Programming (ILP).
  3. Layer Compression: A major bottleneck in collaborative computing is the size of intermediate "feature maps" (the data passed between layers). The authors observed that after ReLU activation, these maps are highly sparse (full of zeros). They implemented a loss-less compression scheme that tiles 2D feature channels into a single large image and compresses it using PNG encoding, significantly reducing transfer sizes without losing accuracy.

Datasets

The authors evaluated JointDNN across eight diverse DNN architectures to ensure the results weren't specific to one type of task:

  • Discriminative Models: AlexNet, OverFeat, VGG16, ResNet, NiN (image classification), and Deep Speech (speech recognition).
  • Generative Models: Chair (generating 3D views).
  • Autoencoders: Pix2Pix (image-to-image translation).

Testing was performed using an NVIDIA Jetson TX2 as the mobile proxy and an NVIDIA Tesla K40C as the cloud server.

Key Insights and Ideas

  • The "Architecture Matters" Rule: The optimal split point depends heavily on the model type.
  • Discriminative models (like AlexNet) usually shrink data as it moves deeper. It’s often best to compute the first few layers on mobile to "compress" the raw input before uploading.
  • Generative models do the opposite; they start with small vectors and expand. Here, the cloud should do the heavy lifting, and the mobile device should handle the final, data-heavy layers.
  • Sparsity is a Gift: The discovery that intermediate layers are 50% to 90% "zero-valued" neurons (due to ReLU) allows for massive communication savings via standard image compression techniques.
  • Beyond Single-Point Offloading: Unlike previous work (like Neurosurgeon), JointDNN proves that a "Mobile-Cloud-Mobile" pattern is often the most efficient, especially for autoencoders where both the input and output are large.
  • Training is a Different Beast: Online training requires a "mirrored" graph for backpropagation. JointDNN accounts for the cost of downloading updated weights from the cloud, a factor often ignored in mobile AI research.

Key Results

  • Massive Efficiency Gains: Compared to the best of "mobile-only" or "cloud-only" approaches, JointDNN reduced latency by up to 66% and energy consumption by up to 86% during inference.
  • Compression Impact: The PNG-based tiling compression provided an additional 4.9x improvement in energy and 4.6x in latency on average.
  • Cloud Relief: By pushing some computation to the edge, JointDNN reduced the cloud server's workload by up to 84% (on 3G networks), allowing providers to serve more users with the same hardware.
  • Fast Optimization: Solving the ILP for a complex model like AlexNet takes only 0.045 seconds, making it practical for real-time adaptation as network conditions change.

Limitations and Future Work

The current iteration of JointDNN is optimized for feed-forward networks (CNNs and standard MLPs). While the authors mention that the framework is designed for these, they acknowledge that Recurrent Neural Networks (RNNs)—which are vital for time-series and natural language processing—require further study due to their loopy, stateful nature.

Additionally, while the compression is "loss-less" in terms of data, the 8-bit quantization required for PNG compression is a form of lossy approximation (though the authors note it typically affects accuracy by less than 1%). Future work could explore more aggressive lossy compression tailored specifically for neural activations.

Summary updated

BibTeX
@article{eshratifar2021jointdnn,
  author = {Amir Erfan Eshratifar and Mohammad Saeed Abrishami and Massoud Pedram},
  title = {{JointDNN: An Efficient Training and Inference Engine for Intelligent Mobile Cloud Computing Services}},
  journal = {IEEE Trans. Mobile Computing},
  year = {2021},
  doi = {10.1109/tmc.2019.2947893},
}
Figure