Skip to content

Commit 1b1f053

Browse files
arekaynvzhihanjFrankD412
authored andcommitted
[feat] Add progress bar to benchmark (NVIDIA#5173)
Signed-off-by: Rashid Kaleem <[email protected]> Co-authored-by: Zhihan Jiang <[email protected]> Co-authored-by: Frank <[email protected]>
1 parent 21a2e7c commit 1b1f053

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

tensorrt_llm/bench/benchmark/utils/asynchronous.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@
66
from itertools import chain
77
from typing import List, Optional, Set, Tuple
88

9+
import tqdm
910
from zmq import PUSH
1011
from zmq.asyncio import Context
1112

@@ -238,12 +239,14 @@ async def async_benchmark(
238239
post_proc_params, submit_finished))
239240

240241
logger.info("Starting benchmark...")
242+
pbar = tqdm.tqdm(total=len(requests), desc="Benchmarking")
241243
while not submit_finished.is_set() or backend.busy or not outbox.empty(
242244
):
243245
try:
244246
item: PerfItemTuple = await asyncio.wait_for(outbox.get(),
245247
timeout=1.0)
246248
statistics.register_request_perf_item(item)
249+
pbar.update(1)
247250
except asyncio.TimeoutError:
248251
logger.debug("No items in queue. Continuing.")
249252

0 commit comments

Comments
 (0)