File tree Expand file tree Collapse file tree 1 file changed +4
-2
lines changed Expand file tree Collapse file tree 1 file changed +4
-2
lines changed Original file line number Diff line number Diff line change @@ -143,8 +143,8 @@ async def create_processes(self):
143
143
if num_processes <= 0 :
144
144
raise RuntimeError ("num_processes resolved to 0; increase limits/config" )
145
145
146
- per_proc_max_conc = math . ceil ( max_conc / num_processes )
147
- per_proc_max_queue = min ( 2 , per_proc_max_conc )
146
+ per_proc_max_conc = max_conc // num_processes
147
+ per_proc_max_queue = math . floor ( math . log ( per_proc_max_conc + math . e ) )
148
148
max_queued_requests = ( # Add queue buffer for each process
149
149
max_conc + (num_processes * per_proc_max_queue )
150
150
)
@@ -160,9 +160,11 @@ async def create_processes(self):
160
160
# Initialize worker processes
161
161
self .processes = []
162
162
for rank in range (num_processes ):
163
+ # Distribute any remainder across the first R ranks
163
164
async_limit = per_proc_max_conc + (
164
165
1 if rank < (max_conc % num_processes ) else 0
165
166
)
167
+
166
168
worker = WorkerProcess [RequestT , MeasuredRequestTimingsT , ResponseT ](
167
169
local_rank = rank ,
168
170
local_world_size = num_processes ,
You can’t perform that action at this time.
0 commit comments