@tduncan / Nvidia-Optimization-Stack-VLLM Mirror · read-only / commits / 18cc33dd60
Fork 0

A high-throughput and memory-efficient inference and serving engine for LLMs

Mirrored from https://github.com/tduncan-lum/Nvidia-Optimization-Stack---VLLM.git

Synced Nov 14, 23:45 UTC

[bugfix] fix profile impact benchmark results (#21507)

Signed-off-by: rongfu.leng <rongfu.leng@daocloud.io>

rongfu.leng committed Jul 28, 2025 at 13:44 UTC 18cc33dd603cce058867f5730919041fa3617eb7
3 files changed +41 -42
benchmarks/benchmark_serving.py
+14 -14
@@ -396,20 +396,6 @@ async def benchmark(
396 tasks.append(asyncio.create_task(task))
397 outputs: list[RequestFuncOutput] = await asyncio.gather(*tasks)
398
399 - if profile:
400 - print("Stopping profiler...")
401 - profile_input = RequestFuncInput(
402 - model=model_id,
403 - prompt=test_prompt,
404 - api_url=base_url + "/stop_profile",
405 - prompt_len=test_prompt_len,
406 - output_len=test_output_len,
407 - logprobs=logprobs,
408 - )
409 - profile_output = await request_func(request_func_input=profile_input)
410 - if profile_output.success:
411 - print("Profiler stopped")
412 -
399 if pbar is not None:
400 pbar.close()
401
@@ -518,6 +504,20 @@ async def benchmark(
504
505 print("=" * 50)
506
507 + if profile:
508 + print("Stopping profiler...")
509 + profile_input = RequestFuncInput(
510 + model=model_id,
511 + prompt=test_prompt,
512 + api_url=base_url + "/stop_profile",
513 + prompt_len=test_prompt_len,
514 + output_len=test_output_len,
515 + logprobs=logprobs,
516 + )
517 + profile_output = await request_func(request_func_input=profile_input)
518 + if profile_output.success:
519 + print("Profiler stopped")
520 +
521 return result
522
523
benchmarks/benchmark_serving_structured_output.py
+14 -14
@@ -538,20 +538,6 @@ async def benchmark(
538 )
539 outputs: list[RequestFuncOutput] = await asyncio.gather(*tasks)
540
541 - if profile:
542 - print("Stopping profiler...")
543 - profile_input = RequestFuncInput(
544 - model=model_id,
545 - prompt=test_request.prompt,
546 - api_url=base_url + "/stop_profile",
547 - prompt_len=test_request.prompt_len,
548 - output_len=test_request.expected_output_len,
549 - extra_body={test_request.structure_type: test_request.schema},
550 - )
551 - profile_output = await request_func(request_func_input=profile_input)
552 - if profile_output.success:
553 - print("Profiler stopped")
554 -
541 if pbar is not None:
542 pbar.close()
543
@@ -666,6 +652,20 @@ async def benchmark(
652
653 print("=" * 50)
654
655 + if profile:
656 + print("Stopping profiler...")
657 + profile_input = RequestFuncInput(
658 + model=model_id,
659 + prompt=test_request.prompt,
660 + api_url=base_url + "/stop_profile",
661 + prompt_len=test_request.prompt_len,
662 + output_len=test_request.expected_output_len,
663 + extra_body={test_request.structure_type: test_request.schema},
664 + )
665 + profile_output = await request_func(request_func_input=profile_input)
666 + if profile_output.success:
667 + print("Profiler stopped")
668 +
669 return result, ret
670
671
vllm/benchmarks/serve.py
+13 -14
@@ -470,20 +470,6 @@ async def benchmark(
470 pbar=pbar)))
471 outputs: list[RequestFuncOutput] = await asyncio.gather(*tasks)
472
473 - if profile:
474 - print("Stopping profiler...")
475 - profile_input = RequestFuncInput(
476 - model=model_id,
477 - prompt=test_prompt,
478 - api_url=base_url + "/stop_profile",
479 - prompt_len=test_prompt_len,
480 - output_len=test_output_len,
481 - logprobs=logprobs,
482 - )
483 - profile_output = await request_func(request_func_input=profile_input)
484 - if profile_output.success:
485 - print("Profiler stopped")
486 -
473 if pbar is not None:
474 pbar.close()
475
@@ -576,6 +562,19 @@ async def benchmark(
562
563 print("=" * 50)
564
565 + if profile:
566 + print("Stopping profiler...")
567 + profile_input = RequestFuncInput(
568 + model=model_id,
569 + prompt=test_prompt,
570 + api_url=base_url + "/stop_profile",
571 + prompt_len=test_prompt_len,
572 + output_len=test_output_len,
573 + logprobs=logprobs,
574 + )
575 + profile_output = await request_func(request_func_input=profile_input)
576 + if profile_output.success:
577 + print("Profiler stopped")
578 return result
579
580