[Paper Review] Serverless inferencing on Kubernetes
This paper presents KFServing, a serverless machine learning inference framework built on Kubernetes and KNative that enables autoscaling, multi-framework support, and consistent model deployment for data scientists. It demonstrates how serverless paradigms reduce infrastructure costs by scaling models to zero during low usage, while addressing challenges in GPU autoscaling, latency, batching, and service mesh overhead in production workloads.
Organisations are increasingly putting machine learning models into production at scale. The increasing popularity of serverless scale-to-zero paradigms presents an opportunity for deploying machine learning models to help mitigate infrastructure costs when many models may not be in continuous use. We will discuss the KFServing project which builds on the KNative serverless paradigm to provide a serverless machine learning inference solution that allows a consistent and simple interface for data scientists to deploy their models. We will show how it solves the challenges of autoscaling GPU based inference and discuss some of the lessons learnt from using it in production.
Motivation & Objective
- Address the growing challenge of deploying machine learning models at scale with consistent, low-cost infrastructure.
- Enable data scientists to deploy models using a unified interface across diverse ML frameworks like TensorFlow, PyTorch, and XGBoost.
- Solve production challenges including model versioning, canary and shadow deployments, and real-time monitoring.
- Reduce infrastructure costs through serverless autoscaling to zero during idle periods, especially for models with sporadic or cyclical workloads.
- Improve scalability and efficiency of GPU-based inference by optimizing batching and resource utilization in Kubernetes environments.
Proposed method
- Leverages KNative as a serverless foundation on Kubernetes to enable event-driven, scale-to-zero model serving.
- Integrates a sidecar proxy (queue-proxy) to collect real-time metrics on in-flight requests for autoscaling decisions.
- Supports multiple ML frameworks via a consistent API and abstraction layer, reducing deployment complexity for data scientists.
- Uses Istio service mesh for traffic management, observability, and secure communication between model inference services.
- Employs dynamic batching of inference requests to maximize GPU utilization and reduce per-request latency.
- Enables canary and shadow deployments through K8s-native mechanisms and Istio traffic splitting for safe model updates.
Experimental results
Research questions
- RQ1How can serverless principles be effectively applied to machine learning inference to reduce infrastructure costs in production?
- RQ2What are the performance and latency trade-offs when autoscaling large models (e.g., GPT-2) from zero in GPU environments?
- RQ3How can multi-framework support be achieved with consistent deployment and monitoring interfaces across diverse ML frameworks?
- RQ4What are the operational challenges of managing hundreds or thousands of model inference services in a service mesh (Istio) environment?
- RQ5How can model monitoring be automated and scaled to detect drift, outliers, and adversarial inputs in real time?
Key findings
- KFServing enables consistent, framework-agnostic deployment of machine learning models across TensorFlow, PyTorch, XGBoost, and others via a unified API.
- The use of KNative and Istio allows for efficient autoscaling to zero, significantly reducing idle infrastructure costs for models with intermittent workloads.
- GPU autoscaling is effective but can be impacted by Linux CFS scheduling bugs, leading to CPU throttling and increased tail latency, requiring careful monitoring.
- Initial request latency in serverless models can be prohibitive for low-latency workloads due to model loading time, especially for large models (5–30GB), limiting the benefits of scale-to-zero.
- Dynamic batching improves GPU throughput but requires tuning based on traffic patterns; suboptimal batch sizes lead to increased response latency.
- Managing large-scale service mesh deployments (e.g., 100s–1000s of models) increases memory and control plane overhead, though Istio 1.5’s consolidation of control plane into istiod helps reduce administrative complexity.
Read this paper
Open the full text in the Nubint reader and ask about any passage as you read.
Read this paper on NubintThis review was generated by AI from the original paper. Please check the paper before citing it.