---
title: "No GPU left behind: Unlocking Efficiency with Co-located vLLM in TRL"
description: "TRL v0.18.0 can run vLLM co-located with the training job on the same GPUs. vLLM's external_launcher executor puts it inside the torch.distributed process group, replacing the separate HTTP server that left training and inference GPUs idle in turn during GRPO's frequent generation steps."
url: "https://swe.quest/articles/no-gpu-left-behind-unlocking-efficiency-with-co-located-vllm-in-trl-6f9360880cc9b7e0"
canonical: "https://huggingface.co/blog/vllm-colocate"
source: "Hugging Face"
published: "2025-06-03"
difficulty: "hard"
kind: "Case study"
reading_minutes: 22
tags: ["model-training","inference","performance","llms"]
---

# No GPU left behind: Unlocking Efficiency with Co-located vLLM in TRL

A post on [Hugging Face](https://swe.quest/sources/hugging-face.md), published 2025-06-03, 22 min read, Case study. Original: [https://huggingface.co/blog/vllm-colocate](https://huggingface.co/blog/vllm-colocate)

## Summary

TRL v0.18.0 can run vLLM co-located with the training job on the same GPUs. vLLM's external\_launcher executor puts it inside the torch.distributed process group, replacing the separate HTTP server that left training and inference GPUs idle in turn during GRPO's frequent generation steps. Benchmarks show up to 1.43× throughput for a 1.5B model with larger batches and up to 1.73× for a 7B model with higher tensor parallelism, though extra TP hurts small models. Qwen2.5-Math-72B trained ~1.26× faster on fewer GPUs with matching rewards and Math500 scores, using vLLM level-2 sleep to free memory and DeepSpeed ZeRO-3 with CPU optimizer offload. The write-up also covers debugging a TP seed-determinism regression, a buffer-restore bug after sleep and a remaining shutdown segfault.

Written by swe.quest, not by the author.

**Difficulty:** Hard: written for specialists in the field

## Topics

- [Model training](https://swe.quest/tags/model-training.md) (AI & ML)
- [Inference & serving](https://swe.quest/tags/inference.md) (AI & ML)
- [Performance engineering](https://swe.quest/tags/performance.md) (Reliability & operations)
- [LLMs](https://swe.quest/tags/llms.md) (AI & ML)

## Prerequisites

- GRPO / RL fine-tuning of LLMs ([easy posts on Model training](https://swe.quest/tags/model-training.md?difficulty=easy))
- tensor and data parallelism ([easy posts on Concurrency](https://swe.quest/tags/concurrency.md?difficulty=easy))
- torch.distributed
- GPU memory management ([easy posts on Hardware](https://swe.quest/tags/hardware.md?difficulty=easy))

## Keywords

TRL, vLLM, GRPO, DeepSpeed ZeRO-3, Qwen2.5-Math-72B, Accelerate, torchrun

## Related posts

- [Async GRPO with LoRA across HF Jobs: a bucket, a proxy, and no NCCL](https://swe.quest/articles/async-grpo-with-lora-across-hf-jobs-a-bucket-a-proxy-and-no-nccl-a625fff69adbae9a.md): Hugging Face · 2026-09-10 · Hard · 29 min read · Model training, Inference & serving, Caching, Load balancing, LLMs
  TRL v1.14's AsyncGRPOTrainer can train a LoRA adapter and sync only that adapter to vLLM, which lets the trainer and inference replicas run as separate Hugging Face Jobs on separate machines without NCCL.
- [Fine-tuning Llama 2 70B using PyTorch FSDP](https://swe.quest/articles/fine-tuning-llama-2-70b-using-pytorch-fsdp-0e8dde34b4ad3fd0.md): Hugging Face · 2023-09-13 · Hard · 10 min read · Model training, LLMs, Hardware, Python
  Full fine-tuning of Llama 2 70B across two nodes of 8×A100 80GB GPUs with PyTorch FSDP, Hugging Face Accelerate, Transformers and TRL, addressing three obstacles.
- [Shipping a Trillion Parameters With a Hub Bucket: Delta Weight Sync in TRL](https://swe.quest/articles/shipping-a-trillion-parameters-with-a-hub-bucket-delta-weight-sync-in-trl-5d3970ad53bc1dc5.md): Hugging Face · 2026-05-27 · Hard · 17 min read · Model training, Inference & serving, Distributed systems, Storage systems
  Between consecutive RL optimizer steps, about 99% of bf16 weights stay bit-identical because Adam updates at RL learning rates fall below bf16's rounding threshold (|Δw| \< |w|/256).
- [Make LLM Fine-tuning 2x faster with Unsloth and 🤗 TRL](https://swe.quest/articles/make-llm-fine-tuning-2x-faster-with-unsloth-and-trl-5db8c0b6a40cf74e.md): Hugging Face · 2024-01-10 · Medium · 5 min read · Model training, LLMs, Performance engineering, Python
  Unsloth speeds up QLoRA fine-tuning of Llama and Mistral-family models by rewriting PyTorch modules as Triton kernels with manually derived backpropagation.
- [Fine-tuning 20B LLMs with RLHF on a 24GB consumer GPU](https://swe.quest/articles/fine-tuning-20b-llms-with-rlhf-on-a-24gb-consumer-gpu-7ad6c7bb6c14c3cf.md): Hugging Face · 2023-03-09 · Hard · 11 min read · Model training, LLMs, Machine learning, Python
  Combining trl with peft and bitsandbytes makes RLHF fine-tuning of a 20B-parameter LLM feasible on a single 24GB consumer GPU.

Browse: [Latest posts](https://swe.quest/index.md) · [Topics](https://swe.quest/tags.md) · [Sources](https://swe.quest/sources.md) · [Topic map](https://swe.quest/map.md) · [Site guide (llms.txt)](https://swe.quest/llms.txt)
