Commit b5e195d
committed
[TRTLLM-6756][chore] Enhance TorchSampler with new setup_sampler_step method and fix bugs
- Introduced setup_sampler_step method to enable the setup process for disaggregated serving in beam search.
- Updated cache indirection initialization to use torch.zeros to prevent reading invalid values from cache_indirection
- Updated mtpSampler to correctly call TorchSampler functions
- Fixed handle_finish_reasons by wrapping finish reasons in the FinishReason class.
- Adjusted max_lengths_tensor calculation to account for original prompt length.
Signed-off-by: Stefan Niebler <[email protected]>1 parent 7cc7260 commit b5e195d
File tree
3 files changed
+49
-22
lines changed- tensorrt_llm/_torch
- pyexecutor
- speculative
- tests/unittest/_torch/speculative
3 files changed
+49
-22
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
639 | 639 | | |
640 | 640 | | |
641 | 641 | | |
642 | | - | |
| 642 | + | |
643 | 643 | | |
644 | 644 | | |
645 | 645 | | |
| |||
691 | 691 | | |
692 | 692 | | |
693 | 693 | | |
694 | | - | |
| 694 | + | |
| 695 | + | |
| 696 | + | |
695 | 697 | | |
696 | 698 | | |
697 | 699 | | |
| |||
718 | 720 | | |
719 | 721 | | |
720 | 722 | | |
721 | | - | |
| 723 | + | |
722 | 724 | | |
723 | 725 | | |
724 | 726 | | |
| |||
873 | 875 | | |
874 | 876 | | |
875 | 877 | | |
876 | | - | |
| 878 | + | |
| 879 | + | |
| 880 | + | |
| 881 | + | |
877 | 882 | | |
878 | 883 | | |
879 | 884 | | |
| |||
1069 | 1074 | | |
1070 | 1075 | | |
1071 | 1076 | | |
1072 | | - | |
| 1077 | + | |
| 1078 | + | |
| 1079 | + | |
| 1080 | + | |
1073 | 1081 | | |
1074 | 1082 | | |
1075 | 1083 | | |
| |||
1080 | 1088 | | |
1081 | 1089 | | |
1082 | 1090 | | |
| 1091 | + | |
| 1092 | + | |
| 1093 | + | |
| 1094 | + | |
| 1095 | + | |
| 1096 | + | |
| 1097 | + | |
| 1098 | + | |
| 1099 | + | |
1083 | 1100 | | |
1084 | 1101 | | |
1085 | 1102 | | |
| |||
1090 | 1107 | | |
1091 | 1108 | | |
1092 | 1109 | | |
1093 | | - | |
1094 | | - | |
1095 | | - | |
1096 | | - | |
| 1110 | + | |
| 1111 | + | |
| 1112 | + | |
1097 | 1113 | | |
1098 | | - | |
| 1114 | + | |
1099 | 1115 | | |
1100 | 1116 | | |
1101 | 1117 | | |
| |||
1559 | 1575 | | |
1560 | 1576 | | |
1561 | 1577 | | |
1562 | | - | |
| 1578 | + | |
1563 | 1579 | | |
1564 | 1580 | | |
1565 | 1581 | | |
| |||
1579 | 1595 | | |
1580 | 1596 | | |
1581 | 1597 | | |
1582 | | - | |
| 1598 | + | |
1583 | 1599 | | |
1584 | 1600 | | |
1585 | 1601 | | |
| |||
2206 | 2222 | | |
2207 | 2223 | | |
2208 | 2224 | | |
2209 | | - | |
| 2225 | + | |
| 2226 | + | |
| 2227 | + | |
| 2228 | + | |
2210 | 2229 | | |
2211 | 2230 | | |
2212 | 2231 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
236 | 236 | | |
237 | 237 | | |
238 | 238 | | |
239 | | - | |
| 239 | + | |
240 | 240 | | |
241 | 241 | | |
242 | | - | |
243 | | - | |
| 242 | + | |
| 243 | + | |
| 244 | + | |
244 | 245 | | |
245 | 246 | | |
246 | 247 | | |
| |||
271 | 272 | | |
272 | 273 | | |
273 | 274 | | |
274 | | - | |
| 275 | + | |
275 | 276 | | |
276 | 277 | | |
277 | | - | |
| 278 | + | |
| 279 | + | |
278 | 280 | | |
279 | 281 | | |
280 | 282 | | |
281 | 283 | | |
282 | 284 | | |
283 | 285 | | |
284 | 286 | | |
285 | | - | |
| 287 | + | |
| 288 | + | |
| 289 | + | |
| 290 | + | |
286 | 291 | | |
287 | | - | |
| 292 | + | |
| 293 | + | |
| 294 | + | |
| 295 | + | |
288 | 296 | | |
289 | 297 | | |
290 | 298 | | |
| |||
Lines changed: 2 additions & 2 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
47 | 47 | | |
48 | 48 | | |
49 | 49 | | |
50 | | - | |
51 | | - | |
| 50 | + | |
| 51 | + | |
52 | 52 | | |
53 | 53 | | |
54 | 54 | | |
| |||
0 commit comments