Skip to content

Commit 68687a9

Browse files
authored
[WAR][nvbug/5321947] Add an async sleep to unblock event loop. (NVIDIA#5342)
Signed-off-by: Frank Di Natale <[email protected]>
1 parent bca758f commit 68687a9

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

tensorrt_llm/bench/benchmark/utils/asynchronous.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -125,6 +125,10 @@ async def iteration_worker(self, iteration_addr: str) -> None:
125125
while not self._stop.is_set():
126126
async for stats in self.llm.get_stats_async(2):
127127
await socket.send_json(stats)
128+
# NOTE: This is a WAR to force this loop to relinquish control
129+
# that was preventing other async tasks from holding the event
130+
# loop. If we don't
131+
await asyncio.sleep(0)
128132

129133
# Wrap up by sending any remaining statistics data
130134
logger.debug("Iteration log worker wrapping up...")

0 commit comments

Comments
 (0)