search
HomeTechnology peripheralsAILiked by Jia Yangqing: SGLang with 3K stars is released, accelerating Llama 405B inference and killing vLLM and TensorRT-LLM in seconds

用來運行 Llama 3 405B 優勢明顯。


最近,Meta 開源了最新的 405B 模型(Llama 3.1 405B),把開源模型的性能拉到了新高度。由於模型參數量很大,許多開發者都關心一個問題:怎麼提高模型的推理速度?

時才每隔兩天,LMSYS Org 團隊就出手了,推出了全新的 SGLang Runtime v0.2。這是一個用於 LLM 和 VLM 的通用服務引擎。在運行 Llama 3.1 405B 時,它的吞吐量和延遲表現都優於 vLLM 和 TensorRT-LLM。

在某些情況下(運行 Llama 系列模型),它的吞吐量甚至能達到 TensorRT-LLM 的 2.1 倍,vLLm 的 3.8 倍。
贾扬清点赞:3K star量的SGLang上新,加速Llama 405B推理秒杀vLLM、TensorRT-LLM
LMSYS Org 團隊是一個由加州大學柏克萊分校、加州大學聖地牙哥分校、卡內基美隆大學的學生與教職員共同組成的公開性質的研究團體。他們所發展的大模型評測平台 ——Chatbot Arena 已成為檢驗大模型能力的重要平台,也被認為是相對公平的評測方式。

SGLang 是該團隊開發的一個用於大型語言模型和視覺語言模型的快速服務框架,於今年 1 月份正式推出,在 GitHub 上已經收穫了超過 3k 的 star 量。

贾扬清点赞:3K star量的SGLang上新,加速Llama 405B推理秒杀vLLM、TensorRT-LLM

Die Wirkung dieses Updates ist erstaunlich. Der bekannte KI-Forscher, Mitbegründer und CEO von Lepton AI, Jia Yangqing, kommentierte: „Ich war immer erstaunt über meine Doktor-Alma Mater, die University of California, Berkeley, weil sie weiterhin Ergebnisse bringt.“ das fortschrittlichste künstliche Intelligenz- und Systemkollaborationsdesign. Wir haben SGLang letztes Jahr in Aktion gesehen und können es kaum erwarten, das neue SGLang in der Produktion auszuprobieren! Entwicklung und Iteration auf SGLang? Sie erwähnten in ihrem Blog: „Wir betreiben die Chatbot Arena-Plattform seit mehr als einem Jahr und stellen Dienste für Millionen von Benutzern bereit. Wir sind uns der Bedeutung effizienter Dienste für Produkte und Forschung im Bereich der künstlichen Intelligenz bewusst. Durch betriebliche Erfahrung und in.“ Nach eingehender Forschung verbessern wir weiterhin das zugrunde liegende Servicesystem, vom fortschrittlichen Multi-Modell-Service-Framework FastChat bis zur effizienten Service-Engine SGLang Runtime (SRT) „
贾扬清点赞:3K star量的SGLang上新,加速Llama 405B推理秒杀vLLM、TensorRT-LLM
“Der Schwerpunkt dieses Artikels liegt auf SGLang Runtime Eine universelle Service-Engine für LLM und VLM. Obwohl bestehende Optionen wie TensorRT-LLM, vLLM, MLC-LLM und Hugging Face TGI ihre Vorzüge haben, fanden wir sie manchmal schwierig zu verwenden, schwierig anzupassen oder leistungsschwach veranlasste uns zur Entwicklung von SGLang v0.2, dessen Ziel es ist, eine Service-Engine zu erstellen, die nicht nur benutzerfreundlich und einfach zu ändern ist, sondern auch eine erstklassige Leistung bietet. Im Vergleich zu TensorRT-LLM und vLLM verarbeitet SGLang Runtime Modelle von Llama -8B bis Llama-405B sowie auf A100, wenn FP8 und FP16 auf H100-GPUs verwendet werden, kann es sowohl im Online- als auch im Offline-Szenario konstant eine hervorragende oder wettbewerbsfähige Leistung liefern. SGLang übertrifft vLLM durchweg und erreicht den bis zu 3,8-fachen Durchsatz von Llama-70B. Außerdem erreicht oder übertrifft es regelmäßig TensorRT-LLM und erreicht den bis zu 2,1-fachen Durchsatz des Llama-405B. Darüber hinaus ist SGLang vollständig Open Source, in reinem Python geschrieben und der Kern-Scheduler ist in weniger als 4 KB Codezeilen implementiert.

