Skip to main content
QUICK REVIEW

[Paper Review] Declarative Recursive Computation on an RDBMS, or, Why You Should Use a Database For Distributed Machine Learning

Dimitrije Jankov, Shangyu Luo|arXiv (Cornell University)|Apr 24, 2019
Advanced Database Systems and QueriesComputer Science47 references31 citations
TL;DR

This paper proposes extending a relational database management system (RDBMS) with declarative recursion and scalable query optimization to enable efficient model-parallel distributed machine learning. By representing deep learning computations as SQL queries over multi-dimensional, array-like table indices and partitioning large execution plans into optimized frames via a generalized quadratic assignment formulation, the approach achieves superior scaling for large models—outperforming TensorFlow in some cases on Word2Vec and LDA, though not on GPU-optimized neural networks.

ABSTRACT

A number of popular systems, most notably Google's TensorFlow, have been implemented from the ground up to support machine learning tasks. We consider how to make a very small set of changes to a modern relational database management system (RDBMS) to make it suitable for distributed learning computations. Changes include adding better support for recursion, and optimization and execution of very large compute plans. We also show that there are key advantages to using an RDBMS as a machine learning platform. In particular, learning based on a database management system allows for trivial scaling to large data sets and especially large models, where different computational units operate on different parts of a model that may be too large to fit into RAM.

Motivation & Objective

  • To address the limitations of data parallelism in deep learning, where large models exceed GPU or machine RAM capacity.
  • To enable model parallelism—distributing model parameters across multiple compute units—using a declarative SQL-based interface.
  • To overcome RDBMS limitations in handling recursive deep learning computations and massive query plans.
  • To demonstrate that a database system can efficiently scale to large models and outperform specialized ML frameworks in certain scenarios.

Proposed method

  • Introduces multi-dimensional, array-like indices to compactly represent distributed model parameters across tables, enabling efficient relational representation of neural network layers.
  • Modifies the RDBMS query optimizer to handle very large execution plans by partitioning them into independent, cost-optimized frames.
  • Reformulates the frame partitioning problem as a generalized quadratic assignment problem (GQAP) to minimize communication and maximize pipelining.
  • Uses a prototype distributed RDBMS, SimSQL, extended with recursion and frame-aware optimization, to execute declarative SQL-based machine learning algorithms.
  • Employs recursive CTEs and materialized views to express forward and backward propagation in deep networks declaratively.
  • Applies cost-based optimization considering operator cost, pipelining, and data locality to improve performance on distributed hardware.

Experimental results

Research questions

  • RQ1Can a modern RDBMS be effectively extended to support distributed, model-parallel machine learning workloads?
  • RQ2How can recursive computations in deep learning (e.g., forward and backward propagation) be expressed and optimized declaratively in SQL?
  • RQ3What optimization strategies are needed to scale RDBMS query execution to the size of deep learning computation graphs (tens of thousands of operators)?
  • RQ4Can a database-based approach outperform specialized frameworks like TensorFlow in terms of scalability and performance for large models?
  • RQ5What are the performance trade-offs between database-based and GPU-optimized deep learning systems?

Key findings

  • The proposed extension of SimSQL with recursive SQL and frame-based optimization enables declarative, model-parallel execution of deep learning algorithms.
  • The system successfully scales to model sizes that exceed the memory capacity of a single GPU or machine, including models with over 200,000 embedding categories.
  • For Word2Vec and latent Dirichlet allocation (LDA), the RDBMS-based implementation outperformed TensorFlow in terms of training speed.
  • The query optimizer’s frame partitioning strategy, based on the GQAP formulation, effectively reduced communication and improved pipelining in large-scale distributed execution.
  • The approach demonstrated that relational databases can natively express and optimize complex, recursive machine learning workloads with minimal code changes.
  • Despite performance limitations on GPU-optimized neural networks—attributed to the prototype’s Java/Hadoop stack—the results indicate strong potential for future optimization.

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.