MXNet: A Flexible and Efficient Machine Learning Library for Heterogeneous Distributed Systems

Tianqi Chen, Mu Li, Yutian Li, Min Lin, Naiyan Wang, Minjie Wang, Tianjun Xiao, Bing Xu, Chiyuan Zhang, Zheng Zhang

Introduction

MXNet is an open-source deep learning framework designed to bridge the gap between two historically competing programming paradigms: imperative and declarative programming. While imperative frameworks like NumPy or Torch offer flexibility and ease of debugging, declarative frameworks like Theano or early TensorFlow allow for superior global optimization and memory management. MXNet provides a "mix-net" approach, blending declarative symbolic programming for graph optimization with imperative tensor computation for flexibility.

System Architecture and Methods

The core of MXNet is a hybrid programming interface supported by a highly optimized execution engine. Developers can use Symbol to declare computation graphs for static layers and NDArray for imperative operations, such as custom parameter updates.

MXNet System Architecture: A multi-layered stack supporting various languages and hardware backends.

Key components include:

  • Unified Dependency Engine: Schedules both declarative and imperative operations by tracking mutations as resource units, enabling safe parallel execution.
  • Memory Optimization: MXNet employs two linear-time heuristics—inplace (reusing memory when reference counts hit zero) and co-share (sharing memory between non-parallel nodes)—to drastically reduce the memory footprint.
  • KVStore: A distributed key-value store that manages data synchronization across multiple GPUs and network nodes, optimizing for available bandwidth.

Performance Evaluation

The framework was evaluated using standard benchmarks like ILSVRC12 (ImageNet) and the convnet-benchmarks suite across architectures such as AlexNet, GoogLeNet, and VGG.

Performance comparison of MXNet against TensorFlow, Caffe, and Torch7 across standard neural network architectures.

Key Results

  • Raw Speed: MXNet matches the performance of Caffe and Torch7. In early benchmarks, it significantly outperformed contemporary versions of TensorFlow, processing models like VGG nearly twice as fast.
  • Memory Efficiency: The memory heuristics reduced footprints by 2x during training and 4x during inference. For instance, the VGG network required minimal extra memory overhead beyond the weights themselves.
  • Scalability: Distributed training on 10 Amazon EC2 instances (40 GPUs) showed super-linear speedup for GoogLeNet, reducing data pass times from 14,000 seconds to 1,400 seconds.

Conclusion

MXNet demonstrates that a library can be both flexible for researchers and efficient for production-scale distributed systems. By treating mutations as dependencies and applying aggressive memory reuse, it scales from mobile devices to large GPU clusters. While early comparisons with other frameworks were influenced by specific library versions (like cuDNN), MXNet's architectural innovations established it as a major player in the deep learning ecosystem.

Summary updated

BibTeX
@misc{chen2015mxnet,
  author = {Tianqi Chen and Mu Li and Yutian Li and Min Lin and Naiyan Wang and Minjie Wang and Tianjun Xiao and Bing Xu and Chiyuan Zhang and Zheng Zhang},
  title = {{MXNet: A Flexible and Efficient Machine Learning Library for Heterogeneous Distributed Systems}},
  year = {2015},
  eprint = {1512.01274},
  archivePrefix = {arXiv},
  url = {https://arxiv.org/abs/1512.01274},
}
Figure