BugDoc: Algorithms to Debug Computational Processes

Raoni Lourenço, Juliana Freire, Dennis E. Shasha

TL;DR

Debugging complex computational pipelines is tedious, expensive, and error-prone. This paper introduces BugDoc, an automated debugging system that uses provenance data and iterative testing to pinpoint the exact, minimal parameter configurations causing pipeline failures. By intelligently generating new test instances, BugDoc isolates root causes faster and more accurately than existing explanation or hyperparameter tuning methods.

What Problem Does This Paper Address?

Modern data science, machine learning, and scientific simulations rely on complex computational pipelines. These pipelines consist of interdependent modules, massive datasets, and numerous hyperparameters. When a pipeline fails—either by crashing or producing garbage results (like a collapsed GAN)—finding the root cause is like finding a needle in a high-dimensional haystack.

Currently, developers either manually tweak parameters to test hypotheses (which is slow and combinatorial) or use hyperparameter optimization tools like Bayesian optimization. However, optimization tools are designed to find entire configurations that work well, not to isolate the minimal specific parameters that cause a failure. Existing explanation tools analyze past logs but don't actively test new configurations to prove causality. BugDoc bridges this gap by automatically generating and executing new pipeline instances to definitively prove which specific parameter values are the root cause of a failure.

Methods

BugDoc treats the computational pipeline as a black box (observing only inputs and outputs) and uses iterative algorithms to find "minimal definitive root causes." It introduces three core algorithms:

  • Shortcut: This algorithm starts with a failed pipeline instance and a "disjoint" successful instance (one that shares no parameter values with the failed run). It iteratively swaps parameter values from the successful run into the failed run. If the pipeline still fails, that parameter wasn't the root cause. This clever approach isolates single-parameter bugs in time linear to the number of parameters, avoiding exponential exhaustive searches.
  • Stacked Shortcut: Sometimes, the basic Shortcut algorithm truncates its findings if the root cause is complex. Stacked Shortcut runs the Shortcut algorithm against multiple disjoint successful instances and combines the results to ensure the explanation is complete.
  • Debugging Decision Trees: For complex bugs involving inequalities (e.g., learning_rate > 0.1 AND batch_size < 32), BugDoc builds an unpruned decision tree using execution history. It looks for paths that consistently lead to failure, treats these paths as "suspects," and then samples and executes new pipeline instances matching those criteria to verify if they are definitive root causes.

Datasets

The authors evaluated BugDoc on a mix of synthetic and real-world benchmarks:

  • Synthetic Pipelines: Custom-generated pipelines with 3 to 15 parameters to systematically test the algorithms against root causes of varying complexity (single values, conjunctions, and disjunctions).
  • Data Polygamy Framework: A real-world spatio-temporal dataset pipeline used to evaluate statistical significance methods.
  • GAN Training: A pipeline training a modified SAGAN on the CIFAR-10 dataset. The failure state was defined as "mode collapse," measured using the Frechet Inception Distance (FID) metric.
  • Transactional Database Performance: The DBSherlock dataset, based on TPC-C benchmark logs, used to diagnose online transaction processing (OLTP) performance anomalies.

Key Insights and Ideas

  • Observation isn't enough; you must intervene: Simply looking at the provenance (logs) of past runs can highlight correlations, but to find a definitive root cause, a system must actively generate and test new, counterfactual pipeline instances.
  • Linear-time debugging is possible: By intelligently contrasting a known failure with a known success, BugDoc's Shortcut algorithm bypasses the combinatorial explosion of parameter spaces, finding simple bugs in $O(N)$ time (where $N$ is the number of parameters).
  • Repurposing Decision Trees: BugDoc uses decision trees not to predict future outcomes, but as a heuristic search space generator. By finding pure "fail" leaves in the tree, it easily extracts complex, inequality-based hypotheses to test.
  • Minimalism matters: A failing pipeline might have 50 parameters, but if only batch_size=128 is causing the crash, the user only needs to know about that one parameter. BugDoc guarantees minimal explanations, preventing user overload.

Key Results

  • Superior Accuracy: BugDoc consistently outperformed state-of-the-art baselines (Data X-Ray, Explanation Tables, and SMAC) in F-measure across both synthetic and real-world tasks.
  • Concise Explanations: BugDoc produced significantly more concise explanations (fewer parameters per asserted root cause) than baseline explanation tools, which often output bloated or spurious correlations.
  • Real-World Efficacy: In the GAN training benchmark, BugDoc successfully identified the exact parameter combinations causing mode collapse. In the database benchmark, it achieved 98% accuracy in predicting failure-inducing configurations.
  • Scalability: The Shortcut algorithms scaled linearly with the number of parameters. While the Debugging Decision Trees algorithm is more computationally heavy, the authors demonstrated that it scales almost perfectly linearly with the number of parallel compute cores used to run the pipeline instances.

Limitations and Future Work

  • Limitations: The Debugging Decision Trees algorithm can become computationally expensive (exponential in the worst case) if the parameter space is massive and parallel compute resources are limited. Furthermore, the system assumes deterministic failures; it is not explicitly designed to handle "flaky" bugs caused by race conditions or non-deterministic timing issues.
  • Future Work: The authors plan to integrate BugDoc with more provenance systems to broaden its real-world applicability. They also suggest exploring "group testing" to identify problematic data elements (e.g., specific corrupt rows in a dataset) rather than just pipeline hyperparameters. Finally, they want to incorporate "observed variables"—metrics that can be measured but not directly manipulated—to enrich the debugging explanations.

Summary updated

BibTeX
@inproceedings{lourenco2020bugdoc,
  author = {Raoni Lourenço and Juliana Freire and Dennis E. Shasha},
  title = {{BugDoc: Algorithms to Debug Computational Processes}},
  booktitle = {SIGMOD},
  year = {2020},
  url = {https://openreview.net/forum?id=xowbyRSCwQA},
}

Loading related content...

Figure