diff --git a/slime/utils/http_utils.py b/slime/utils/http_utils.py index f5f119abae..7ce395c4db 100644 --- a/slime/utils/http_utils.py +++ b/slime/utils/http_utils.py @@ -221,8 +221,8 @@ def init_http_client(args): def _init_ray_distributed_post(args): """Initialize one or more Ray async actors per node for HTTP POST. - Uses NodeAffinitySchedulingStrategy to place actors on distinct nodes. - Controlled by SLIME_HTTP_POST_ACTORS_PER_NODE. + Uses NodeAffinitySchedulingStrategy to place actors on alive Ray nodes. + Creates ``args.num_gpus_per_node`` actors per node. """ global _post_actors if _post_actors: @@ -252,8 +252,8 @@ async def do_post(self, url, payload, max_retries=60, headers=None): # Create actors per node created = [] - # Distribute client concurrency across actors (at least 1 per actor) - per_actor_conc = (_client_concurrency + len(nodes)) // len(nodes) + total_actors = max(1, len(nodes) * args.num_gpus_per_node) + per_actor_conc = max(1, (_client_concurrency + total_actors - 1) // total_actors) for node in nodes: node_id = node["NodeID"]