Skip to content

Commit b0173d1

Browse files
committed
Fix most type errors for the IPC Queue
Signed-off-by: Jared O'Connell <[email protected]>
1 parent ff305a3 commit b0173d1

File tree

4 files changed

+15
-7
lines changed

4 files changed

+15
-7
lines changed

src/guidellm/scheduler/constraints.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1005,7 +1005,7 @@ def info(self) -> dict[str, Any]:
10051005
return self.model_dump()
10061006

10071007
def __call__(
1008-
self, state: SchedulerState, request: RequestInfo
1008+
self, state: SchedulerState, _request: RequestInfo
10091009
) -> SchedulerUpdateAction:
10101010
create_exceeded = state.created_requests >= self.num_requests
10111011
processed_exceeded = state.processed_requests >= self.num_requests

src/guidellm/scheduler/strategies.py

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -138,7 +138,9 @@ def init_processes_start(self, start_time: float):
138138
"init_processes_timings"
139139
)
140140
if self._processes_start_time is None:
141-
raise RuntimeError("_processes_lock is not None but _processes_start_time is None")
141+
raise RuntimeError(
142+
"_processes_lock is not None but _processes_start_time is None"
143+
)
142144

143145
with self._processes_lock:
144146
self._processes_start_time.value = start_time
@@ -156,7 +158,9 @@ async def get_processes_start_time(self) -> float:
156158
"init_processes_timings"
157159
)
158160
if self._processes_start_time is None:
159-
raise RuntimeError("_processes_lock is not None but _processes_start_time is None")
161+
raise RuntimeError(
162+
"_processes_lock is not None but _processes_start_time is None"
163+
)
160164

161165
while self._cached_processes_start_time is None:
162166
with self._processes_lock:
@@ -180,7 +184,9 @@ def next_request_index(self) -> int:
180184
"init_processes_timings"
181185
)
182186
if self._processes_request_index is None:
183-
raise RuntimeError("_processes_lock is not None but _processes_request_index is None")
187+
raise RuntimeError(
188+
"_processes_lock is not None but _processes_request_index is None"
189+
)
184190

185191
with self._processes_lock:
186192
self._processes_request_index.value += 1

src/guidellm/scheduler/worker.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -378,7 +378,9 @@ async def _process_next_request(self, target_start: float):
378378
# Process the request with the backend
379379
request_info.timings.resolve_start = time.time()
380380
self._send_update("in_progress", response, request, request_info)
381-
async for resp, info in await self.backend.resolve(request, request_info, None):
381+
async for resp, info in await self.backend.resolve(
382+
request, request_info, None
383+
):
382384
response = resp
383385
request_info = info
384386

src/guidellm/scheduler/worker_group.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -232,7 +232,7 @@ async def create_processes(self):
232232
worker_index=rank,
233233
max_buffer_send_size=None,
234234
max_buffer_receive_size=per_proc_max_buffer_size,
235-
),
235+
), # The non-group worker lacks the SchedulerState type. Type err.
236236
backend=self.backend,
237237
strategy=self.strategy,
238238
async_limit=async_limit,
@@ -533,7 +533,7 @@ def requests_generator(
533533
self._locked_update(
534534
info=None,
535535
add_constraints={
536-
"requests_exhausted": RequestsExhaustedConstraint(
536+
"requests_exhausted": RequestsExhaustedConstraint( # type: ignore[dict-item]
537537
num_requests=count
538538
)
539539
},

0 commit comments

Comments
 (0)