Skip to main content
QUICK REVIEW

[Paper Review] An Empirical Study of Library Usage and Dependency in Deep Learning Frameworks

Mohamed Raed El aoun, Lionel Nganyewou Tidjon|arXiv (Cornell University)|Nov 28, 2022
Machine Learning and Data ClassificationComputer Science7 citations
TL;DR

This empirical study analyzes 1,484 open-source deep learning projects to understand library usage patterns, dependencies, and workflow integration. Using static analysis on Python code, it reveals that PyTorch and scikit-learn, and Keras and TensorFlow are the most frequent library combinations, with developers favoring simple functions and multiple libraries across workflows, offering insights for library and hardware optimization.

ABSTRACT

Recent advances in deep learning (dl) have led to the release of several dl software libraries such as pytorch, Caffe, and TensorFlow, in order to assist machine learning (ml) practitioners in developing and deploying state-of-the-art deep neural networks (DNN), but they are not able to properly cope with limitations in the dl libraries such as testing or data processing. In this paper, we present a qualitative and quantitative analysis of the most frequent dl libraries combination, the distribution of dl library dependencies across the ml workflow, and formulate a set of recommendations to (i) hardware builders for more optimized accelerators and (ii) library builder for more refined future releases. Our study is based on 1,484 open-source dl projects with 46,110 contributors selected based on their reputation. First, we found an increasing trend in the usage of deep learning libraries. Second, we highlight several usage patterns of deep learning libraries. In addition, we identify dependencies between dl libraries and the most frequent combination where we discover that pytorch and Scikit-learn and, Keras and TensorFlow are the most frequent combination in 18% and 14% of the projects. The developer uses two or three dl libraries in the same projects and tends to use different multiple dl libraries in both the same function and the same files. The developer shows patterns in using various deep-learning libraries and prefers simple functions with fewer arguments and straightforward goals. Finally, we present the implications of our findings for researchers, library maintainers, and hardware vendors.

Motivation & Objective

  • Understand the evolving usage trends of deep learning libraries over time.
  • Identify common combinations and dependency patterns between deep learning libraries in real-world projects.
  • Analyze how multiple DL libraries are used across different stages of the machine learning workflow.
  • Provide actionable insights for library maintainers, hardware vendors, and researchers to improve tooling and system design.
  • Address the lack of empirical studies on deep learning library usage, especially regarding multi-library workflows and dependency structures.

Proposed method

  • Collected and analyzed 1,484 open-source deep learning projects from GitHub with at least two deep learning libraries.
  • Applied static analysis using Python's abstract syntax tree (AST) parser to extract library usage and function calls.
  • Tracked library popularity and evolution from 2015 to 2019 using versioned repository data.
  • Classified function calls into ML workflow stages (e.g., data preprocessing, model training, evaluation) through manual labeling with consensus.
  • Identified dependency patterns at both file and function levels across multiple libraries.
  • Validated results through unit and end-to-end testing, and ensured reliability via dual and triple author review for manual labeling.

Experimental results

Research questions

  • RQ1How has the usage of deep learning libraries evolved over time?
  • RQ2What are the most frequent combinations of deep learning libraries used in the same projects?
  • RQ3How are deep learning libraries distributed across different stages of the machine learning workflow?
  • RQ4What are the common patterns in function usage (e.g., argument count, purpose) across multiple libraries?
  • RQ5What are the implications of these findings for library maintainers and hardware vendors?

Key findings

  • Deep learning library usage shows a rapidly increasing trend from 2015 to 2019, with a notable rise in multi-library adoption.
  • TensorFlow was the most popular library but began declining in usage after 2019, particularly following the release of TensorFlow 2.0.
  • PyTorch and scikit-learn are the most frequent library combination, used in 18% of projects, followed by Keras and TensorFlow at 14%.
  • Developers commonly use two or three deep learning libraries within the same project, often within the same files and functions.
  • Practitioners prefer simple functions with fewer arguments and straightforward goals, especially when using scikit-learn for preprocessing and evaluation.
  • Keras shows limited support for unit testing, indicating a gap in testability for certain libraries, which may affect maintainability and reliability.

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.