SGLang ist ein Open-Source-Projekt, das unter der Apache 2.0-Lizenz lizenziert ist. Es wurde von der LMSYS Chatbot Arena verwendet, um einige Modelle, Databricks, mehrere Startups und Forschungseinrichtungen zu unterstützen, Billionen von Token zu generieren und schnellere Iterationen zu ermöglichen.

Das Folgende sind die vergleichenden experimentellen Einstellungen und Ergebnisse mehrerer Frameworks.

Benchmark-Setup

Die Forscher verglichen Offline- und Online-Anwendungsfälle:
Offline: Sie sendeten 2K- bis 3K-Anfragen gleichzeitig und maßen den Ausgabedurchsatz (Tokens/Sekunde). Das heißt, die Anzahl der ausgegebenen Token geteilt durch die Gesamtdauer. Der synthetische Datensatz, den sie testeten, stammte aus dem ShareGPT-Datensatz. Beispielsweise stellt I-512-O-1024 einen Datensatz mit einer durchschnittlichen Eingabe von 512 Token und einer durchschnittlichen Ausgabe von 1024 Token dar. Die fünf Testdatensätze sind:

Datensatz 1: I-243-O-770;
Datensatz 2: I-295-O-770;

    Datensatz 3: I-243-O-386;
  • Datensatz 4: I-295-O-386;
  • Datensatz 5: I-221-O-201.
  • Online: Sie senden Anfragen mit einer Rate von 1 bis 16 Anfragen pro Sekunde (RPS), was die mittlere End-to-End-Latenz misst. Sie verwenden den synthetischen Datensatz I-292-O-579.
  • Sie verwendeten vLLM 0.5.2 (mit Standardparametern) und TensorRT-LLM (mit empfohlenen Parametern und angepasster Batchgröße). Das Präfix-Caching ist für alle Engines deaktiviert. Der Zweck besteht darin, die Grundleistung ohne zusätzliche Funktionen wie spekulative Dekodierung oder Caching zu vergleichen. Sie verglichen SGLang und vLLM mit OpenAI-kompatiblen APIs und TensorRT-LLM mit der Triton-Schnittstelle.

Llama-8B läuft auf einem A100 (bf16)

Die Forscher begannen mit Tests mit einem kleinen Modell Llama-8B. Die folgende Grafik zeigt den maximalen Ausgabedurchsatz, den jede Engine in der Offline-Einstellung für fünf verschiedene Datensätze erreichen kann. Sowohl TensorRT-LLM als auch SGLang können einen Durchsatz von etwa 4000 Token pro Sekunde erreichen, während vLLM etwas dahinter liegt.
Die Online-Benchmark-Grafik unten zeigt ähnliche Trends wie der Offline-Fall. TensorRT-LLM und SGLang weisen eine vergleichbare Leistung auf und können RPS > 10 aufrechterhalten, während die Latenz von vLLM bei höheren Anforderungsraten deutlich zunimmt.
贾扬清点赞:3K star量的SGLang上新,加速Llama 405B推理秒杀vLLM、TensorRT-LLM
Llama-70B running on 8 A100s (bf16)

As for the larger Llama-70B model running tensor parallelism on 8 GPUs, the trend is similar to 8B. In the offline benchmarks below, both TensorRT-LLM and SGLang achieve high throughput.
贾扬清点赞:3K star量的SGLang上新,加速Llama 405B推理秒杀vLLM、TensorRT-LLM
In the online results below, TensorRT-LLM shows lower latency thanks to efficient kernel implementation and runtime.
贾扬清点赞:3K star量的SGLang上新,加速Llama 405B推理秒杀vLLM、TensorRT-LLM
Llama-70B running on 8 H100s (fp8)

Now to test FP8 performance. Both vLLM and SGLang use CUTLASS’s FP8 kernel. In an offline setting, SGLang's batch scheduler is very efficient and can continue to scale throughput as the batch size increases, achieving the highest throughput in this case. Other systems fail to scale throughput or batch size due to OOM, lack of extensive manual tuning, or other overhead. This is also true online, where SGLang and TensorRT have similar median latencies.
贾扬清点赞:3K star量的SGLang上新,加速Llama 405B推理秒杀vLLM、TensorRT-LLM
贾扬清点赞:3K star量的SGLang上新,加速Llama 405B推理秒杀vLLM、TensorRT-LLM
Llama-405B running on 8 H100s (fp8)

