Ksurf: Attention Kalman Filter and Principal Component Analysis for Prediction under Highly Variable Cloud Workloads

Michael Dang'ana, Arno Jacobsen2024

TL;DR

This paper introduces AKF-PCA, a novel Attention Kalman Filter enhanced with Principal Component Analysis, designed to tackle the challenge of predicting resource usage in highly variable cloud environments with noisy data. The proposed method significantly improves prediction accuracy and auto-scaling stability in real-world cloud systems, outperforming existing state-of-the-art Kalman filters and neural network models.

What Problem Does This Paper Address?

Cloud data centers are essential for modern applications, but accurately predicting resource needs (like CPU or memory) is a significant challenge. This is due to the dynamic nature of cloud environments: the number of virtual machines and user workloads can change rapidly and unpredictably. These fluctuations introduce high variability and noise into resource usage data, making it difficult for traditional prediction models to keep up. Existing state-of-the-art methods often struggle with these nonlinear characteristics and high levels of noise, leading to inaccurate predictions and inefficient resource allocation. This inefficiency can result in either over-provisioning (wasting resources and money) or under-provisioning (leading to performance degradation and SLA violations).

Methods

The core of this work is the Attention Kalman Filter with Principal Component Analysis (AKF-PCA). Here's a breakdown of the key components:

  • Kalman Filter: The foundation is the Kalman filter, a well-established statistical method for estimating the state of a system from noisy measurements. It's particularly good at minimizing variance and providing low-latency predictions.
  • Principal Component Analysis (PCA): To handle the high dimensionality and noise in cloud workload data, PCA is employed. PCA reduces the dimensionality of the data by identifying the most significant underlying patterns (principal components), effectively filtering out noise and simplifying the input for the Kalman filter.
  • Attention Mechanism: This is the novel addition. Inspired by transformer networks, an attention layer is integrated. This mechanism allows the model to dynamically focus on the most relevant parts of the input time series data, even if they are distant in time. This is crucial for capturing complex, long-range dependencies in workloads that simpler models might miss. The attention layer learns weights that highlight important input features, effectively creating a more robust and informative input for the Kalman filter.

The authors also explore joint estimators, combining these techniques with existing Kalman filter variants like the Extended Kalman Filter (EKF) and Unscented Kalman Filter (UKF) to create EKF-PCA and UKF-PCA. The AKF-PCA is presented as the most advanced iteration.

Datasets

The paper evaluates its proposed methods on several datasets:

  • Simulated Data:
    • Mackey-Glass Time Series: A standard benchmark for testing time series prediction models, known for its chaotic and periodic nature.
  • CPU Utilization Trace: A simulated trace representing high-variance CPU utilization from a cloud-based virtual machine running a messaging application.
  • Real-World Data:
    • Google Cloud Benchmark: Utilizes the "Charlie" memory trace, capturing real CPU and memory utilization on Google Cloud containers. This benchmark is used to compare AKF-PCA against state-of-the-art Bi-directional Grid Long Short-Term Memory (BG-LSTM) networks.
  • Apache Kafka Workloads: Two types of workloads are generated:
  • Poisson Workload: Simulates web traffic on a microservice application.
  • Twitter Workload: Uses real-world tweet counts from the hashtag #Ukraine at a 1-minute granularity to simulate a Twitter workload. These are used to evaluate resource estimation and auto-scaling stability in a Kafka environment.

Key Insights and Ideas

  • Attention is Key for Temporal Dependencies: The attention mechanism is shown to be critical for capturing long-range temporal dependencies in cloud workloads, which are often missed by traditional Kalman filters or even standard RNNs. This allows the model to "look back" and identify relevant patterns from distant past data.
  • PCA as a Robust Pre-filter: PCA effectively reduces noise and dimensionality, making the Kalman filter more robust to outliers and high-variance data, which are common in cloud environments.
  • Synergy of Kalman Filters and Attention: Combining the noise-filtering and state-estimation capabilities of Kalman filters with the dynamic feature selection of attention mechanisms creates a powerful predictive model for complex, noisy time-series data.
  • Auto-scaling Stability is Crucial: Beyond just prediction accuracy, the paper highlights the importance of stable auto-scaling. AKF-PCA demonstrates significant improvements in the consistency and reliability of scaling actions, which directly impacts resource efficiency and service quality.

Key Results

