BentoML 发布 llm-optimizer,LLM 推理和性能优化开源工具
BentoML近日发布了llm-optimizer,这是一个用于基准测试和优化 LLM 推理的开源工具。它支持多个推理框架,并兼容任何开源 LLM。
llm-optimizer 旨在将 LLM 性能优化的繁琐手动工作自动化。您可以在一个地方运行结构化实验、应用约束并可视化结果,只需几个命令即可。
使用示例
llm-optimizer estimate \
--model meta-llama/Llama-3.1-8B-Instruct \
--input-len 1024 \
--output-len 512 \
--gpu A100 \
--num-gpus 2
预期输出
=== Configuration ===
Model: meta-llama/Llama-3.1-8B-Instruct
GPU: 2x A100
Precision: fp16
Input/Output: 1024/512 tokens
Target: throughput
Fetching model configuration...
Model: 8029995008.0B parameters, 32 layers
=== Performance Analysis ===
Best Latency (concurrency=1):
TTFT: 43.1 ms
ITL: 2.6 ms
E2E: 1.39 s
Best Throughput (concurrency=512):
Output: 18873.3 tokens/s
Input: 23767.8 tokens/s
Requests: 14.24 req/s
Bottleneck: Memory
=== Roofline Analysis ===
Hardware Ops/Byte Ratio: 142.5 ops/byte
Prefill Arithmetic Intensity: 52205.5 ops/byte
Decode Arithmetic Intensity: 50.9 ops/byte
Prefill Phase: Compute Bound
Decode Phase: Memory Bound
=== Concurrency Analysis ===
KV Cache Memory Limit: 688 concurrent requests
Prefill Compute Limit: 8 concurrent requests
Decode Capacity Limit: 13 concurrent requests
Theoretical Overall Limit: 8 concurrent requests
Empirical Optimal Concurrency: 16 concurrent requests
=== Tuning Commands ===
--- SGLANG ---
Simple (concurrency + TP/DP):
llm-optimizer --framework sglang --model meta-llama/Llama-3.1-8B-Instruct --gpus 2 --host 127.0.0.1 --server-args "tp_size*dp_size=[(1, 2), (2, 1)]" --client-args "num_prompts=1000;dataset_name=sharegpt;random_input=1024;random_output=512;num_prompts=1000;max_concurrency=[256, 512, 768]" --output-dir tuning_results --output-json tuning_results/config_1_sglang.json
Advanced (additional parameters):
llm-optimizer --framework sglang --model meta-llama/Llama-3.1-8B-Instruct --gpus 2 --host 127.0.0.1 --server-args "tp_size*dp_size=[(1, 2), (2, 1)];chunked_prefill_size=[1434, 2048, 2662];schedule_conservativeness=[0.3, 0.6, 1.0];schedule_policy=fcfs" --client-args "num_prompts=1000;dataset_name=sharegpt;random_input=1024;random_output=512;num_prompts=1000;max_concurrency=[256, 512, 768]" --output-dir tuning_results --output-json tuning_results/config_1_sglang.json
--- VLLM ---
Simple (concurrency + TP/DP):
llm-optimizer --framework vllm --model meta-llama/Llama-3.1-8B-Instruct --gpus 2 --host 127.0.0.1 --server-args "tensor_parallel_size*data_parallel_size=[(1, 2), (2, 1)]" --client-args "num_prompts=1000;dataset_name=sharegpt;random_input=1024;random_output=512;num_prompts=1000;max_concurrency=[256, 512, 768]" --output-dir tuning_results --output-json tuning_results/config_1_vllm.json
Advanced (additional parameters):
llm-optimizer --framework vllm --model meta-llama/Llama-3.1-8B-Instruct --gpus 2 --host 127.0.0.1 --server-args "tensor_parallel_size*data_parallel_size=[(1, 2), (2, 1)];max_num_batched_tokens=[1024, 1177, 1331]" --client-args "num_prompts=1000;dataset_name=sharegpt;random_input=1024;random_output=512;num_prompts=1000;max_concurrency=[256, 512, 768]" --output-dir tuning_results --output-json tuning_results/config_1_vllm.json
该工具解决了LLM部署中的一个常见挑战:在不依赖手动试错的情况下,为延迟、吞吐量和成本找到最佳配置。llm-optimizer为探索LLM性能景观提供了一种结构化的方式。它通过实现系统基准和跨可能配置的自动搜索,消除了重复的猜测。
开源地址:https://github.com/bentoml/llm-optimizer

低调大师中文资讯倾力打造互联网数据资讯、行业资源、电子商务、移动互联网、网络营销平台。
持续更新报道IT业界、互联网、市场资讯、驱动更新,是最及时权威的产业资讯及硬件资讯报道平台。
转载内容版权归作者及来源网站所有,本站原创内容转载请注明来源。
-
上一篇
北京中小学全面开设人工智能通识课
据报道,自2025年秋季学期起,北京市1400余所中小学全面开设人工智能通识教育课程,覆盖183万余名中小学生,成为全国首个省级全域推进人工智能通识教育的地区。 报道称,课程资源方面,首批覆盖全学段的 160 套市级课程资源已上线,每套资源包含 15 分钟左右的核心教学视频、教学指南及活动任务单; 通过「视频 + 工具 + 任务单」模式满足教师授课、备课及学生自主学习 3 类场景需求,搭建 AI「课程超市」和「应用超市」,为课堂教学提供基础支撑。 市教委相关负责人表示,北京市将持续优化人工智能教育课程资源,结合教学反馈迭代更新;开展应用示范校评选和优秀案例推广,形成可复制经验。 同时,负责人还表示,要深化「京娃」系列智能体研发,拓展「AI + 教育」应用场景等,以首批课程资源为起点,力争将北京中小学人工智能教育打造成全国标杆,真正让数字技术赋能每一位师生,为培养担当民族复兴大任的时代新人奠定坚实基础。
-
下一篇
HarmonyOS NEXT 应用性能优化实战
踏入鸿蒙世界的敲门砖,标志着您在技术征途上的全新起点,提升就业竞争力,获得行业认可,点亮职业成长先机,快人一步抢占未来应用开发赛道!https://developer.huawei.com/consumer/cn/training/dev-cert-detail/101666948302721398?ha_source=hmosclass-sifou&ha_sourceId=89000235 本文旨在深入探讨华为鸿蒙HarmonyOS NEXT系统(截至目前API12)中应用性能优化的技术细节,基于实际开发实践进行总结。主要作为技术分享与交流载体,难免错漏,欢迎各位同仁提出宝贵意见和问题,以便共同进步。本文为原创内容,任何形式的转载必须注明出处及原作者。 一、性能评估指标与工具 (一)关键性能评估指标 1.CPU使用率 CPU使用率是衡量应用在运行过程中对CPU资源占用情况的重要指标。一个高效的HarmonyOS NEXT应用应该在保证功能正常运行的前提下,尽量降低CPU使用率。例如,在一个实时通信应用中,如果CPU使用率过高,可能会导致通话卡顿、消息发送延迟等问题。正常情况下...
相关文章
文章评论
共有0条评论来说两句吧...