Finally, we benchmarked the performance of various methods on the largest 405B model. Since the model is large, most of the time is spent on the GPU kernels. The gap between different frameworks is reduced. The reason for the poor performance of TensorRT-LLM may be that the 405B model has just come out, and the version used in the figure has not yet integrated some of the latest optimizations. SGLang has the best performance both online and offline.
贾扬清点赞:3K star量的SGLang上新,加速Llama 405B推理秒杀vLLM、TensorRT-LLM
贾扬清点赞:3K star量的SGLang上新,加速Llama 405B推理秒杀vLLM、TensorRT-LLM
SGLang Overview

SGLang is a service framework for large-scale language models and visual language models. It is based on and enhances many of the best designs from multiple open source LLM service engines, including LightLLM, vLLM, and Guidance. It leverages high-performance attention CUDA kernels from FlashInfer and integrates torch.compile inspired by gpt-fast.

In addition, researchers also introduced some innovative technologies, such as RadixAttention for automatic KV cache reuse and compressed state machine for fast constraint decoding. SGLang is known for its efficient batch scheduler implemented entirely in Python. For a fair comparison, this blog tested the base performance of these service engines with specific scenario or workload optimizations such as prefix caching and speculative decoding turned off. SGLang's speedup is achieved through proper engineering. SGLang's efficient Python-based batch scheduler scales well and is often comparable to or better than closed-source implementations built in C++.

Table 1 compares various aspects of SGLang, TensorRT-LLM and vLLM. In terms of performance, both SGLang and TensorRT-LLM are excellent. In terms of usability and customizability, SGLang's lightweight and modular core makes it easy to customize, while TensorRT-LLM's complex C++ technology stack and setup instructions make it more difficult to use and modify. The source code of SGLang is fully open source, while TensorRT-LLM is only partially open source. In comparison, vLLM has higher CPU scheduling overhead.
贾扬清点赞:3K star量的SGLang上新,加速Llama 405B推理秒杀vLLM、TensorRT-LLM
The researchers also said that in the future they will also develop new features such as long context and MoE optimization.

How to use

You can easily serve the Llama model by following the steps below:

1. Install SGLang using pip, source code or Docker: https://github.com/sgl -project/sglang/tree/main?tab=readme-ov-file#install

2. Start the server:
# Llama 8Bpython -m sglang.launch_server --model-path meta-llama/Meta-Llama-3.1-8B-Instruct# Llama 405Bpython -m sglang.launch_server --model-path meta-llama/Meta-Llama-3.1-405B-Instruct-FP8 --tp 8

3. Use the OpenAI compatible API to send a request:
curl http://localhost:30000/v1/completions \-H "Content-Type: application/json" \-d '{"model": "default","prompt": "Say this is a test","max_tokens": 7,"temperature": 0  }'

4. Running the benchmark:
python3 -m sglang.bench_serving --backend sglang --num-prompts 1000

Appendix: Detailed benchmark setup

Instructions for reproducing the benchmark are located at sglang/benchmark/blog_v0_2.

For all benchmarks, the researchers set ignore_eos or min_length/end_id to ensure that each engine outputs the same number of tokens. They tried using vLLM 0.5.3.post1 but it crashed frequently under high load and vLLM 0.5.3.post1 performance seemed to be about the same or worse compared to vLLM 0.5.2 in some benchmarks. Therefore, they report results for vLLM 0.5.2. Although they knew that different server configurations could have a significant impact on service performance, they mainly used the default parameters of each engine to simulate the situation of ordinary users.

For the 8B and 70B models, they use meta-llama/Meta-Llama-3-8B-Instruct and meta-llama/Meta-Llama-3-70B-Instruct bf16 checkpoints, as well as neuralmagic/Meta-Llama -3-70B-Instruct-FP8 fp8 checkpoint. For the 405B model, they used dummy weights in all benchmarks. Since TensorRT-LLM latest image r24.06 does not support fbgemm_fp8 quantization in the official meta-llama/Meta-Llama-3.1-405B-FP8 checkpoint, they use per-layer fp8 quantization in all frameworks, and do not support lm_head except fbgemm_fp8 quantization. All layers were quantified. They believe this allows for a fair comparison of all engines. A100 and H100 GPUs are 80GB SXM versions.

