Home Technology peripherals AI Liked by Jia Yangqing: SGLang with 3K stars is released, accelerating Llama 405B inference and killing vLLM and TensorRT-LLM in seconds

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

Jul 28, 2024 am 08:07 AM
industry

用來運行 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
Copy after login

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  }'
Copy after login

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

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 of this Website
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

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)
1 months ago By 尊渡假赌尊渡假赌尊渡假赌
R.E.P.O. Best Graphic Settings
1 months ago By 尊渡假赌尊渡假赌尊渡假赌
Will R.E.P.O. Have Crossplay?
1 months ago By 尊渡假赌尊渡假赌尊渡假赌

Hot Tools

Notepad++7.3.1

Notepad++7.3.1

Easy-to-use and free code editor

SublimeText3 Chinese version

SublimeText3 Chinese version

Chinese version, very easy to use

Zend Studio 13.0.1

Zend Studio 13.0.1

Powerful PHP integrated development environment

Dreamweaver CS6

Dreamweaver CS6

Visual web development tools

SublimeText3 Mac version

SublimeText3 Mac version

God-level code editing software (SublimeText3)

DeepMind robot plays table tennis, and its forehand and backhand slip into the air, completely defeating human beginners DeepMind robot plays table tennis, and its forehand and backhand slip into the air, completely defeating human beginners Aug 09, 2024 pm 04:01 PM

But maybe he can’t defeat the old man in the park? The Paris Olympic Games are in full swing, and table tennis has attracted much attention. At the same time, robots have also made new breakthroughs in playing table tennis. Just now, DeepMind proposed the first learning robot agent that can reach the level of human amateur players in competitive table tennis. Paper address: https://arxiv.org/pdf/2408.03906 How good is the DeepMind robot at playing table tennis? Probably on par with human amateur players: both forehand and backhand: the opponent uses a variety of playing styles, and the robot can also withstand: receiving serves with different spins: However, the intensity of the game does not seem to be as intense as the old man in the park. For robots, table tennis

The first mechanical claw! Yuanluobao appeared at the 2024 World Robot Conference and released the first chess robot that can enter the home The first mechanical claw! Yuanluobao appeared at the 2024 World Robot Conference and released the first chess robot that can enter the home Aug 21, 2024 pm 07:33 PM

On August 21, the 2024 World Robot Conference was grandly held in Beijing. SenseTime's home robot brand "Yuanluobot SenseRobot" has unveiled its entire family of products, and recently released the Yuanluobot AI chess-playing robot - Chess Professional Edition (hereinafter referred to as "Yuanluobot SenseRobot"), becoming the world's first A chess robot for the home. As the third chess-playing robot product of Yuanluobo, the new Guoxiang robot has undergone a large number of special technical upgrades and innovations in AI and engineering machinery. For the first time, it has realized the ability to pick up three-dimensional chess pieces through mechanical claws on a home robot, and perform human-machine Functions such as chess playing, everyone playing chess, notation review, etc.

Claude has become lazy too! Netizen: Learn to give yourself a holiday Claude has become lazy too! Netizen: Learn to give yourself a holiday Sep 02, 2024 pm 01:56 PM

The start of school is about to begin, and it’s not just the students who are about to start the new semester who should take care of themselves, but also the large AI models. Some time ago, Reddit was filled with netizens complaining that Claude was getting lazy. "Its level has dropped a lot, it often pauses, and even the output becomes very short. In the first week of release, it could translate a full 4-page document at once, but now it can't even output half a page!" https:// www.reddit.com/r/ClaudeAI/comments/1by8rw8/something_just_feels_wrong_with_claude_in_the/ in a post titled "Totally disappointed with Claude", full of

At the World Robot Conference, this domestic robot carrying 'the hope of future elderly care' was surrounded At the World Robot Conference, this domestic robot carrying 'the hope of future elderly care' was surrounded Aug 22, 2024 pm 10:35 PM

At the World Robot Conference being held in Beijing, the display of humanoid robots has become the absolute focus of the scene. At the Stardust Intelligent booth, the AI ​​robot assistant S1 performed three major performances of dulcimer, martial arts, and calligraphy in one exhibition area, capable of both literary and martial arts. , attracted a large number of professional audiences and media. The elegant playing on the elastic strings allows the S1 to demonstrate fine operation and absolute control with speed, strength and precision. CCTV News conducted a special report on the imitation learning and intelligent control behind "Calligraphy". Company founder Lai Jie explained that behind the silky movements, the hardware side pursues the best force control and the most human-like body indicators (speed, load) etc.), but on the AI ​​side, the real movement data of people is collected, allowing the robot to become stronger when it encounters a strong situation and learn to evolve quickly. And agile

