Back
HChuggingface.co
22
·1 days ago·Official · RSS

Native-speed vLLM transformers modeling backend

View original
Why it matters

An official release brings Hugging Face model updates — worth tracking for capability changes, ecosystem impact, and follow-up.

AI summary

The transformers vLLM backend now matches or exceeds the speed of custom vLLM implementations for many LLM architectures.…

TL;DR: The transformers vLLM backend is now as fast (or faster) than custom vLLM implementations for many LLM architectures. Model authors can automatically leverage their transformers implementations to get ultra fast vLLM inference, for free.

# Upgrade the vllm pip package uv pip install --upgrade vllm --torch-backend auto

The transformers library has become the reference modeling library for Machine Learning. It supports 450+ architectures through consistent APIs, and is designed with the main goal that model implementations are self contained and easy to understand . Going through transformers code makes it easy for contributors to learn how an architecture works, and then port it to other frameworks such as vLLM, SGLang, MLX, llama.cpp, and many others.

We have fully embraced this role in the ecosystem and are investing a lot of effort to make it easier. A big step in this direction was the integration last year of transformers as a modeling backend in vLLM. This has been allowing model authors to run transformers models (LLMs and VLMs alike) inside vLLM, without having to port anything. Transformers provides the modeling code, and vLLM provides extremely optimized inference techniques such as continuous batching and custom attention kernels.

This integration gets better now 🚀!

Showcase

We put the transformers modeling backend for vLLM head to head with vLLM's hand written native implementations across three very different Qwen3 models:

- 4B dense model on a single GPU

- 32B dense model on tensor parallelism

- 235B-parameter FP8 Mixture-of-Experts on data + expert parallelism on the same 8×H100 node

The result: the transformers modeling backend now meets or beats native throughput on every one of them.

Running any* Hugging Face model through the transformers modeling backend is a single flag — --model-impl transformers. It composes with the usual parallelism options, so nothing about your serving setup changes:

# Qwen3-4B dense, single GPU vllm serve Qwen/Qwen3-4B --model-impl transformers

# Qwen3-32B dense, tensor-parallel across 2 GPUs vllm serve Qwen/Qwen3-32B --model-impl transformers --tensor-parallel-size 2

# Qwen3-235B-A22B-FP8 MoE, data-parallel + expert-parallel across 8 GPUs vllm serve Qwen/Qwen3-235B-A22B-FP8 --model-impl transformers --data-parallel-size 8 --enable-expert-parallel # add --max-model-len 8192 if your node is memory constrained

*Models that use linear attention are not currently supported, but they will be soon! Custom models where the code lives in a Hub repo are unlikely to work as they will not have been written compliantly.

How we measured

Each model is compared under three conditions that are identical in every way except the code path:

- native — --model-impl vllm, vLLM's hand-written model (the bar to match)

- after — --model-impl transformers with the PR

- before — --model-impl transformers without the PR

The full, reproducible runner is available as a gist: benchmark.sh

So, what's new?

The transformers modeling backend for vLLM used to focus on attention as the bottleneck for inference. By plugging vLLM’s attention implementation at runtime, we could make a transformers model run efficiently inside the vLLM engine. But there are many dimensions to deployments that only a custom port can target to extract maximum inference performance. Parallelization across GPUs, compilation, fused kernels, and many more, all contribute to leveraging your hardware to achieve ultra-fast inference.

TopicsOfficial announcementHugging FaceModel releaseOpen source
Keywords#transformers#modeling#backend#native#speed#vllm
View originalhuggingface.co
Single official source, no cross-check yet