Commit 18531f1
committed
[TRTLLM-9688][feat] Refactor processed logprobs to skip logprob calculation when not needed
- Added LogProbsMode class to define modes for log probabilities: RAW and PROCESSED.
- Updated SamplingParams and LlmRequest to utilize LogProbsMode for logprobs_mode parameter.
- Enhanced validation to check logprobs_mode against LogProbsMode values.
- Modified TorchSampler and related classes to support new logprobs_mode functionality.
- Modified TorchSampler to only calculate logprobs when a request needs it
- Updated tests to cover new logprobs_mode behavior and ensure correct processing of log probabilities.
Signed-off-by: Stefan Niebler <[email protected]>1 parent 160f461 commit 18531f1
File tree
7 files changed
+265
-81
lines changed- tensorrt_llm
- _torch/pyexecutor
- tests/unittest/_torch/sampler
7 files changed
+265
-81
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
8 | 8 | | |
9 | 9 | | |
10 | 10 | | |
| 11 | + | |
11 | 12 | | |
12 | 13 | | |
13 | 14 | | |
| |||
460 | 461 | | |
461 | 462 | | |
462 | 463 | | |
463 | | - | |
| 464 | + | |
464 | 465 | | |
465 | 466 | | |
466 | 467 | | |
| |||
539 | 540 | | |
540 | 541 | | |
541 | 542 | | |
542 | | - | |
| 543 | + | |
543 | 544 | | |
544 | 545 | | |
545 | 546 | | |
| |||
568 | 569 | | |
569 | 570 | | |
570 | 571 | | |
| 572 | + | |
| 573 | + | |
| 574 | + | |
| 575 | + | |
| 576 | + | |
| 577 | + | |
| 578 | + | |
| 579 | + | |
| 580 | + | |
571 | 581 | | |
572 | 582 | | |
573 | 583 | | |
| |||
801 | 811 | | |
802 | 812 | | |
803 | 813 | | |
804 | | - | |
| 814 | + | |
805 | 815 | | |
806 | 816 | | |
807 | 817 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1718 | 1718 | | |
1719 | 1719 | | |
1720 | 1720 | | |
| 1721 | + | |
| 1722 | + | |
1721 | 1723 | | |
1722 | 1724 | | |
1723 | 1725 | | |
| |||
0 commit comments