[Perf] Add skip_clone to SamplingParams for internal request handling (#31041)

Signed-off-by: mgoin <mgoin64@gmail.com>
This commit is contained in:
Michael Goin
2025-12-24 14:35:57 -08:00
committed by GitHub
parent 09dc7c690c
commit bc5ef333e0
5 changed files with 25 additions and 2 deletions
+4 -1
View File
@@ -642,7 +642,10 @@ class LLM:
# following the huggingface transformers implementation
# at https://github.com/huggingface/transformers/blob/e15687fffe5c9d20598a19aeab721ae0a7580f8a/src/transformers/generation/beam_search.py#L534 # noqa
beam_search_params = SamplingParams(
logprobs=2 * beam_width, max_tokens=1, temperature=temperature
logprobs=2 * beam_width,
max_tokens=1,
temperature=temperature,
skip_clone=True, # Internal beam search, safe to skip clone
)
instances: list[BeamSearchInstance] = []