diff --git a/tensorrt_llm/bench/benchmark/utils/asynchronous.py b/tensorrt_llm/bench/benchmark/utils/asynchronous.py index 4151cbc361b..af6ae18ab5a 100644 --- a/tensorrt_llm/bench/benchmark/utils/asynchronous.py +++ b/tensorrt_llm/bench/benchmark/utils/asynchronous.py @@ -125,6 +125,10 @@ async def iteration_worker(self, iteration_addr: str) -> None: while not self._stop.is_set(): async for stats in self.llm.get_stats_async(2): await socket.send_json(stats) + # NOTE: This is a WAR to force this loop to relinquish control + # that was preventing other async tasks from holding the event + # loop. If we don't + await asyncio.sleep(0) # Wrap up by sending any remaining statistics data logger.debug("Iteration log worker wrapping up...")