-
Notifications
You must be signed in to change notification settings - Fork 800
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Text-Generation-Inference introducing Multi-Backend #2580
Merged
Merged
Changes from 24 commits
Commits
Show all changes
26 commits
Select commit
Hold shift + click to select a range
aa62930
misc: initial blog draft
mfuntowicz 6f29460
Update tgi-multi-backend.md
mfuntowicz 07ece69
Update tgi-multi-backend.md
mfuntowicz 1b82f39
Update tgi-multi-backend.md
mfuntowicz aaffb2b
Update tgi-multi-backend.md
mfuntowicz 7c7117d
Update tgi-multi-backend.md
mfuntowicz 255db00
Update tgi-multi-backend.md
mfuntowicz 044d78e
Update tgi-multi-backend.md
mfuntowicz 8eca117
Update tgi-multi-backend.md
mfuntowicz 6650fe5
Update tgi-multi-backend.md
mfuntowicz b28bbfd
Update tgi-multi-backend.md
mfuntowicz ce12c64
Update tgi-multi-backend.md
mfuntowicz 49900a0
Update tgi-multi-backend.md
mfuntowicz 63eb4a7
Update tgi-multi-backend.md
mfuntowicz bec047b
Update tgi-multi-backend.md
mfuntowicz 7d27c60
Update tgi-multi-backend.md
mfuntowicz 6e9be23
Update tgi-multi-backend.md
mfuntowicz 119d684
Update tgi-multi-backend.md
mfuntowicz 7716066
Update tgi-multi-backend.md
mfuntowicz 694a38e
addresses more suggestions
mfuntowicz 3aa00fd
add tpu jetstream reference
mfuntowicz 1f2f3f1
update author to match schema
mfuntowicz 905c078
Fix PR comments, add thumbnail, move stack image to repo.
Hugoch 5416483
Merge branch 'main' into tgi-multi-backend
Hugoch 46930ad
Fix: update TGI backend article publish date.
Hugoch 77c9683
Merge branch 'main' into tgi-multi-backend
Hugoch File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,48 @@ | ||
--- | ||
title: "Introducing multi-backends (TRT-LLM, vLLM) support for Text Generation Inference" | ||
thumbnail: /blog/assets/tgi-multi-backend/thumbnail.png | ||
authors: | ||
- user: mfuntowicz | ||
- user: hlarcher | ||
--- | ||
|
||
# Introducing multi-backends (TRT-LLM, vLLM) support for Text Generation Inference | ||
|
||
## Introduction | ||
|
||
Since its initial release in 2022, Text-Generation-Inference (TGI) has provided Hugging Face and the AI Community with a performance-focused solution to easily deploy large-language models (LLMs). TGI initially offered an almost no-code solution to load models from the Hugging Face Hub and deploy them in production on NVIDIA GPUs. Over time, support expanded to include AMD Instinct GPUs, Intel GPUs, AWS Trainium/Inferentia, Google TPU, and Intel Gaudi. | ||
Over the years, multiple inferencing solutions have emerged, including vLLM, SGLang, llama.cpp, TensorRT-LLM, etc., splitting up the overall ecosystem. Different models, hardware, and use cases may require a specific backend to achieve optimal performance. However, configuring each backend correctly, managing licenses, and integrating them into existing infrastructure can be challenging for users. | ||
|
||
To address this, we are excited to introduce the concept of TGI Backends. This new architecture gives the flexibility to integrate with any of the solutions above through TGI as a single unified frontend layer. This change makes it easier for the community to get the best performance for their production workloads, switching backends according to their modeling, hardware, and performance requirements. | ||
|
||
The Hugging Face team is excited to contribute to and collaborate with the teams that build vLLM, llama.cpp, TensorRT-LLM, and the teams at AWS, Google, NVIDIA, AMD and Intel to offer a robust and consistent user experience for TGI users whichever backend and hardware they want to use. | ||
|
||
![TGI multi-backend stack](https://huggingface.co/datasets/huggingface/documentation-images/resolve/main/blog/tgi-multi-backend/tgi-multi-backend-stack.png) | ||
|
||
## TGI Backend: under the hood | ||
|
||
TGI is made of multiple components, primarily written in Rust and Python. Rust powers the HTTP and scheduling layers, and Python remains the go-to for modeling. | ||
|
||
Long story short: Rust allows us to improve the overall robustness of the serving layer with static analysis and compiler-based memory safety enforcement: it brings the ability to scale to multiple cores with the same safety guarantees more easily. Leveraging Rust’s strong type system for the HTTP layer and scheduler makes it possible to avoid memory issues while maximizing the concurrency, bypassing Global Interpreter Lock (GIL) in Python-based environments. | ||
|
||
Speaking about Rust… Surprise, that's the TGI starting point to integrate a new backend \- 🤗 | ||
|
||
Earlier this year, the TGI team worked on exposing the foundational knobs to disentangle how the actual HTTP server and the scheduler were coupled together. | ||
This work introduced the new Rust `trait Backend` to interface current inference engine and the one to come. | ||
|
||
Having this new `Backend` interface (or trait in Rusty terms) paves the way for modularity and makes it possible to actually route the incoming requests towards different modeling and execution engines. | ||
|
||
## Looking forward: 2025 | ||
|
||
The new multi-backend capabilities of TGI open up many impactful roadmap opportunities. As we look ahead to 2025 we are excited to share some of the TGI developments we are most excited about: | ||
|
||
* **NVIDIA TensorRT-LLM backend**: We are collaborating with the NVIDIA TensorRT-LLM team to bring all the optimized NVIDIA GPUs \+ TensorRT performances to the community. This work will be covered more extensively in an upcoming blog post. It closely relates to our mission to empower AI builders with the open-source availability of both `optimum-nvidia` quantize/build/evaluate TensorRT compatible artifacts alongside TGI+TRT-LLM to easily deploy, execute, and scale deployments on NVIDIA GPUs. | ||
* **Llama.cpp backend**: We are collaborating with the llama.cpp team to extend the support for server production use cases. The llama.cpp backend for TGI will provide a strong CPU-based option for anyone willing to deploy on Intel, AMD, or ARM CPU servers. | ||
* **vLLM backend**: We are contributing to the vLLM project and are looking to integrate vLLM as a TGI backend in Q1 '25. | ||
* **AWS Neuron backend**: we are working with the Neuron teams at AWS to enable Inferentia 2 and Trainium 2 support natively in TGI. | ||
* **Google TPU backend**: We are working with the Google Jetstream & TPU teams to provide the best performance through TGI. | ||
|
||
mfuntowicz marked this conversation as resolved.
Show resolved
Hide resolved
|
||
We are confident TGI Backends will help simplify the deployments of LLMs, bringing versatility and performance to all TGI users. | ||
You'll soon be able to use TGI Backends directly within [Inference Endpoints](https://huggingface.co/inference-endpoints/). Customers will be able to easily deploy models with TGI Backends on various hardware with top-tier performance and reliability out of the box. | ||
|
||
Stay tuned for the next blog post where we'll dig into technical details and performance benchmarks of upcoming backends\! |
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
just noticed this small detail when skimming the text:
"...bypassing Global Interpreter Lock (GIL) in..."
--> "...bypassing the Global Interpreter Lock (GIL) in ..."
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
"the" is not actually needed here in this case because it is not referring to a definite article due to the use of "in Python-based environments"
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ah okay, I thought the definite article would still commonly be used when talking about specific entities, like "the Mona Lisa in Paris", "The Global Interpreter Lock in Python" etc 👍