File tree Expand file tree Collapse file tree 4 files changed +10
-1
lines changed
Expand file tree Collapse file tree 4 files changed +10
-1
lines changed Original file line number Diff line number Diff line change @@ -91,7 +91,7 @@ def __init__(
9191 is_reward_model : bool = False ,
9292 ) -> None :
9393 self .replica_rank = replica_rank
94- self .config = omega_conf_to_dataclass (config )
94+ self .config : RolloutConfig = omega_conf_to_dataclass (config )
9595 self .model_config : HFModelConfig = model_config
9696
9797 self .world_size = (
@@ -220,6 +220,12 @@ def server_handle(self) -> ActorHandle:
220220 """Get rollout server handle for Token-in-token-out generation."""
221221 return self ._server_handle
222222
223+ @property
224+ def max_concurrency (self ) -> int :
225+ # 1000 is Ray's default max_concurrency for async execution.
226+ # Add some margin to account for control call.
227+ return max (1000 , self .config .max_num_seqs + 4 )
228+
223229 def rollout_worker_use_gpu (self ) -> bool :
224230 return True
225231
Original file line number Diff line number Diff line change @@ -505,6 +505,7 @@ async def launch_servers(self):
505505 ),
506506 runtime_env = {"env_vars" : {f"RAY_EXPERIMENTAL_NOSET_{ visible_devices_keyword } " : "1" }},
507507 name = name ,
508+ max_concurrency = self .max_concurrency ,
508509 ).remote (
509510 config = self .config ,
510511 model_config = self .model_config ,
Original file line number Diff line number Diff line change @@ -353,6 +353,7 @@ async def launch_servers(self):
353353 ),
354354 runtime_env = {"env_vars" : {"RAY_EXPERIMENTAL_NOSET_CUDA_VISIBLE_DEVICES" : "1" }},
355355 name = name ,
356+ max_concurrency = self .max_concurrency ,
356357 ).remote (
357358 config = self .config ,
358359 model_config = self .model_config ,
Original file line number Diff line number Diff line change @@ -840,6 +840,7 @@ async def launch_servers(self):
840840 ),
841841 runtime_env = {"env_vars" : {"RAY_EXPERIMENTAL_NOSET_CUDA_VISIBLE_DEVICES" : "1" }},
842842 name = name ,
843+ max_concurrency = self .max_concurrency ,
843844 ).remote (
844845 config = self .config ,
845846 model_config = self .model_config ,
You can’t perform that action at this time.
0 commit comments