性能问题: 同一位置的 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:
GRPOTrainer._generate()generates the first turn, then enters_tool_call_loop()._tool_call_loop()repeats while tool calls remain. It executes the tools, appends their results, and calls_generate_single_turn()again._generate_single_turn()checks the training step, then callsVLLMGeneration.generate(). Inside that method, sleeping weights trigger synchronization, and each completed call sleeps again.
内容来源: huggingface/trl