当前位置:首页 > 报告详情

Meta 的大型语言模型服务基础设施的扩展.pdf

上传人: 竿*** 编号:981531 2025-11-29 65页 5.37MB

1、Scaling Large Language Model Serving Infrastructure at MetaA comprehensive recipe to turn LLMs into LLM serving infrastructureYe(Charlotte)QiAI Inference MetaThe AI Gold RushCOMPUTECONTEXT WINDOWCOMPUTE#OF PARAMETERSInference Scaling and Compound Systems Are Comingcredit:https:/ been running model s

2、ervices for 6.5 years Ads model serving LLaMa servingMachine translation research before MetaBackground about Myself500MWe Support Product Backend for Meta AIMonthly active usersBehind the making of LLaMa“Should I run my own LLM services?”QuestionLets Build This Step By StepSummarize Charlottes post

3、s and ask follow-upsChallenge 1FittingChallenge 2Challenge 3Challenge 4STEP 1Find a good runtimeIsnt that just grabbing eval code?Imagine every output token generation triggers one model.forward!working on it!prefilldecodeContinuous BatchingThe Most Basic Features to Search For(Available in All Popu

4、lar Framework)KV Cache How does KV cache work?Imagine this sentence being generated by an LLM.KV tensors for yellow parts are cached in GPU memory at 320KiB/tok(LLaMa3-70B),128KiB/tok(LLaMa3-8B)under bf16.Prefilldec dec Prefilldec$dec dec eos dec dec dec dec dec dec dec dec dec dec Prefilldec dec de

5、c dec Prefilldec dec eos dec Not thisUse thisTGITensorRT-LLMeos RDMA 4-14xSTEP 2Understand hardware resourcesTCP 1xBack End NICFront End NICNVLinkNVLinkPCIePCIeCPUGPULets Only Worry About Model Loading40/80GBNVIDIA A10080/96GBNVIDIA H100192GBAMD Mi300 xSTEP 3:Start fitting some models with 80GB H100

6、 x8bf16:16GB 80GBLLaMa3-8BSTEP 3:Single-Card InferenceSTEP 3:Distributed Inference:Tensor ParallelismPartitioning Weightsbf16:140GB 80GB x 2LLaMa3-70BSTEP 3:Distributed Inference:Pipeline ParallelismPartitioning Weights Morebf16:810GB 80GB x 16bf16:810GB 192GB x 8LLaMa3-405BOr Find GPUs With Bigger

word格式文档无特别注明外均可编辑修改,预览文件经过压缩,下载原文更清晰!
三个皮匠报告文库所有资源均是客户上传分享,仅供网友学习交流,未经上传用户书面授权,请勿作商用。
根据报告的内容,全文主要探讨了在Meta构建大型语言模型(LLM)服务基础设施的全面方法。以下是关键点: 1. **LLM服务基础设施构建步骤**: - **选择合适的运行时**:使用专门为LLM设计的运行时。 - **理解硬件资源**:了解AI硬件的系统资源,如CPU、GPU、内存和带宽。 - **模型适配**:通过张量/管道并行化适配模型以适应硬件资源。 2. **性能优化**: - **增加容量**:合理增加硬件资源,如更多副本和更快硬件。 - **系统瓶颈理解**:分析系统瓶颈,如GPU内存带宽和容量。 - **缓存策略**:使用前缀缓存和分片预填充/解码来提高效率。 3. **生产环境挑战**: - **理解生产环境**:分析生产环境中的输入长度、流量变化和客户SLO。 - **权衡取舍**:在质量、延迟、成本、吞吐量和可靠性之间进行权衡。 4. **可扩展性**: - **部署扩展**:通过物理可用性、共享命运和容量限制进行扩展。 - **模型和开发者扩展**:通过模型管理和自动化扩展模型和开发者数量。 5. **核心数据**: - **LLaMa3-70B模型**:在80GB H100 GPU上使用bf16精度,需要140GB内存。 - **LLaMa3-405B模型**:在192GB AMD Mi300x GPU上使用bf16精度,需要810GB内存。 通过这些步骤和策略,可以构建一个可扩展的LLM服务基础设施。
如何提升效率?" 关键步骤揭秘!" 从入门到精通!"
客服
商务合作
小程序
服务号
折叠