隨著企業組織加速大型語言模型(large language model,LLM)工作負載的生產進程,開放原始碼工具生態系統也在快速發展。為了應對大規模推論的複雜需求,vLLM 與 llm-d 這兩個強大的專案應運而生,成為解決方案的核心。
這導致工程團隊產生一個常見的問題:「我們應該使用 vLLM 還是 llm-d?」雖然對這些工具進行比較是很自然的事情,但策略性的答案不在於選擇其中一種,而在於瞭解它們如何協同工作。就像賽車只有高效能引擎還不夠,還需要搭配能制勝冠軍的策略,才能保證每一次的穩定結果。
瞭解生態系統:引擎與平台
開發人員面臨的主要挑戰不僅僅是擴展,還包括如何駕馭 artificial intelligence (AI) 堆疊的不同層。
當 AI 專案從個人筆電轉向生產叢集,很容易誤以爲推論引擎(運行模型的軟體)能處理從流量管理到擴展的所有事務。然而,單體式(Monolithic) LLM 伺服器最初並非是為動態的雲原生世界而設計的。單獨執行這些伺服器,有時會導致 GPU 利用率低下或延遲無法預測,尤其是在工作負載的上下文長度和字符比率各不相同的情況下。
為了要解決這個問題,瞭解這些工具如何相互補充會有幫助。
vLLM:高效能 F1 賽車
將 vLLM 視為您的一級方程式賽車。它是一款最先進的企業級推論引擎,專為實現原始速度和效率而設計。
vLLM 提供馬力。它的效能優勢來自於深度技術創新,如 PagedAttention(像作業系統一樣管理記憶體)、推測性解碼和張量平行。它是負責執行推論工作負載、管理節點上的 GPU 記憶體,以及提供快速回應的元件。
如果您想在單一節點或經過良好調校的多 GPU 叢集上為模型提供服務,vLLM 就是您的理想之選。但即使是速度最快的 F1 賽車,也離不開團隊的大力支援,才能贏得冠軍。
llm-d:維修站工作人員和比賽策略師
如果將 vLLM 比作賽車,那麼 llm-d 就是維修站工作人員、比賽策略師和遠端監測系統的結合體。
llm-d 是一個雲原生分散式推論框架,旨在編排 vLLM。它承認單一賽車需要支援,才能完成一場漫長而複雜的比賽。llm-d 可以分解推論過程,將其分解為可管理的元件,以協助有效擴展。
為了理解為什麼這種關係很有用,讓我們從賽車的角度來看看 LLM 生成的兩個階段:
- 「預填充」(暖胎圈):這類似於暖胎圈,車手需要預熱輪胎並檢查系統。在 LLM 中,這是系統處理使用者提示並計算初始鍵值(Key-Value,KV)快取的地方。它是計算密集型且繁重的。
- 「解碼」(比賽):這是一場快速反覆運算的比賽。模型一次生成一個字符。此階段需要高速記憶體頻寬,以便快速存取和生成新字符。
在標準設定中,一部機器會同時處理兩個階段。而 llm-d 扮演競賽控制中心,利用前綴感知路由 (Prefix-aware routing)來判斷哪個後端處理哪個請求,確保「賽車」始終處於最佳模式對應前方賽道。
強強聯手:編排隊列
沒有 vLLM 就沒有 llm-d。它們天生就是隊友。當您將引擎(vLLM)與編排器(llm-d)配對時,您可以解鎖解決複雜生產障礙的特定整合:
- 獨立擴展(分解):您可以透過預填 (Prefill)與解碼 (Decode)運算節點分離的架構,來運行擁有數十億參數的大型語言模型 (LLM)。由於 llm-d 將這兩個階段分離,您可以獨立擴展熱身 (Warm-up)與競速 (Race)資源,進而優化硬體利用率。
- 針對混合專家模型 (MoE) 的專家平行排程:對於大規模混合專家(Mixture of Experts,MoE)模型,llm-d 支援專家平行排程。這使得模型中的不同「專家」能夠分散在各個 vLLM 節點上,從而允許您執行對於單一 GPU 設定而言過大的模型。
- KV 快取感知型路由(KV cache-aware routing):這相當於維修站工作人員確切知道輪胎的磨損程度。llm-d 智慧地重複利用之前請求中快取的 KV 對(前綴快取重複利用 prefix cache reuse)。透過將請求路由到之前檢視過類似資料的工作節點,可以降低延遲和計算成本。
- Kubernetes 原生彈性(KEDA 和 ArgoCD):這正是 llm-d 作為平台的優勢所在。它與 KEDA(Kubernetes 事件驅動型自動擴展)和 ArgoCD 無縫整合。這使得系統能夠根據即時需求動態擴展 vLLM「汽車」車隊,從而實現高可用性,而不會在閒置的 GPU 上浪費預算。
- 精細調測:llm-d 就像您的競賽工程師,負責觀察每個Token的數據,如第一個Token的時間、KV 快取命中率和 GPU 記憶體壓力。
總結
單獨部署 vLLM 是一種絕佳的入門方式。但是,當您轉向可在全球範圍內擴展的 LLM 服務時,您需要的可能不僅僅是引擎。
llm-d 不會取代 vLLM,而是對其進行了增強。它提供雲原生控制平面,將高效能引擎轉變為制勝的推論系統。透過將它們結合使用,您可以確保您的 artificial intelligence (AI) 基礎架構不僅速度快,而且為冠軍做好了準備。
準備好上路了嗎?閱讀這份 llm-d 簡介來深入瞭解,或透過 30 天自助服務式 OpenShift AI 開發人員沙盒 進行測試。
About the authors
Christopher Nuland is a Principal Technical Marketing Manager for AI at Red Hat and has been with the company for over six years. Before Red Hat, he focused on machine learning and big data analytics for companies in the finance and agriculture sectors. Once coming to Red Hat, he specialized in cloud native migrations, metrics-driven transformations, and the deployment and management of modern AI platforms as a Senior Architect for Red Hat’s consulting services, working almost exclusively with Fortune 50 companies until recently moving into his current role. Christopher has spoken worldwide on AI at conferences like IBM Think, KubeCon EU/US, and Red Hat’s Summit events.
Carlos Condado is a Senior Product Marketing Manager for Red Hat AI. He helps organizations navigate the path from AI experimentation to enterprise-scale deployment by guiding the adoption of MLOps practices and integration of AI models into existing hybrid cloud infrastructures. As part of the Red Hat AI team, he works across engineering, product, and go-to-market functions to help shape strategy, messaging, and customer enablement around Red Hat’s open, flexible, and consistent AI portfolio.
With a diverse background spanning data analytics, integration, cybersecurity, and AI, Carlos brings a cross-functional perspective to emerging technologies. He is passionate about technological innovations and helping enterprises unlock the value of their data and gain a competitive advantage through scalable, production-ready AI solutions.
More like this
asago 簡介:開放原始碼人工智慧 (AI) 安全與治理調度
讓每一小時的 GPU 時間都發揮價值:Red Hat OpenShift AI 中的進度追蹤
How Red Hat cleared IT debt for scalable AI
Standardizing the AI stack with PyTorch
Keep exploring
- What is agentic AI?
Article - Predictive AI vs. generative AI
Article Top considerations for building a production-ready AI/ML environment E-book 页面当前以 English (英文) 显示(暂无 Chinese, Traditional 选项)- Generative AI, the Ansible way
Video Innovate and transform with a modern application platform页面当前以 English (英文) 显示(暂无 Chinese, Traditional 选项) E-book 页面当前以 English (英文) 显示(暂无 Chinese, Traditional 选项)
Browse by channel
Automation
The latest on IT automation that spans tech, teams, and environments
Artificial intelligence
Explore the platforms and partners building a faster path for AI
Cloud services
Get updates on our portfolio of managed cloud services
Security
Explore how we reduce risks across environments and technologies
Edge computing
Updates on the solutions that simplify infrastructure at the edge
Infrastructure
Stay up to date on the world’s leading enterprise Linux platform
Applications
The latest on our solutions to the toughest application challenges
Original shows
Entertaining stories from the makers and leaders in enterprise tech