Efficient Function-as-a-Service for Large Language Models with TIDAL

Weihao Cui, Ziyi Xu, Han Zhao, Quan Chen, Zijun Li, Bingsheng He, Minyi GuoarXiv 2025 · OpenReview

Abstract

Large Language Model (LLM) applications have emerged as a prominent use case for Function-as-a-Service (FaaS) due to their high computational demands and sporadic invocation patterns. However, serving LLM functions within FaaS frameworks faces significant GPU-side cold start. A fundamental approach involves leveraging a template with function state saved on GPUs to bypass the cold start for new invocations. Yet, this approach struggles with the high GPU footprint, dynamic initialization behaviors, and lazy GPU kernel loading inherent in LLM functions, primarily due to a lack of insight into the underlying execution details. In this paper, we introduce TIDAL, an optimized FaaS framework for LLM applications that achieves fast startups by tracing fine-grained execution paths. By utilizing the traced execution details, TIDAL generates adaptive function templates, effectively breaking startup barriers for LLM functions. Extensive evaluations demonstrate that TIDAL reduces cold start latency by $1.79\times\text{\textasciitilde}2.11\times$ and improves the $95\%$-ile time-to-first-token by $76.0\%$, surpassing state-of-the-art methods.

The Cold Start Challenge in Serverless LLMs

In serverless computing (FaaS), functions are instantiated on demand and terminated when idle to optimize resource utilization. While this model works well for lightweight logic, it presents a significant challenge for Large Language Models (LLMs). When a "cold" LLM function is invoked, the system must transfer gigabytes of model weights from storage to host memory, then to GPU memory, followed by environment initialization.

TIDAL targets the bottlenecks in LLM cold starts, specifically GPU context initialization, model loading, and kernel execution.

The researchers identify three primary "startup barriers" that existing solutions fail to address:

  1. Low Template Density: The massive size of LLMs often limits a single GPU to holding only one model template, hindering multi-tenancy.
  2. Dynamic Initialization: Modern applications frequently use LoRA adapters for on-the-fly customization. Static snapshots cannot accommodate these request-specific variations.
  3. Lazy Kernel Loading: GPUs often defer loading the code for mathematical operations until the first request, introducing significant hidden latency (often around 180ms).

TIDAL: A Trace-Aware Approach

TIDAL departs from traditional "blind" snapshots by employing a "trace-aware" methodology. It records fine-grained execution paths to understand how a model utilizes its weights and kernels.

Key Components

  • Weight-Centric Two-Phase Tracing: TIDAL uses "strict tracing" during initialization to map data flow and "lax tracing" during inference to determine the sequence of weight access.
  • Adaptive Function Templates: Instead of capturing the entire state, TIDAL creates templates that exclude dynamic components (like LoRA adapters) while retaining the static base model. It also optimizes memory layout based on inference access patterns.
  • Proactive Code Segment Loading: By identifying required GPU kernels in advance, TIDAL "pre-warms" the GPU context, eliminating the lazy loading penalty.
  • Adaptive State Forking: Leveraging its knowledge of weight access order, TIDAL begins inference as soon as the initial layers are loaded onto the GPU. Remaining layers are streamed from the host in the background while the GPU processes earlier layers.
TIDAL overlaps weight loading with kernel execution by tracing the intrinsic dependencies of an LLM invocation.

Evaluation and Results

The researchers evaluated TIDAL using a variety of models (GPT-2, OPT, Llama 2/3, Gemma) across diverse workloads (summarization, conversation, code generation) on Nvidia RTX A6000 and A100 GPUs.

  • Latency Reduction: TIDAL achieves a 1.79× to 2.11× speedup in cold start latency compared to state-of-the-art baselines like ServerlessLLM.
  • TTFT Improvement: In real-world sporadic workloads, TIDAL improves the 95th-percentile Time-to-First-Token (TTFT) by 76.0%.
  • Scalability: The system maintains high performance even for massive models like Llama 2-70B using tensor parallelism across 8 GPUs.
  • Low Overhead: The tracing mechanism is highly efficient, adding less than 1.2% overhead to inference time.

Conclusion

TIDAL addresses the critical bottlenecks of LLM serving in FaaS environments. By moving beyond static snapshots to a fine-grained, trace-aware execution model, it enables efficient overlapping of data transfer and computation. This approach significantly reduces cold start delays and improves the responsiveness of serverless LLM applications, paving the way for more scalable and cost-effective AI deployments.

Summary updated

BibTeX
@misc{cui2025efficient,
  author = {Weihao Cui and Ziyi Xu and Han Zhao and Quan Chen and Zijun Li and Bingsheng He and Minyi Guo},
  title = {{Efficient Function-as-a-Service for Large Language Models with TIDAL}},
  year = {2025},
  eprint = {2503.06421},
  archivePrefix = {arXiv},
  url = {https://arxiv.org/abs/2503.06421},
}
Figure