Abstract
Efficient resource management in Scientific Workflow Management Systems (SWMS) is often hindered by the "Goldilocks" problem of memory allocation: under-provisioning leads to Out-of-Memory (OOM) errors, while over-provisioning results in significant resource wastage. KS+ introduces a novel approach that predicts a task's memory consumption over time rather than just estimating a single peak value. By employing dynamic segmentation and linear regression based on input data size, KS+ reduces cluster memory wastage by an average of 38% compared to existing baselines.
Introduction
In large-scale scientific computing, researchers rely on clusters managed by systems like Kubernetes or Slurm to execute thousands of interdependent tasks. These managers require a predefined memory limit for every task. To avoid costly OOM crashes and restarts, scientists frequently over-provision resources—for instance, requesting 16GB for a task that typically peaks at 4GB. This "wasted" memory prevents other tasks from being scheduled, creating bottlenecks in research pipelines.
Standard solutions focus on predicting peak memory usage. However, many tasks exhibit distinct phases; a DNA aligner might utilize low memory during data loading for the majority of its runtime before spiking during final processing. Allocating peak memory for the entire duration is inefficient.
Methodology: Dynamic Segmentation
KS+ improves upon previous static methods by introducing Dynamic Segmentation. Instead of dividing a task's runtime into equal chunks, KS+ uses a greedy algorithm to identify natural "steps" in memory usage from historical execution data. This allows the system to allocate only what is necessary for each specific phase of execution.
To ensure stability, KS+ enforces Monotonic Prediction, meaning predicted memory can only stay the same or increase over time. This prevents the system from starving a task that has already transitioned into a high-memory phase. Additionally, the system incorporates safety margins, intentionally overpredicting memory peaks by 10% and underpredicting segment start times by 15% to account for noise in shared cluster environments.
Modeling with Input Data
The system builds two linear regression models per segment: one to predict the start time of the segment and another to predict the peak memory needed during that segment. Both models use the total size of input files as the primary predictor. Empirical evidence shows that input file size is a remarkably strong indicator for both task duration and memory consumption.
Key Results and Impact
The researchers evaluated KS+ using real-world traces from the nf-core repository, specifically the eager (ancient genome reconstruction) and sarek (germline variant calling) workflows.
Key performance metrics include:
- Wastage Reduction: KS+ achieved an average reduction in memory wastage of 38% compared to the original k-segments method.
- Baseline Comparison: It outperformed the state-of-the-art peak-memory prediction baseline (PPM-Improved) by 51%.
- Task-Specific Success: For the
bwa(Burrows-Wheeler Aligner) task, which is often a major source of workflow wastage, KS+ reduced wastage by up to 42%.
Conclusion
KS+ demonstrates that timing is as critical as volume when managing cluster resources. By identifying the specific moments when memory needs increase, SWMS can significantly improve cluster throughput. Future work will focus on automatically determining the optimal number of segments for different task types and exploring non-linear models for more complex computational tasks.
Summary updated