Skip to content

Commit b5839a1

Browse files
maleksan85maleksan85
and
maleksan85
authored
Skip tokenize/detokenize when it is disabled by arg --skip-tokenizer-init (#367)
* switching detokenize flag to be False * detokenize = False for benchmarks * restoring default in main vllm code for detokenize * removing extra spaces * moving detokenize to flag * adding support for token ids --------- Co-authored-by: maleksan85 <maleksan@amd.com>
1 parent 78d7d30 commit b5839a1

File tree

2 files changed

+3
-2
lines changed

2 files changed

+3
-2
lines changed

benchmarks/profiling/benchmark_throughput.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -272,7 +272,8 @@ def main(args: argparse.Namespace):
272272
args.tokenizer, trust_remote_code=args.trust_remote_code)
273273
if args.dataset is None:
274274
# Synthesize a prompt with the given input length.
275-
prompt = "hi" * (args.input_len - 1)
275+
prompt = { "prompt_token_ids" : [42] * (args.input_len - 1) } \
276+
if args.skip_tokenizer_init else "hi" * (args.input_len - 1)
276277
requests = [(prompt, args.input_len, args.output_len)
277278
for _ in range(args.num_prompts)]
278279
else:

vllm/engine/output_processor/multi_step.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -144,7 +144,7 @@ def process_outputs(self,
144144
def _process_decode_and_stop(self, seq: Sequence,
145145
sampling_params: SamplingParams) -> None:
146146
new_char_count = 0
147-
if sampling_params.detokenize:
147+
if sampling_params.detokenize and self.detokenizer:
148148
new_char_count = self.detokenizer.decode_sequence_inplace(
149149
seq, sampling_params)
150150

0 commit comments

Comments
 (0)