Reference link: https://lmsys.org/blog/2024-07-25-sglang-llama3/

The above is the detailed content of Liked by Jia Yangqing: SGLang with 3K stars is released, accelerating Llama 405B inference and killing vLLM and TensorRT-LLM in seconds. For more information, please follow other related articles on the PHP Chinese website!

Statement
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
DSA如何弯道超车NVIDIA GPU?DSA如何弯道超车NVIDIA GPU?Sep 20, 2023 pm 06:09 PM

你可能听过以下犀利的观点:1.跟着NVIDIA的技术路线,可能永远也追不上NVIDIA的脚步。2.DSA或许有机会追赶上NVIDIA,但目前的状况是DSA濒临消亡,看不到任何希望另一方面,我们都知道现在大模型正处于风口位置,业界很多人想做大模型芯片,也有很多人想投大模型芯片。但是,大模型芯片的设计关键在哪,大带宽大内存的重要性好像大家都知道,但做出来的芯片跟NVIDIA相比,又有何不同?带着问题,本文尝试给大家一点启发。纯粹以观点为主的文章往往显得形式主义,我们可以通过一个架构的例子来说明Sam

阿里云通义千问14B模型开源!性能超越Llama2等同等尺寸模型阿里云通义千问14B模型开源!性能超越Llama2等同等尺寸模型Sep 25, 2023 pm 10:25 PM

2021年9月25日,阿里云发布了开源项目通义千问140亿参数模型Qwen-14B以及其对话模型Qwen-14B-Chat,并且可以免费商用。Qwen-14B在多个权威评测中表现出色,超过了同等规模的模型,甚至有些指标接近Llama2-70B。此前,阿里云还开源了70亿参数模型Qwen-7B,仅一个多月的时间下载量就突破了100万,成为开源社区的热门项目Qwen-14B是一款支持多种语言的高性能开源模型,相比同类模型使用了更多的高质量数据,整体训练数据超过3万亿Token,使得模型具备更强大的推

ICCV 2023揭晓:ControlNet、SAM等热门论文斩获奖项ICCV 2023揭晓:ControlNet、SAM等热门论文斩获奖项Oct 04, 2023 pm 09:37 PM

在法国巴黎举行了国际计算机视觉大会ICCV(InternationalConferenceonComputerVision)本周开幕作为全球计算机视觉领域顶级的学术会议,ICCV每两年召开一次。ICCV的热度一直以来都与CVPR不相上下,屡创新高在今天的开幕式上,ICCV官方公布了今年的论文数据:本届ICCV共有8068篇投稿,其中有2160篇被接收,录用率为26.8%,略高于上一届ICCV2021的录用率25.9%在论文主题方面,官方也公布了相关数据:多视角和传感器的3D技术热度最高在今天的开

复旦大学团队发布中文智慧法律系统DISC-LawLLM,构建司法评测基准,开源30万微调数据复旦大学团队发布中文智慧法律系统DISC-LawLLM,构建司法评测基准,开源30万微调数据Sep 29, 2023 pm 01:17 PM

随着智慧司法的兴起,智能化方法驱动的智能法律系统有望惠及不同群体。例如,为法律专业人员减轻文书工作,为普通民众提供法律咨询服务,为法学学生提供学习和考试辅导。由于法律知识的独特性和司法任务的多样性,此前的智慧司法研究方面主要着眼于为特定任务设计自动化算法,难以满足对司法领域提供支撑性服务的需求,离应用落地有不小的距离。而大型语言模型(LLMs)在不同的传统任务上展示出强大的能力,为智能法律系统的进一步发展带来希望。近日,复旦大学数据智能与社会计算实验室(FudanDISC)发布大语言模型驱动的中

百度文心一言全面向全社会开放,率先迈出重要一步百度文心一言全面向全社会开放,率先迈出重要一步Aug 31, 2023 pm 01:33 PM

