Skip to content

Commit a8640c6

Browse files
committed
WAR to unblock trtllm-serve w/ logprob in PyT backend
Signed-off-by: Erin Ho <[email protected]>
1 parent 7381f1d commit a8640c6

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

tensorrt_llm/executor/result.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -228,6 +228,9 @@ def _handle_sequence(self,
228228
output.logprobs = response_tensors.log_probs[src_idx]
229229
# overcome some WAR in the cpp executor
230230
if finish_reasons[src_idx] != tllm.FinishReason.CANCELLED:
231+
if len(output.logprobs) > output.length:
232+
# WAR [nvbug 5398806]
233+
output.logprobs = output.logprobs[:output.length]
231234
assert len(output.logprobs) == output.length
232235
if response_tensors.generation_logits is not None:
233236
output.generation_logits = response_tensors.generation_logits[

0 commit comments

Comments
 (0)