The AKF-PCA model demonstrated significant improvements across various experiments:

  • Prediction Accuracy:
    • Improved prediction accuracy by 37% over state-of-the-art Kalman filters.
  • Reduced prediction error of neural network models (like BG-LSTM) by over 40%.
  • On the CPU utilization task, EKF-PCA showed a 28.2% improvement in accuracy and 30.6% reduction in error variance over EKF. The proposed AKF-PCA showed even greater improvements.
  • On the LSTM estimation task, EKF-PCA achieved an 86.4% reduction in error variance and 79.2% improvement in accuracy.
  • Convergence Latency: The UKF-PCA and EKF-PCA achieved convergence latency of 1 interval, significantly faster than UKF and EKF which took 9 intervals.
  • Apache Kafka Auto-scaling:
    • Improved workload-based scaling stability by 58%.
  • Reduced noise and improved workload-based stability with AKF-PCA showing a 66% reduction in latency variance on the Twitter workload compared to EKF-PCA and UKF.
  • AKF-PCA was identified as the highest quality estimator for Kafka scaling decisions due to its lowest variance in scaling action time.

Limitations and Future Work

  • Limitations:
    • The paper notes that for some tasks with lower variance in the estimated signal (like the LSTM estimation task), the performance gains of PCA might be less pronounced, as PCA's primary benefit is noise reduction.
  • The authors mention that the attention mechanism's effectiveness can be further enhanced with more training data, as seen in the Twitter workload experiments where a 3-day batch showed a more uniform attention distribution than a 2-day batch.
  • Future Work:
    • Exploring the application of attention to other Kalman filter variants, particularly UKF, for improved prediction tasks.
  • Investigating the use of neural networks to estimate parameters for incomplete Kalman filter models.
  • Conducting performance evaluations for large cluster systems with varying topologies and multiple filters.
  • Exploring the bounds of Kafka estimator hyperparameters for optimal auto-scaler stability.
  • Investigating potential performance gains from Kalman filter variability and noise mitigation on state-of-the-art multi-modal neural network models.

Summary updated

Abstract

Resource estimation and workload forecasting are critical in cloud data centers. Complexity in the cloud provider environment due to varying numbers of virtual machines introduces high variability in workloads and resource usage, making estimations problematic using state-of-the-art models that fail to deal with nonlinear characteristics. High measurement noise and variance affect the estimation of resource metrics of cloud systems across packet networks influenced by external dynamics. An ideal solution to these problems is the Kalman filter, a variance-minimizing estimator, ideal for highly variable data with Gaussian state space noise such as internet workloads. This work provides a new solution by making these contributions: i) it introduces a novel Kalman filter estimator using principal component analysis and an attention mechanism, ii) it evaluates the scheme on a Google Cloud benchmark comparing it to the state-of-the-art Bi-directional Grid Long Short- Term Memory network model on prediction tasks and iii) demonstrates real-time performance through a control task using a cloud-based messaging system with predictive auto-scaling. The new scheme improves prediction accuracy by 37% over state-of-the-art Kalman filters in prediction tasks, reduces the time series prediction error of the neural network model by over 40%, and improves Apache Kafka workload-based scaling stability by 58%.

Empirical ResultsBrowse all benchmarks →

BenchmarkMethodMetricScoreProtocol / Evidence
CPU signal estimator-error evaluationAKF-PCAMean estimator error (ν)0.1168CPU signal; mean error statistic in the filter-estimator summary.
Source quote
L317: CPU \nu │ 0.1954 │ 0.1973 │ 0.1403 │ 0.1246 │ 0.1370 │ 0.1326 │ 0.1168
CPU signal estimator-error evaluationEKFMean estimator error (ν)0.1954CPU signal; mean error statistic in the filter-estimator summary.
Source quote
L317: CPU \nu │ 0.1954 │ 0.1973 │ 0.1403 │ 0.1246 │ 0.1370 │ 0.1326 │ 0.1168
Google Cloud Charlie TraceAKFAccuracy (ε)0.8117Single-step CPU-usage prediction using the standalone AKF on the trace; summary table r…
Source quote
L421: 0.74987 │ 0.74987 │ 0.74988 │ 0.74989 │ 0.8071 │ 0.8117
Google Cloud Charlie TraceEKFAccuracy (ε)0.8071Single-step CPU-usage prediction using the standalone EKF on the trace; summary table r…
Source quote
L421: 0.74987 │ 0.74987 │ 0.74988 │ 0.74989 │ 0.8071 │ 0.8117
BibTeX
@misc{dangana2024ksurf,
  author = {Michael Dang'ana and Arno Jacobsen},
  title = {{Ksurf: Attention Kalman Filter and Principal Component Analysis for Prediction under Highly Variable Cloud Workloads}},
  year = {2024},
  eprint = {2406.18801},
  archivePrefix = {arXiv},
  url = {https://arxiv.org/abs/2406.18801},
}
Figure