Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 5 additions & 1 deletion lmdeploy/turbomind/turbomind.py
Original file line number Diff line number Diff line change
Expand Up @@ -173,6 +173,7 @@ def __init__(self,
self._create_engine()

self.session_len = _engine_config.session_len
self.health_executor = ThreadPoolExecutor(max_workers=1)
Comment on lines 175 to +176

def _process_weights(self):
"""Process weight."""
Expand Down Expand Up @@ -419,7 +420,10 @@ def _get_health_status(self) -> dict:

async def get_health_status(self) -> dict:
"""Get backend health status without blocking the event loop."""
return await asyncio.to_thread(self._get_health_status)
# MultimodalProcessor may submit a large number of tasks to the default thread pool, causing
# the _get_health_status task to be selected after the DEFAULT_PROBE_TIMEOUT has already elapsed.
loop = asyncio.get_running_loop()
return await loop.run_in_executor(self.health_executor, self._get_health_status)
Comment on lines +423 to +426
Comment on lines +425 to +426


def _get_logits(outputs, offset: int):
Expand Down
Loading