forked from vllm-project/vllm
-
Notifications
You must be signed in to change notification settings - Fork 76
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
to make repetition penalty faster (#442)
This PR is to fix very slow sampling process when repetition penalty is set. The fix includes: 1. Enable pin_memory on HPU 2. Padding prompt tokens and output_tokens to avoid recompile 3. Replace slow ops Before the fix: SamplingParams(n=1, presence_penalty=0.0, frequency_penalty=0.0, repetition_penalty=1.06, temperature=1.0, top_p=1.0, top_k=-1, min_p=0.0, seed=None, stop=[], stop_token_ids=[], include_stop_str_in_output=False, ignore_eos=True, max_tokens=1024, min_tokens=0, logprobs=None, prompt_logprobs=None, skip_special_tokens=True, spaces_between_special_tokens=True, truncate_prompt_tokens=None), guided_decoding=None Warming up... Profiling iterations: 100%|5/5 [03:24<00:00, 40.99s/it] Avg latency: 40.98862759781768 seconds 10% percentile latency: 11.699748958216514 seconds 25% percentile latency: 11.73845003999304 seconds 50% percentile latency: 11.801458386995364 seconds 75% percentile latency: 11.861465670051984 seconds 90% percentile latency: 99.46527566103033 seconds 99% percentile latency: 152.02756165561732 seconds After the fix: SamplingParams(n=1, presence_penalty=0.0, frequency_penalty=0.0, repetition_penalty=1.06, temperature=1.0, top_p=1.0, top_k=-1, min_p=0.0, seed=None, stop=[], stop_token_ids=[], include_stop_str_in_output=False, ignore_eos=True, max_tokens=1024, min_tokens=0, logprobs=None, prompt_logprobs=None, skip_special_tokens=True, spaces_between_special_tokens=True, truncate_prompt_tokens=None), guided_decoding=None Warming up... Profiling iterations: 100%| 5/5 [00:57<00:00, 11.59s/it] Avg latency: 11.58703240059549 seconds 10% percentile latency: 11.444069900200702 seconds 25% percentile latency: 11.511425047006924 seconds 50% percentile latency: 11.525146245025098 seconds 75% percentile latency: 11.556680046953261 seconds 90% percentile latency: 11.788318535778672 seconds 99% percentile latency: 11.927301629073918 seconds Testing code is by: https://github.com/ccrhx4/huanxing.vllm-fork/blob/slow_repetition_penalty/benchmarks/reproduce.sh
- Loading branch information
Showing
3 changed files
with
121 additions
and
29 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters