[Benchmarks] Make detokenization optional in benchmark scripts (#11697)

Signed-off-by: Jeremy Arnold <Jeremy.Arnold@amd.com>
This commit is contained in:
Jeremy Arnold
2025-03-07 08:09:00 -08:00
committed by GitHub
parent f7ebad2307
commit 58abe35455
4 changed files with 45 additions and 7 deletions
+7
View File
@@ -52,6 +52,7 @@ def main(args: argparse.Namespace):
top_p=1.0,
ignore_eos=True,
max_tokens=args.output_len,
detokenize=not args.disable_detokenize,
)
print(sampling_params)
dummy_prompt_token_ids = np.random.randint(10000,
@@ -173,6 +174,12 @@ if __name__ == "__main__":
default=None,
help="Path to save the latency results in JSON format.",
)
parser.add_argument(
"--disable-detokenize",
action="store_true",
help=("Do not detokenize responses (i.e. do not include "
"detokenization time in the latency measurement)"),
)
parser = EngineArgs.add_cli_args(parser)
args = parser.parse_args()