翻篇收录说明
翻篇网页快照

Components of an Open Source AI Compute Tech Stack

https://www.anyscale.com/blog/ai-compute-open-source-stack-kubernetes-ray-pytorch-vllm

最近抓取:2026-12-03 12:57:13(北京时间)

最近内容变化:2026-11-30 09:36:21(北京时间)

这是最近一次有效抓取的文本快照,不含网页脚本、图片和动态交互内容。实际网页可能已更新。

访问原网页

页面简介

Learn how Kubernetes, Ray, PyTorch, and vLLM form the leading open-source AI compute stack for scalable training, inference, and production AI workloads.

正文摘录

HomeBlogBlog DetailAn Open Source Stack for AI Compute: Kubernetes + Ray + PyTorch + vLLMBy Robert Nishihara | June 12, 2025Through our experience building Ray, we work with hundreds of AI teams and platform teams productionizing AI.¹ As AI workloads have evolved from classical ML to deep learning to generative AI, the software stack for running and scaling these workloads has ballooned in complexity.Over time, industries standardize on common tech stacks. In the case of infrastructure products, the standards are often open source. Just as Spark eclipsed Hadoop for big-data analytics, Kubernetes has become the standard for container orchestration and PyTorch dominates deep learning.Now over a decade into deep learning, many teams are landing on the same recipe. This blog post describes a snapshot of that emerging stack based on our experience working with Ray users.We’ll break down each layer, then illustrate it with case studies from Pinterest, Uber, Roblox, and five popular open source post-training frameworks.LinkBackgroundThe right stack connects a team’s AI workloads to their underlying compute resources (especially GPUs). The teams piecing together these software stacks tend to solve for a few common requirements.Three key workloads. They need to support model training, model serving, and batch inference (especially multimodal data processing). Within training, pre-training and post-training are emerging as distinct workloads each with their own requirements and tech stacks.Massive scale. AI is computationally intensive as well as data intensive. Platform and AI teams are working to accommodate orders of magnitude more data. Supporting scale means solving hard reliability and cost-efficiency challenges.Iteration speed. Top AI teams track the number of experiments per developer per month. Unfortunately, performance and scale are sometimes at odds with rapid iteration. In the worst case, new ideas can be incompatible with existing optimized infrastructure.Future-proofing. No one wants to rearchitect code to adopt the latest models, frameworks, or sources of compute capacity. Swapping in H100 spot nodes should be a parameter change, not a rewrite.LinkThe software stackA common recipe for AI compute is Kubernetes + Ray + PyTorch + vLLM.This stack consists of three layers, each with a distinct slice of responsibilities.The training and inference framework: Run models fast on GPUs: model optimizations, parallelism strategies, model definition, and automatic differentiation.The distributed compute engine: Schedule tasks within a job, move data, handle failures, autoscale workloads, manage process lifecycles.The container orchestrator: Allocate nodes, schedule entire jobs, spin up containers, manage multitenancy.Fig 1. Kubernetes + Ray + PyTorch + vLLM: One of the most popular software stacks for AI compute.Fig 1. Kubernetes + Ray + PyTorch + vLLM: a popular software stack for AI compute.LinkRunning example: video processingTo make this concrete, we’ll ground the layers in a real workload: automated video moderation. The workload stages areVideo decoding and standardization (CPU)Computer vision and audio tasks (GPU)LLM reasoning (GPU)video processing ai compute stackLinkLayer 1: Training and inference frameworkKey responsibility: Running the model efficiently on the GPU Model compilation and model-level performance optimization Accelerator memory management Parallelism strategies (model parallelism, data parallelism, etc) Model definition and automatic differentiation GPUs and other accelerators are the centerpiece of AI compute, and so it is vitally important that models take full advantage of them.Running example: In the video processing example, all of the computer vision tasks, the audio tasks, and other classification tasks would be executed by a deep learning framework like PyTorch. An LLM inference engine like vLLM would run LLM reasoning across multiple GPUs.A deep learning framework is at the heart of this layer. PyTorch is the dominant framework today, with Jax as a popular alternative, especially for running on TPUs. These frameworks have consolidated after a decade-long shake-out including frameworks like Theano, Torch, Caffe, Chainer, MXNet, and TensorFlow.Surrounding PyTorch, we have frameworks designed for model parallelism (sharding models across multiple hardware accelerators). These frameworks can be divided along two primary axes. First, these frameworks may be designed for training or for inference (or for both). Second, they may be general purpose (meaning they can be used with any model) or specialized for transformers. Transformers are sufficiently important and complex that they deserve their own specialized frameworks.PyTorch FSDP (fully-sharded data parallel) and DeepSpeed are general frameworks for model parallelism, primarily optimized for training. Nvidia Megatron is a model-parallel training framework specialized for transformers. This specialization allows for more optimized sharding strategies (e.g., different sharding strategies for different weights).Another set of frameworks are vLLM, SGLang, and Nvidia TensorRT-LLM. These are inference engines specialized for running transformers. There are a number of important techniques for optimizing inference in transformers. Examples include continuous batching, paged attention, speculative decoding, and chunked prefill.LinkLayer 2: Distributed compute engineKey Responsibility: Distributed computing Task scheduling and execution Process creation and lifecycle management, process coordination (RPCs) Data handling (ingest and movement) Workload-aware failure handling and autoscaling Running example: In the video processing example, a distributed compute engine like Ray handles the scheduling of different stages of processing across containers and nodes, the management and autoscaling of the compute resources allocated to each stage, the movement of data between stages, and the recovery from hardware and application failures (by redoing lost work).The compute engine treats the training and inference code as just another task. For example, Ray might schedule vLLM tasks to do batch LLM inference as part of a broader data processing pipeline.Ray and Spark are two of the most popular distributed compute engines. Ray is Python-native and GPU-aware, ideal for model training, model serving, and multimodal data processing. Spark is a unified analytics engine whose sweet spot is large-scale SQL and dataframe operations on CPUs.It’s worth noting that failure handling and autoscaling responsibilities are split with the container orchestrator layer.Failure handling: The distributed compute engine is workload aware and is responsible for ensuring that the overall AI workload catches failures and continues executing smoothly (possibly restarting dead processes, re-executing interrupted tasks, or reconfiguring itself on the remaining available compute). The container orchestrator is not workload aware. It is responsible for removing the problematic GPU (or other component) from the underlying cluster.Autoscaling: The distributed compute engine is responsible for workload-aware autoscaling. It ensures that the AI workload requests the resources it needs (from the container orchestrator), releases resources when they are no longer needed, and reconfigures itself to run on the compute it has available. The container orchestrator is responsible for actually obtaining the required compute resources from the underlying cloud provider, allocating them to different AI workloads, and possibly taking them back when appropriate.LinkLayer 3: Container orchestratorKey Responsibility: Compute provisioning Workload-level scheduling and multitenancy User multitenancy including isolation and resource quotas Container creation and lifecycle management Compute autoscaling Running example: In the video processing example, a container orchestrator like Kubernetes obtains compute resources and allocates them to the data processing workload, mediates competing resource demands from multiple concurrent jobs, and creates and manages the containers that run the workload.Workloads do not exist in isolation. In a typical company, many users may run many jobs, and these jobs share a common pool of compute resources.The container orchestration layer is responsible for scheduling workloads and multiplexing users across a shared pool of compute. The scheduling granularity is important: the compute orchestrator schedules entire jobs and the distributed compute engine schedules the tasks & processes that make up an individual job. This layer is responsible for creating containers and managing container lifecycles. Furthermore, it is responsible for interfacing with cloud providers to select instance types and provision compute.Kubernetes is the dominant framework at this layer. However, SLURM is a popular alternative. It is especially popular among researchers, and its strength is in offline workloads (training and batch processing). Kubernetes handles both, but was originally created for microservices and therefore biases more toward online workloads. That said, while many teams start off using SLURM, the momentum is toward standardizing on Kubernetes.One subtle point about this layer is the target users. Kubernetes fundamentally targets platform engineers, the people who operate clusters, configure infrastructure through YAML, manage multi-tenancy and resource sharing, and standardize policies across their organization. Ray, PyTorch, and vLLM target ML developers, people who write Python code and use PyTorch and Hugging Face, people who may find Docker and Kubernetes intimidating, but have no problem debugging complex numerical bugs or performance bottlenecks in their inference pipelines. Individually, these layers do not satisfy the needs of both sets of users, but together, they can meet both sets of requirements.LinkCase StudiesA few companies have written extensively about their AI