A comprehensive study on challenges in deploying deep learning based software

Zhenpeng Chen, Yanbin Cao, Yuanqiang Liu, Haoyu Wang, Tao Xie, Xuanzhe Liu

TL;DR

While building a deep learning (DL) model is hard, getting it to actually run in production is often harder. This paper presents the first comprehensive empirical study of DL software deployment challenges by analyzing over 3,000 Stack Overflow posts, revealing that deployment issues are significantly more difficult to resolve than development ones and providing a detailed taxonomy of 72 specific hurdles developers face.

What Problem Does This Paper Address?

In the world of AI, the "training" phase gets most of the glory, but the "deployment" phase is where the rubber meets the road. Developers need to take models trained on powerful PC clusters and squeeze them onto mobile devices, embed them in web browsers, or scale them across cloud servers.

Figure 1: The transition from DL development (training) to deployment across various platforms.

The authors identify a major "knowledge gap": while software engineering research has extensively studied how to develop and debug DL programs, the specific challenges of deploying them remain under-investigated. This leads to a "deployment wall" where models fail to run due to environment mismatches, unsupported operators, or performance bottlenecks that weren't apparent during training.

Methods

The researchers followed a five-step methodology to quantify and categorize these challenges:

  1. Data Collection: They extracted a massive dataset from the official Stack Overflow (SO) data dump, covering posts from 2008 to late 2019.
  2. Filtering: They identified 3,023 posts specifically related to DL deployment across three major platforms: Server/Cloud, Mobile, and Browser.
  3. Trend Analysis: They calculated the growth in users and questions over time to measure the topic's popularity.
  4. Difficulty Assessment: They compared deployment questions against non-deployment DL questions using metrics like the percentage of "no accepted answer" and the median response time.
  5. Taxonomy Construction: Through a grueling 450 man-hour manual inspection of 769 sampled posts, they used "open coding" to build a hierarchical taxonomy of 72 specific challenge categories.

Datasets

The study relies on the Stack Overflow Data Dump (July 31, 2008, to December 1, 2019).

  • Initial Set: 70,669 questions related to top DL frameworks (TensorFlow, Keras, PyTorch, etc.).
  • Relevant Set: 3,023 questions specifically about deployment (1,325 for Server/Cloud, 1,533 for Mobile, and 165 for Browser).
  • Manual Analysis Sample: 769 posts used to build the taxonomy.

Key Insights and Ideas

  • Deployment is "Hard Mode": Deployment questions are significantly more difficult to resolve than other DL-related topics. They have a higher rate of remaining unanswered and take nearly three times longer to get an accepted answer compared to non-deployment questions.
  • The "Mobile Surge": Interest in mobile DL deployment skyrocketed in 2017, coinciding with the release of frameworks like TF Lite and Core ML.
  • The Pre-processing Pitfall: A common "aha" moment in the paper is the discovery that many deployment failures stem from developers forgetting to migrate their data pre-processing code (often written in Python) to the target platform's language (like Java or C++), leading to silent data mismatches.
  • Documentation is the Bottleneck: Many developers are stuck not because of complex math, but because of "jargon-heavy" or "unfledged" documentation. Framework vendors often hide crucial configuration details behind layers of hyperlinks or fail to explain basic concepts.

Key Results

The quantitative findings underscore the severity of the deployment challenge:

  • Unanswered Questions: 70.7% of deployment questions have no accepted answer, compared to 62.7% for other DL topics.
  • Response Time: The median time to get an answer for deployment issues is 404.9 minutes, whereas non-deployment issues are resolved in roughly 145.8 minutes.
  • Platform Specifics:
    • Mobile developers struggle most with Model Conversion (26.5%) and Integration (21.2%).
  • Server/Cloud developers are most plagued by Data Processing (19.8%) and Environment setup (19.4%).
  • Browser developers face unique hurdles in Model Loading (24.0%), particularly with asynchronous loading and local file system access.
Figure 5: The comprehensive taxonomy of 72 challenges across Server, Mobile, and Browser platforms.

Limitations and Future Work

The authors acknowledge that their study is limited to a single data source (Stack Overflow), which might miss insights from professional internal bug trackers or direct developer interviews. Furthermore, the automated keyword matching used for the initial filtering could introduce some bias.

Future Directions: * Automated Tools: There is a clear need for automated fault localization tools that can pinpoint whether a failure happened during model export, data pre-processing, or inference. * Configuration Checkers: Researchers should develop tools to automatically detect misconfigurations in environment variables and model signatures. * Better Documentation: Framework vendors (like Google and Apple) need to improve the usability and completeness of their deployment guides, focusing on "targeted learning" for developers who may be experts in SE but novices in DL (or vice versa).

Summary updated

BibTeX
@inproceedings{chen2020comprehensive,
  author = {Zhenpeng Chen and Yanbin Cao and Yuanqiang Liu and Haoyu Wang and Tao Xie and Xuanzhe Liu},
  title = {{A comprehensive study on challenges in deploying deep learning based software}},
  booktitle = {ESEC/SIGSOFT FSE},
  year = {2020},
  doi = {10.1145/3368089.3409759},
}
Figure