Skip to content

Commit e0e352b

Browse files
authored
[worker] fix: create a new event loop if none exists when building rollouts (#3803)
1 parent 85d5b2e commit e0e352b

File tree

1 file changed

+1
-2
lines changed

1 file changed

+1
-2
lines changed

verl/workers/fsdp_workers.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -630,8 +630,7 @@ def _build_rollout(self, trust_remote_code=False):
630630
# For sync mode, we directly switch to trainer mode here.
631631
# For async mode, we can't call run_until_complete here, so we will switch to trainer mode in AgentLoopManager.
632632
if rollout_config.mode == "sync" and self._is_actor:
633-
loop = asyncio.get_event_loop()
634-
loop.run_until_complete(self.trainer_mode())
633+
asyncio.run(self.trainer_mode())
635634

636635
async def rollout_mode(self):
637636
"""Context switch hybridengine to rollout mode."""

0 commit comments

Comments
 (0)