[Model Runner V2] Support custom logits processors (#56497)

Signed-off-by: David Cheung <d7cheung@gmail.com>
Signed-off-by: Nick Hill <nickhill123@gmail.com>
Co-authored-by: Claude <noreply@anthropic.com>
Co-authored-by: Nick Hill <nickhill123@gmail.com>
This commit is contained in:
David Cheung
2026-09-19 17:46:49 +00:00
committed by GitHub
co-authored by Claude Nick Hill
parent 751f6807d9
commit 5302d1fe40
32 changed files with 1215 additions and 510 deletions
+4
View File
@@ -200,6 +200,9 @@ class BatchSharder:
num_logits_per_req_np[local_req_indices_np], out=local_cu_num_logits_np[1:]
)
max_num_logits_per_req = int(num_logits_per_req_np.max()) if num_reqs else 1
local_seq_lens_cpu_upper_bound = input_batch.seq_lens_cpu_upper_bound[
torch.from_numpy(local_req_indices_np)
]
# Shard the input batch GPU tensors.
sorted_logits_indices = torch.empty(
@@ -269,6 +272,7 @@ class BatchSharder:
expanded_idx_mapping=local_expanded_idx_mapping,
expanded_local_pos=local_expanded_local_pos,
seq_lens=local_seq_lens,
seq_lens_cpu_upper_bound=local_seq_lens_cpu_upper_bound,
logits_indices=local_logits_indices,
cu_num_logits=local_cu_num_logits,
cu_num_logits_np=local_cu_num_logits_np,