8月31日,文心一言首次向全社会全面开放。用户可以在应用商店下载“文心一言APP”或登录“文心一言官网”(https://yiyan.baidu.com)进行体验据报道,百度计划推出一系列经过全新重构的AI原生应用,以便让用户充分体验生成式AI的理解、生成、逻辑和记忆等四大核心能力今年3月16日,文心一言开启邀测。作为全球大厂中首个发布的生成式AI产品,文心一言的基础模型文心大模型早在2019年就在国内率先发布,近期升级的文心大模型3.5也持续在十余个国内外权威测评中位居第一。李彦宏表示,当文心

AI技术在蚂蚁集团保险业务中的应用:革新保险服务,带来全新体验AI技术在蚂蚁集团保险业务中的应用:革新保险服务,带来全新体验Sep 20, 2023 pm 10:45 PM

保险行业对于社会民生和国民经济的重要性不言而喻。作为风险管理工具,保险为人民群众提供保障和福利,推动经济的稳定和可持续发展。在新的时代背景下,保险行业面临着新的机遇和挑战,需要不断创新和转型,以适应社会需求的变化和经济结构的调整近年来,中国的保险科技蓬勃发展。通过创新的商业模式和先进的技术手段,积极推动保险行业实现数字化和智能化转型。保险科技的目标是提升保险服务的便利性、个性化和智能化水平,以前所未有的速度改变传统保险业的面貌。这一发展趋势为保险行业注入了新的活力,使保险产品更贴近人民群众的实际

致敬TempleOS,有开发者创建了启动Llama 2的操作系统,网友:8G内存老电脑就能跑致敬TempleOS,有开发者创建了启动Llama 2的操作系统,网友:8G内存老电脑就能跑Oct 07, 2023 pm 10:09 PM

不得不说,Llama2的「二创」项目越来越硬核、有趣了。自Meta发布开源大模型Llama2以来,围绕着该模型的「二创」项目便多了起来。此前7月,特斯拉前AI总监、重回OpenAI的AndrejKarpathy利用周末时间,做了一个关于Llama2的有趣项目llama2.c,让用户在PyTorch中训练一个babyLlama2模型,然后使用近500行纯C、无任何依赖性的文件进行推理。今天,在Karpathyllama2.c项目的基础上,又有开发者创建了一个启动Llama2的演示操作系统,以及一个

快手黑科技“子弹时间”赋能亚运转播,打造智慧观赛新体验快手黑科技“子弹时间”赋能亚运转播,打造智慧观赛新体验Oct 11, 2023 am 11:21 AM

杭州第19届亚运会不仅是国际顶级体育盛会,更是一场精彩绝伦的中国科技盛宴。本届亚运会中,快手StreamLake与杭州电信深度合作,联合打造智慧观赛新体验,在击剑赛事的转播中,全面应用了快手StreamLake六自由度技术,其中“子弹时间”也是首次应用于击剑项目国际顶级赛事。中国电信杭州分公司智能亚运专班组长芮杰表示,依托快手StreamLake自研的4K3D虚拟运镜视频技术和中国电信5G/全光网,通过赛场内部署的4K专业摄像机阵列实时采集的高清竞赛视频,

See all articles

Hot AI Tools

Undresser.AI Undress

Undresser.AI Undress

AI-powered app for creating realistic nude photos

AI Clothes Remover

AI Clothes Remover

Online AI tool for removing clothes from photos.

Undress AI Tool

Undress AI Tool

Undress images for free

Clothoff.io

Clothoff.io

AI clothes remover

AI Hentai Generator

AI Hentai Generator

Generate AI Hentai for free.

Hot Article

R.E.P.O. Energy Crystals Explained and What They Do (Yellow Crystal)
3 weeks agoBy尊渡假赌尊渡假赌尊渡假赌
R.E.P.O. Best Graphic Settings
3 weeks agoBy尊渡假赌尊渡假赌尊渡假赌
R.E.P.O. How to Fix Audio if You Can't Hear Anyone
3 weeks agoBy尊渡假赌尊渡假赌尊渡假赌
WWE 2K25: How To Unlock Everything In MyRise
3 weeks agoBy尊渡假赌尊渡假赌尊渡假赌

Hot Tools

SublimeText3 Linux new version

SublimeText3 Linux new version

SublimeText3 Linux latest version

PhpStorm Mac version

PhpStorm Mac version

The latest (2018.2.1) professional PHP integrated development tool

Atom editor mac version download

Atom editor mac version download

The most popular open source editor

SAP NetWeaver Server Adapter for Eclipse

SAP NetWeaver Server Adapter for Eclipse

Integrate Eclipse with SAP NetWeaver application server.

Zend Studio 13.0.1

Zend Studio 13.0.1

Powerful PHP integrated development environment