Open SourceHardware & Inference 🇺🇸 27.07.2026 04:05

Hugging Face Transformers Backend for vLLM Achieves Native Performance

Hugging FaceHugging Face
The integration of Hugging Face Transformers as a modeling backend in vLLM now matches or exceeds native vLLM throughput across various Qwen3 models, including dense and mixture-of-experts architectures, without requiring custom porting. This is achieved through dynamic layer fusions at runtime using torch.fx and AST manipulation, allowing any compatible model to run at native speed with a single flag.
The Hugging Face Transformers library, which supports over 450 architectures, has been integrated as a modeling backend in vLLM since last year, enabling model authors to run Transformers models inside vLLM without porting. The latest iteration of this integration now achieves native vLLM inference speed for compatible models. Benchmarks comparing the Transformers backend head-to-head with vLLM's native implementations across three Qwen3 models (4B dense, 32B dense, and 235B FP8 MoE) show that the Transformers backend meets or beats native throughput in all cases. The performance improvement comes from dynamically applying inference-specific layer fusions at runtime, using torch.fx for static analysis and AST for source code manipulation. These fusions include operations mapped to vLLM's optimized kernels for expert parallelization in MoE models, as well as parallel linear layers for tensor and pipeline parallelism. The manipulated models remain fully compilable with torch.compile and CUDA Graphs. Any Hugging Face model can be run with the single flag --model-impl transformers, and it composes with existing parallelism options. Models with linear attention are not yet supported, and custom models from Hub repos are unlikely to work.
Сокращения
GPU = Graphics Processing Unit — графический процессор
MoE = Mixture of Experts — смесь экспертов
FP8 = Floating Point 8-bit — 8-битное число с плавающей запятой
AST = Abstract Syntax Tree — абстрактное синтаксическое дерево
TP = Tensor Parallelism — тензорный параллелизм
PP = Pipeline Parallelism — конвейерный параллелизм
Source: Hugging Face blog — original
Our earlier posts on this topic ↓
Fresh news