Fix prefill latency performance drop of bench serving (#14592)
This commit is contained in:
@@ -1534,6 +1534,12 @@ def sample_random_requests(
|
|||||||
num=num_prompts,
|
num=num_prompts,
|
||||||
)
|
)
|
||||||
|
|
||||||
|
if return_text:
|
||||||
|
# Need to truncate input_len as server encode will add special token.
|
||||||
|
num_special_tokens = int(tokenizer.num_special_tokens_to_add())
|
||||||
|
for i in range(num_prompts):
|
||||||
|
input_lens[i] = max(0, input_lens[i] - num_special_tokens)
|
||||||
|
|
||||||
if random_sample:
|
if random_sample:
|
||||||
# Sample token ids from ShareGPT and repeat/truncate them to satisfy the input_lens
|
# Sample token ids from ShareGPT and repeat/truncate them to satisfy the input_lens
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user