File tree Expand file tree Collapse file tree 1 file changed +7
-5
lines changed
Expand file tree Collapse file tree 1 file changed +7
-5
lines changed Original file line number Diff line number Diff line change @@ -733,16 +733,18 @@ async def _collect_result(config, lst):
733733 r .eval_metadata .status = Status .eval_finished ()
734734 active_logger .log (r )
735735
736- tasks = []
737- for i in range (num_runs ):
738- tasks .append (asyncio .create_task (execute_run (i , config )))
739-
740736 # if rollout_processor is McpGymRolloutProcessor, we execute runs sequentially since McpGym does not support concurrent runs
741737 # else, we execute runs in parallel
742738 if isinstance (rollout_processor , MCPGymRolloutProcessor ):
743- for task in tasks :
739+ # For MCPGymRolloutProcessor, create and execute tasks one at a time to avoid port conflicts
740+ for i in range (num_runs ):
741+ task = asyncio .create_task (execute_run (i , config ))
744742 await task
745743 else :
744+ # For other processors, create all tasks at once and run in parallel
745+ tasks = []
746+ for i in range (num_runs ):
747+ tasks .append (asyncio .create_task (execute_run (i , config )))
746748 await asyncio .gather (* tasks )
747749
748750 # for groupwise mode, the result contains eval otuput from multiple completion_params, we need to differentiate them
You can’t perform that action at this time.
0 commit comments