Llama: A Heterogeneous & Serverless Framework for Auto-Tuning Video Analytics Pipelines

Francisco Romero, Mark Zhao, Neeraja J. Yadwadkar, Christos Kozyrakis

Overview

Llama is a serverless framework designed to automatically tune video analytics pipelines, ensuring they meet strict latency targets at the lowest possible cost. By dynamically recalculating "slack" for every operation and delaying hardware assignments until the last millisecond, Llama achieves up to 7.8× lower latency and 16× lower cost than state-of-the-art systems.

The Challenge of Video Analytics

Video analytics applications—ranging from smart city traffic monitoring to security systems—rely on complex pipelines structured as Directed Acyclic Graphs (DAGs). These pipelines involve operations like decoding, object detection, and feature extraction. Optimizing these workflows is difficult due to three primary factors:

  1. Explosive Configuration Space: Each operation has multiple "knobs" (e.g., batch size, sampling rate, hardware type), creating an exponential number of possible settings.
  2. Input-Dependent Execution: Workloads fluctuate based on video content. A frame with many objects requires more downstream processing than an empty scene, making static configurations inefficient.
  3. Performance Volatility: In cloud and serverless environments, resource availability and execution times can vary significantly.

System Architecture

Llama addresses these challenges through a two-phase approach that decouples profiling from real-time execution.

Llama's two-phase architecture: Offline Specification and Online Optimization.

1. Offline Specification Phase

Llama performs a one-time profiling of individual operations rather than the entire pipeline. It records how different knob settings affect latency and resource consumption. This granular data is stored in a Metadata Store, allowing it to be reused across different pipeline configurations without re-profiling.

2. Online Optimization Phase

During execution, Llama’s Configurator manages the flow of video data. It dynamically adjusts configurations based on the current state of the system and the specific content of the video stream.

Core Innovations: Dynamic Slack and Late Binding

The heart of Llama's efficiency lies in its Configurator, which manages the trade-off between performance and cost in real-time.

The Configurator uses a Logic Plane for slack calculation and a Data Plane for late-commit scheduling.
  • Dynamic Slack Allotment: Llama treats time as a currency. It calculates "slack"—the remaining time available to complete an operation without missing the end-to-end latency target. If an early step finishes ahead of schedule, Llama "reclaims" that time to use cheaper, slower configurations for subsequent steps.
  • Early Speculation & Late Commit: The system maintains dual queues. It "speculates" a configuration early to estimate wait times but waits until an operation is at the head of the queue to "commit" to a final hardware assignment. This allows the system to adapt to instantaneous system congestion.
  • Priority-Based Commit: Operations are prioritized based on their hardware affinity (e.g., assigning a GPU to a complex neural network over a simple image filter) and their remaining slack.

Evaluation and Results

The researchers evaluated Llama on Google Cloud Platform (GCP) using diverse workloads, including AMBER Alert traffic monitoring, face blurring, and cartoon effect pipelines. It was compared against industry-standard baselines like Scanner, Nexus, and GrandSLAm.

  • Performance & Cost: Llama achieved an average of 7.8× lower latency and 16× cost reduction compared to state-of-the-art cluster and serverless systems.
  • Reliability: Llama met user-specified latency targets for 94% of invocations on average.
  • Robustness: The system demonstrated self-correcting capabilities; even when initial profiling data was 50% inaccurate, Llama's feedback loop allowed it to meet latency targets with only a minor increase in cost.

Conclusion

Llama demonstrates that treating time as a dynamic resource ("slack") and delaying hardware binding can significantly optimize serverless video analytics. While future work remains regarding "cold start" latencies and expanding hardware support to specialized accelerators like TPUs, Llama provides a robust foundation for high-performance, cost-effective cloud analytics.

Summary updated

BibTeX
@inproceedings{romero2021llama,
  author = {Francisco Romero and Mark Zhao and Neeraja J. Yadwadkar and Christos Kozyrakis},
  title = {{Llama: A Heterogeneous \& Serverless Framework for Auto-Tuning Video Analytics Pipelines}},
  booktitle = {SoCC},
  year = {2021},
  doi = {10.1145/3472883.3486972},
}
Figure