Decide: Knowledge-Based Version Incompatibility Detection in Deep Learning Stacks

Zihan Zhou, Zhongkai Zhao, Bonan Kou, Tianyi Zhang · DOI

TL;DR

Deep learning projects often fail due to version incompatibilities between libraries. This paper introduces DECIDE, a novel web-based tool that visualizes a knowledge graph of version compatibility information extracted from Stack Overflow discussions. DECIDE helps developers quickly identify and understand these complex dependencies, reducing build failures.

What Problem Does This Paper Address?

Deep learning (DL) applications are built on intricate stacks of libraries, runtimes, drivers, and operating systems. Managing the versions of these components is a significant challenge, often leading to "dependency hell" and build failures. While official documentation exists, it's frequently incomplete or outdated. Existing automated tools primarily focus on Python package dependencies and overlook real-world, undocumented issues that developers encounter and discuss on platforms like Stack Overflow. This paper aims to bridge this gap by leveraging the rich, practical knowledge found in Stack Overflow discussions to detect and visualize version incompatibilities within DL stacks.

Methods

The core of DECIDE is a knowledge graph constructed from Stack Overflow (SO) discussions. The process involves:

  1. Data Collection and Filtering: Millions of SO posts were collected, filtered for DL-related tags, and then further refined using linguistic patterns to identify posts discussing version compatibility. Ultimately, 355,000 posts were selected.
  2. DL Stack Component Recognition: A mechanism was developed to identify paragraphs containing version compatibility information. This includes recognizing 48 popular DL components across five layers (library, runtime, driver, OS/container, hardware) and using regex patterns to identify version numbers.
  3. Compatibility Inference: A pre-trained Question-Answering (QA) model, UnifiedQA, is employed to infer compatibility. The relevant paragraphs from SO posts serve as context, and specific yes/no questions are posed to the model to determine if two versioned components are compatible or incompatible. The relationship with the highest confidence score (derived from the number of supporting posts) is chosen.
  4. Knowledge Graph Construction: The inferred compatibility relationships are consolidated into a knowledge graph. This graph is then visualized using the D3.js JavaScript library.

DECIDE offers three main functionalities: a visualizer for the knowledge graph, a search bar that uses GPT-4's function calling ability to parse natural language queries, and an information panel that displays details about components and relationships, including citations to the source SO posts.

Datasets

The primary dataset used is a collection of 53 million Stack Overflow posts from July 31, 2008, to September 5, 2021. This data was filtered and processed to extract version compatibility knowledge. The paper also mentions using data from Libraries.io for DL library statistics. For evaluation, a benchmark of 10 popular DL projects from GitHub with known version issues was used.

Key Insights and Ideas

  • Stack Overflow as a Rich Source of Practical Knowledge: The paper highlights that SO discussions contain a wealth of up-to-date, practical version compatibility knowledge that is often missing from official documentation.
  • Leveraging QA Models for Compatibility Inference: Reframing version compatibility detection as a QA task and using powerful pre-trained models like UnifiedQA is an effective way to extract nuanced relationships from unstructured text.
  • Visualizing Complex Dependencies: A knowledge graph visualization is crucial for understanding the intricate web of dependencies and incompatibilities in DL stacks, making it easier for developers to navigate.
  • The Importance of Component Layering: Recognizing components across different layers of the DL stack (library, runtime, driver, OS, hardware) is essential for a comprehensive understanding of compatibility issues.

Key Results

  • DECIDE's knowledge graph contains 2,376 version compatibility relationships among 48 popular DL stack components.
  • An evaluation of 343 sampled relations showed an accuracy of 83.7%.
  • When used to detect version issues in real DL projects, DECIDE achieved a precision of 91.7% and a recall of 64.7%, significantly outperforming existing approaches like Watchman and PyEGo.

Limitations and Future Work

  • Limited Scope: The current knowledge graph is based on a limited set of 48 Python-based DL components and knowledge extracted solely from SO. This might limit its effectiveness for newer or less-discussed components.
  • Reliance on SO Data: The accuracy and completeness of DECIDE are dependent on the information available in SO discussions, which can be dynamic and may not cover all possible scenarios.
  • Potential for Component Recognition Errors: The DL component recognition algorithm might introduce some errors.
  • UnifiedQA Limitations: The performance of DECIDE is also tied to the accuracy and limitations of the UnifiedQA model.

Future work could involve expanding the knowledge graph to include more components and knowledge from other online sources, applying DECIDE to other types of software stacks, and adapting it to incorporate new updates and emerging DL technologies.

Summary updated

BibTeX
@inproceedings{zhou2024decide,
  author = {Zihan Zhou and Zhongkai Zhao and Bonan Kou and Tianyi Zhang},
  title = {{Decide: Knowledge-Based Version Incompatibility Detection in Deep Learning Stacks}},
  booktitle = {SIGSOFT FSE Companion},
  year = {2024},
  doi = {10.1145/3663529.3663796},
}
Figure