Commit e2b0063
committed
feat(trtllm): separate request and response loop
The executor_status_looper spend CPU time polling at the number of
tokens. Because the function is protected by mutex inside, this also
interferes with the Executor.
Because now the TensorRtLlmBackendImpl is interior mutable, we can mark
it as `Send` and share it in multiple threads. Therefore, the loop can
be split into request and response parts, and we can await for tokens
instead of constantly polling.1 parent 161f62e commit e2b0063
File tree
5 files changed
+159
-148
lines changed- backends/trtllm
- csrc
- src
5 files changed
+159
-148
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
46 | 46 | | |
47 | 47 | | |
48 | 48 | | |
49 | | - | |
50 | | - | |
51 | | - | |
52 | | - | |
53 | 49 | | |
54 | 50 | | |
55 | 51 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
175 | 175 | | |
176 | 176 | | |
177 | 177 | | |
178 | | - | |
179 | | - | |
180 | | - | |
181 | | - | |
182 | | - | |
183 | | - | |
184 | | - | |
185 | 178 | | |
186 | 179 | | |
187 | 180 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
120 | 120 | | |
121 | 121 | | |
122 | 122 | | |
123 | | - | |
124 | | - | |
125 | 123 | | |
126 | 124 | | |
127 | 125 | | |
| |||
153 | 151 | | |
154 | 152 | | |
155 | 153 | | |
156 | | - | |
157 | | - | |
| 154 | + | |
158 | 155 | | |
159 | | - | |
| 156 | + | |
160 | 157 | | |
161 | | - | |
162 | | - | |
163 | | - | |
164 | | - | |
| 158 | + | |
| 159 | + | |
| 160 | + | |
| 161 | + | |
| 162 | + | |
165 | 163 | | |
166 | | - | |
| 164 | + | |
167 | 165 | | |
168 | | - | |
169 | | - | |
170 | | - | |
| 166 | + | |
| 167 | + | |
171 | 168 | | |
172 | | - | |
173 | | - | |
174 | | - | |
175 | | - | |
176 | | - | |
| 169 | + | |
177 | 170 | | |
178 | 171 | | |
179 | 172 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
80 | 80 | | |
81 | 81 | | |
82 | 82 | | |
83 | | - | |
84 | | - | |
85 | 83 | | |
86 | 84 | | |
87 | 85 | | |
| |||
0 commit comments