
The transformers library's modeling backend for vLLM can now match the inference speed of custom vLLM implementations through dynamic layer fusions applied at runtime.
This means model authors can deploy transformers models directly in vLLM without writing custom optimization code, cutting development time and letting new models reach production-grade performance immediately.
What happened
The transformers modeling backend for vLLM now achieves inference speed comparable to vLLM's custom hand-written implementations across multiple Qwen3 model sizes—from 4B dense models to 235B Mixture-of-Experts models—by using torch.fx and abstract syntax tree manipulation to apply layer fusions at runtime.
Why it matters
Model authors no longer need to write separate optimized code for vLLM; they can use their transformers implementations directly and automatically get native vLLM inference performance. This reduces duplicate engineering work and makes it easier for new models to reach production speed without custom porting.
What to watch
Models using linear attention are not currently supported but will be soon. The full optimization process uses torch.fx for static analysis to identify fusible patterns, then rewrites operations to map to vLLM's ultra-optimized kernels (MergedColumnParallelLinear, QKVParallelLinear, and expert-parallel kernels).
Ask the AI about this article →
The transformers library has established itself as the reference modeling standard for machine learning, supporting 450+ architectures through consistent APIs. Previously, achieving ultra-fast vLLM inference required model authors to write custom vLLM implementations in parallel with their transformers code—a duplicative and time-consuming process. The transformers backend for vLLM, integrated last year, allowed transformers models to run inside vLLM without porting, but performance still lagged because the focus was primarily on optimizing attention operations.
The new iteration solves this gap by dynamically applying inference-specific layer fusions at runtime, using torch.fx and abstract syntax tree manipulation to identify and rewrite fusible patterns. Testing across three different Qwen3 models—a 4B dense model, a 32B dense model with tensor parallelism, and a 235B Mixture-of-Experts model with data and expert parallelism—showed that the transformers backend now meets or exceeds the throughput of hand-written native vLLM implementations. This means a model author needs to integrate their architecture only once (in transformers) and can immediately leverage vLLM's full inference optimization suite without writing a single line of custom code.
The transformation is significant for the ML ecosystem: it lowers the barrier for new models to reach production-grade serving speed, reduces engineering duplication, and lets model code be reused across training and inference workflows. The one current limitation is that models using linear attention are not yet supported, though the article indicates this gap will be closed soon.
For example, today's edition would include:
AI-summarized, only the topics you pick — one digest a day via Email, Slack, or Discord.
Free · takes 30 seconds · unsubscribe anytimeWhat is AIToday? →
Ask AI anything about this article. Q&As are published on this page for other readers too.
CBTS Technology Solutions LLC launched Forge Agents, a platform that turns a plain-language job description in…
Imec CEO Patrick Vandenameele said at SEMICON Taiwan 2026 that the Belgian research center is broadening its c…

Alphabet's AI Overviews now reach over 2.5 billion monthly users through Google Search, and its ad business ge…

Amazon Web Services (AWS) has integrated its fully managed data warehouse service, Amazon Redshift, with Agent…

Visual Studio Code 1.135 now includes an experimental 'Rubber Duck' feature that lets developers request a sec…

Sonos announced a new app update with generative AI features, a new soundbar called the Beam Ultra, and its se…
