#7428·trl

性能问题: 同一位置的 vLLM 在一个展开的工具转换之间休眠并重新加载权重

作者: ingambe创建于 2026年9月28日更新于 2026年9月28日

Reproduction

With colocated vLLM and sleep enabled, every generation call inside one GRPO rollout (i.e., agentic loops) synchronizes the weights and then sleeps. In a multi-turn rollout (tool calls, or a custom rollout_func), the turns are separated only by CPU work, with no optimizer step in between. Level-2 sleep discards the weights, so each turn reloads the same policy. Same for DistillationTrainer.

Trainer flow:

  1. GRPOTrainer._generate() generates the first turn, then enters _tool_call_loop().
  2. _tool_call_loop() repeats while tool calls remain. It executes the tools, appends their results, and calls _generate_single_turn() again.
  3. _generate_single_turn() checks the training step, then calls VLLMGeneration.generate(). Inside that method, sleeping weights trigger synchronization, and each completed call sleeps again.

内容来源: huggingface/trl