ACL 2024 Awards Announced: One of the Best Papers on Oracle Deciphering by HuaTech, GloVe Time Test Award ACL 2024 Awards Announced: One of the Best Papers on Oracle Deciphering by HuaTech, GloVe Time Test Award Aug 15, 2024 pm 04:37 PM

At this ACL conference, contributors have gained a lot. The six-day ACL2024 is being held in Bangkok, Thailand. ACL is the top international conference in the field of computational linguistics and natural language processing. It is organized by the International Association for Computational Linguistics and is held annually. ACL has always ranked first in academic influence in the field of NLP, and it is also a CCF-A recommended conference. This year's ACL conference is the 62nd and has received more than 400 cutting-edge works in the field of NLP. Yesterday afternoon, the conference announced the best paper and other awards. This time, there are 7 Best Paper Awards (two unpublished), 1 Best Theme Paper Award, and 35 Outstanding Paper Awards. The conference also awarded 3 Resource Paper Awards (ResourceAward) and Social Impact Award (

Hongmeng Smart Travel S9 and full-scenario new product launch conference, a number of blockbuster new products were released together Hongmeng Smart Travel S9 and full-scenario new product launch conference, a number of blockbuster new products were released together Aug 08, 2024 am 07:02 AM

This afternoon, Hongmeng Zhixing officially welcomed new brands and new cars. On August 6, Huawei held the Hongmeng Smart Xingxing S9 and Huawei full-scenario new product launch conference, bringing the panoramic smart flagship sedan Xiangjie S9, the new M7Pro and Huawei novaFlip, MatePad Pro 12.2 inches, the new MatePad Air, Huawei Bisheng With many new all-scenario smart products including the laser printer X1 series, FreeBuds6i, WATCHFIT3 and smart screen S5Pro, from smart travel, smart office to smart wear, Huawei continues to build a full-scenario smart ecosystem to bring consumers a smart experience of the Internet of Everything. Hongmeng Zhixing: In-depth empowerment to promote the upgrading of the smart car industry Huawei joins hands with Chinese automotive industry partners to provide

Li Feifei's team proposed ReKep to give robots spatial intelligence and integrate GPT-4o Li Feifei's team proposed ReKep to give robots spatial intelligence and integrate GPT-4o Sep 03, 2024 pm 05:18 PM

Deep integration of vision and robot learning. When two robot hands work together smoothly to fold clothes, pour tea, and pack shoes, coupled with the 1X humanoid robot NEO that has been making headlines recently, you may have a feeling: we seem to be entering the age of robots. In fact, these silky movements are the product of advanced robotic technology + exquisite frame design + multi-modal large models. We know that useful robots often require complex and exquisite interactions with the environment, and the environment can be represented as constraints in the spatial and temporal domains. For example, if you want a robot to pour tea, the robot first needs to grasp the handle of the teapot and keep it upright without spilling the tea, then move it smoothly until the mouth of the pot is aligned with the mouth of the cup, and then tilt the teapot at a certain angle. . this

Distributed Artificial Intelligence Conference DAI 2024 Call for Papers: Agent Day, Richard Sutton, the father of reinforcement learning, will attend! Yan Shuicheng, Sergey Levine and DeepMind scientists will give keynote speeches Distributed Artificial Intelligence Conference DAI 2024 Call for Papers: Agent Day, Richard Sutton, the father of reinforcement learning, will attend! Yan Shuicheng, Sergey Levine and DeepMind scientists will give keynote speeches Aug 22, 2024 pm 08:02 PM

Conference Introduction With the rapid development of science and technology, artificial intelligence has become an important force in promoting social progress. In this era, we are fortunate to witness and participate in the innovation and application of Distributed Artificial Intelligence (DAI). Distributed artificial intelligence is an important branch of the field of artificial intelligence, which has attracted more and more attention in recent years. Agents based on large language models (LLM) have suddenly emerged. By combining the powerful language understanding and generation capabilities of large models, they have shown great potential in natural language interaction, knowledge reasoning, task planning, etc. AIAgent is taking over the big language model and has become a hot topic in the current AI circle. Au

See all articles