Tangram: High-Resolution Video Analytics on Serverless Platform with SLO-Aware Batching

Haosong Peng, Yufeng Zhan, Peng Li, Yuanqing Xia

Abstract

High-resolution (4K and beyond) video analytics present a significant challenge for cloud-based AI inference due to the "data deluge"—massive bandwidth requirements and unpredictable compute demands. Traditional cloud infrastructure often struggles with the volatility of real-world video workloads and the inefficiencies of processing variable-sized regions of interest (RoIs). This paper presents Tangram, a cloud-edge collaborative system that optimizes video analytics by stitching variable-sized RoIs into fixed-size canvases and processing them using rapidly scaling serverless functions. Tangram reduces bandwidth and costs by up to 74% and 66%, respectively, while maintaining strict adherence to Service Level Objectives (SLOs).

1. Introduction

The proliferation of 4K surveillance and traffic monitoring cameras has outpaced the capacity of traditional network and compute infrastructures. Transmitting raw high-resolution video to the cloud for deep learning inference is often prohibitively expensive in terms of bandwidth. While extracting only Regions of Interest (RoIs) can mitigate bandwidth issues, it introduces a "Batching Dilemma": deep learning models perform optimally on uniform input sizes, yet real-world objects come in diverse shapes and sizes. Resizing these RoIs to fit standard batches degrades accuracy, while padding them wastes expensive GPU resources. Furthermore, the number of objects in a scene fluctuates wildly, making static Virtual Machine (VM) allocations either insufficient for peaks or wasteful during lulls.

2. System Architecture and Methodology

Tangram addresses these challenges through a multi-stage pipeline that spans the edge and the cloud. The system is built on four core innovations:

2.1 Adaptive Frame Partitioning

At the edge, Tangram performs lightweight filtering. Instead of simply cropping raw RoIs, the system divides the frame into zones and aligns detected objects into "patches." This approach ensures that even small or distant objects are captured accurately by the background subtraction algorithm without requiring the transmission of the entire 4K frame.

2.2 The Patch-Stitching Solver

In the cloud, Tangram employs its namesake "Tangram" solver. This component treats GPU memory as a 2D bin-packing problem. It takes variable-sized patches from the edge and packs them onto a fixed-size $1024 \times 1024$ "canvas." By stitching multiple RoIs into a single canvas, the system allows for high-density processing in a single GPU pass without the need for resizing, thereby preserving the high-resolution details necessary for precise detection.

2.3 Serverless Backend

Tangram leverages serverless functions (specifically Alibaba Cloud Function Compute) to handle the inherent volatility of video workloads. Unlike traditional VMs, serverless functions scale in milliseconds and operate on a pay-per-use model. This is particularly effective for video analytics, where the actual area of interest often fluctuates between 5% and 15% of the total frame.

2.4 Online SLO-aware Batching

To ensure real-time performance, Tangram utilizes a specialized scheduling algorithm. It calculates "slack time" based on the earliest deadline (SLO) of the patches currently in the queue. By using a "Mean + 3σ" approach to estimate inference time, the system triggers serverless functions at the optimal moment to maximize GPU utilization while guaranteeing that over 95% of tasks meet their latency targets.

3. Evaluation

3.1 Experimental Setup

The researchers evaluated Tangram using the PANDA4K dataset, derived from the PANDA (Gigapixel-level Human-Centric Video) benchmark. The evaluation spanned 10 distinct scenes, including university canteens, busy crossroads, and basketball courts, to test the system against varying object densities and movement patterns.

3.2 Performance Results

Tangram was compared against state-of-the-art systems such as Clipper and ELF. Key findings include:

  • Bandwidth Efficiency: Tangram reduced bandwidth consumption by up to 74.30% compared to full-frame transmission.
  • Cost Optimization: The system achieved up to 66.35% reduction in computation costs compared to traditional batching strategies.
  • Reliability: SLO violations were maintained within 5%, meeting the requirements for real-time monitoring.
  • Accuracy: Tangram maintained high precision, significantly outperforming server-driven approaches that often suffer a ~23.9% drop in precision due to low-quality initial scans.

4. Conclusion and Future Work

Tangram demonstrates that the combination of 2D patch-stitching and serverless computing provides a robust solution for high-resolution video analytics. By treating GPU memory as a puzzle to be solved rather than a fixed slot to be filled, Tangram preserves image quality while drastically reducing operational costs.

Future research directions include adapting the system for moving cameras (e.g., drones), which would require more complex motion compensation than the current GMM-based background subtraction. Additionally, the authors aim to explore multi-function coordination to support complex pipelines involving simultaneous detection, tracking, and segmentation within the same stitching framework.

Summary updated

BibTeX
@inproceedings{peng2024tangram,
  author = {Haosong Peng and Yufeng Zhan and Peng Li and Yuanqing Xia},
  title = {{Tangram: High-Resolution Video Analytics on Serverless Platform with SLO-Aware Batching}},
  booktitle = {ICDCS},
  year = {2024},
  doi = {10.1109/icdcs60910.2024.00066},
}
Figure