[V1][Minor] Optimize token_ids_cpu copy (#11692)

Signed-off-by: Woosuk Kwon <woosuk.kwon@berkeley.edu>
This commit is contained in:
Woosuk Kwon
2025-01-02 12:04:58 -07:00
committed by GitHub
parent 2f385183f3
commit b55ed6ef8a
2 changed files with 9 additions and 5 deletions
+1
View File
@@ -644,6 +644,7 @@ class GPUModelRunner:
# Append the sampled token to the output token ids.
token_id = sampled_token_ids[i]
self.input_batch.token_ids_cpu[i, seq_len] = token_id
self.input_batch.num_tokens[i] += 1
req_state.output_token_ids.append(token_id)
else:
# Ignore the sampled token from the partial request.