Commit 4817c71
Paged attention/ new fms API (#82)
* [Continuous batching] FMS model wrapper (#18)
* fms wrapper dummy for continuous batching implementation, gating via env var VLLM_SPYRE_USE_CB
Signed-off-by: Yannick Schnider <[email protected]>
* implementing fms wrapper with correct KV cache managment
Signed-off-by: Yannick Schnider <[email protected]>
* disable prints by default
Signed-off-by: Yannick Schnider <[email protected]>
* code refactoring fms wrapper
Signed-off-by: Yannick Schnider <[email protected]>
* fix default path not using CB/ fms wrapper
Signed-off-by: Yannick Schnider <[email protected]>
* correct print when TESTING_CB
Signed-off-by: Yannick Schnider <[email protected]>
* remove self.past_key_value_states when KV cache is managed by FMS wrapper
Signed-off-by: Yannick Schnider <[email protected]>
* read-out only active pages of KV cache (covers when curr batch size < max batch size)
Signed-off-by: Yannick Schnider <[email protected]>
* uniquely distinguishing prefills and decodes
Signed-off-by: Yannick Schnider <[email protected]>
* reading kv cache dimension from model config
Signed-off-by: Yannick Schnider <[email protected]>
* cosmetics and comments
Signed-off-by: Yannick Schnider <[email protected]>
* support for gpt big code models
Signed-off-by: Yannick Schnider <[email protected]>
* bugfix hard coded test mask
Signed-off-by: Yannick Schnider <[email protected]>
* change KV cache type for prefill
Signed-off-by: Yannick Schnider <[email protected]>
* update tkv in fms wrapper
Signed-off-by: Yannick Schnider <[email protected]>
* moving fms wrapper to own class
Signed-off-by: Yannick Schnider <[email protected]>
* reset tkv for new prompt
Signed-off-by: Yannick Schnider <[email protected]>
* ignoring test_spyre_tensor_parallel.py, since FMS wrapper does not support it
Signed-off-by: Yannick Schnider <[email protected]>
* removing VLLM_SPYRE_USE_CB, since FMS wrapper is now used by default
Signed-off-by: Yannick Schnider <[email protected]>
* typing fms wrapper class
Signed-off-by: Yannick Schnider <[email protected]>
---------
Signed-off-by: Yannick Schnider <[email protected]>
* moving model loading into FMS wrapper (#35)
Signed-off-by: Yannick Schnider <[email protected]>
* bugfix idx kv cache update (#40)
Signed-off-by: Yannick Schnider <[email protected]>
* FMS Wrapper for static batching (#39)
* introducing pseudo fms wrapper for static batching
Signed-off-by: Yannick Schnider <[email protected]>
* small bug fix
Signed-off-by: Yannick Schnider <[email protected]>
* bugfix idx kv cache update
Signed-off-by: Yannick Schnider <[email protected]>
---------
Signed-off-by: Yannick Schnider <[email protected]>
Signed-off-by: Yannick Schnider <[email protected]>
* [Continuous Batching] Introducing new env variables (#67)
* introducing env variables for AIU Spyre KV cache dimensions
Signed-off-by: Yannick Schnider <[email protected]>
* removing prints
Signed-off-by: Yannick Schnider <[email protected]>
---------
Signed-off-by: Yannick Schnider <[email protected]>
* [Continuous batching] Initial cb test (#52)
* initial cb test
Signed-off-by: Nikolaos Papandreou <[email protected]>
* make tkv, active_pages optional in SpyreCausalLM class for the V0 tests
Signed-off-by: Nikolaos Papandreou <[email protected]>
* format
Signed-off-by: Nikolaos Papandreou <[email protected]>
* remove manual testing and fix formatting
Signed-off-by: Yannick Schnider <[email protected]>
* remove tkv2fms
Signed-off-by: Yannick Schnider <[email protected]>
* remove unnecessary class variables
Signed-off-by: Yannick Schnider <[email protected]>
* tidy up class variables
Signed-off-by: Yannick Schnider <[email protected]>
* simplify code: req_ids2idx and active_pages will be reset in prepare input anyway...
Signed-off-by: Yannick Schnider <[email protected]>
* renaming variable
Signed-off-by: Yannick Schnider <[email protected]>
* removing batch padding in prefil stage
Signed-off-by: Yannick Schnider <[email protected]>
* indices always list of Trues since no padding or removed sequences...
Signed-off-by: Yannick Schnider <[email protected]>
* fix active/free page handling
Signed-off-by: Yannick Schnider <[email protected]>
* avoiding unnecessary tensor construction
Signed-off-by: Yannick Schnider <[email protected]>
* fix sorting indifference token/position_ids vs masks
Signed-off-by: Yannick Schnider <[email protected]>
* refactoring not requiring req_ids2idx
Signed-off-by: Yannick Schnider <[email protected]>
* removing unsused class variables, simplifying code
Signed-off-by: Yannick Schnider <[email protected]>
* use VLLM_SPYRE_MAX_BATCH_SIZE to control (decoding) batch size on AIU Spyre
Signed-off-by: Yannick Schnider <[email protected]>
* removing unnecessary helper functions for schedule and add_request
Signed-off-by: Yannick Schnider <[email protected]>
* removing unused argument
Signed-off-by: Yannick Schnider <[email protected]>
---------
Signed-off-by: Nikolaos Papandreou <[email protected]>
Signed-off-by: Yannick Schnider <[email protected]>
Co-authored-by: Yannick Schnider <[email protected]>
* re-enabling TP tests
Signed-off-by: Yannick Schnider <[email protected]>
* addressing feedback: renaming and removing unused stuff
Signed-off-by: Yannick Schnider <[email protected]>
* removing unnecessary getter function and other feedback
Signed-off-by: Yannick Schnider <[email protected]>
* integrating new FMS API on branch 'paged_attn_mock'
Signed-off-by: Yannick Schnider <[email protected]>
* torch dynamo: mark dynamic/static shapes
Signed-off-by: Yannick Schnider <[email protected]>
* bugfix key_value_states name
Signed-off-by: Nikolaos Papandreou <[email protected]>
* making block_table and slot_mapping args, not class vars
Signed-off-by: Yannick Schnider <[email protected]>
* formatting after browser merge...
Signed-off-by: Yannick Schnider <[email protected]>
* nicer handling of arguments continuous vs static batching
Signed-off-by: Yannick Schnider <[email protected]>
* Implement warmup for continuous batching (#83)
* Implement warmup for continuous batching
Signed-off-by: Thomas Parnell <[email protected]>
* fmt
Signed-off-by: Thomas Parnell <[email protected]>
* freeing block directly and small things
Signed-off-by: Yannick Schnider <[email protected]>
---------
Signed-off-by: Thomas Parnell <[email protected]>
Signed-off-by: Yannick Schnider <[email protected]>
Co-authored-by: Yannick Schnider <[email protected]>
* initialize tkv
Signed-off-by: Nikolaos Papandreou <[email protected]>
* Return empty ModelRunnerOuptut if no work
Signed-off-by: Nikolaos Papandreou <[email protected]>
* update mask for decode
Signed-off-by: Nikolaos Papandreou <[email protected]>
* Fix copy/paste error
Signed-off-by: Thomas Parnell <[email protected]>
* adaptive loging (thx joerunde)
Co-authored-by: Joe Runde <[email protected]>
Signed-off-by: Yannick Schnider <[email protected]>
* remove warmup shapes for continuous batching
Signed-off-by: Yannick Schnider <[email protected]>
* assuring prefil lengths are multiples of block size 64 in example script
Signed-off-by: Yannick Schnider <[email protected]>
* revert change to warmup shape
Signed-off-by: Thomas Parnell <[email protected]>
* 🎨 fmt
Signed-off-by: Joe Runde <[email protected]>
* Added call to update_lazyhandle
Signed-off-by: Thomas Parnell <[email protected]>
* Right padding of prompts (#95)
* right padding initial implementation
Signed-off-by: Yannick Schnider <[email protected]>
* fix right padding: remove the right padded logits before sampling
Signed-off-by: Yannick Schnider <[email protected]>
* fix typing
Signed-off-by: Yannick Schnider <[email protected]>
---------
Signed-off-by: Yannick Schnider <[email protected]>
* [CB] Fix Tensor Parallelism Error (#103)
* divide tensor third dimension by number of TP
Signed-off-by: Sophie du Couédic <[email protected]>
* Use existing method from vllm to get 'num_kv_heads' (works also for TP>1)
Signed-off-by: Sophie du Couédic <[email protected]>
---------
Signed-off-by: Sophie du Couédic <[email protected]>
* support granite-3.2-8b-instruct (#106)
Signed-off-by: Yannick Schnider <[email protected]>
Signed-off-by: Yannick Schnider <[email protected]>
* comments
Signed-off-by: Yannick Schnider <[email protected]>
* adapt to change of arguments in fms
Signed-off-by: Yannick Schnider <[email protected]>
* fix mypy issue
Signed-off-by: Yannick Schnider <[email protected]>
* revising continuous batching scheduler
Signed-off-by: Yannick Schnider <[email protected]>
* [V1] Decoupling static and continuous batching (#116)
* decoupling static and continuous batching scheduler
Signed-off-by: Yannick Schnider <[email protected]>
* fix dynamo cache for continuous batching
Signed-off-by: Yannick Schnider <[email protected]>
* removing warmup shape dependency for continuous batching!
Signed-off-by: Yannick Schnider <[email protected]>
---------
Signed-off-by: Yannick Schnider <[email protected]>
* addressing review cosmetics
Signed-off-by: Yannick Schnider <[email protected]>
* fix/refactor: remove last_running and total_running (#112)
Signed-off-by: Travis Johnson <[email protected]>
Signed-off-by: Yannick Schnider <[email protected]>
Co-authored-by: Yannick Schnider <[email protected]>
* fix comment kv cache tensor initialization
Signed-off-by: Yannick Schnider <[email protected]>
---------
Signed-off-by: Yannick Schnider <[email protected]>
Signed-off-by: Yannick Schnider <[email protected]>
Signed-off-by: Nikolaos Papandreou <[email protected]>
Signed-off-by: Thomas Parnell <[email protected]>
Signed-off-by: Joe Runde <[email protected]>
Signed-off-by: Sophie du Couédic <[email protected]>
Signed-off-by: Travis Johnson <[email protected]>
Co-authored-by: Nikolaos Papandreou <[email protected]>
Co-authored-by: Thomas Parnell <[email protected]>
Co-authored-by: Joe Runde <[email protected]>
Co-authored-by: Sophie du Couédic <[email protected]>
Co-authored-by: Travis Johnson <[email protected]>1 parent b440505 commit 4817c71
File tree
6 files changed
+572
-269
lines changed- examples
- vllm_spyre
- model_executor/model_loader
- v1
- core
- worker
6 files changed
+572
-269
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
3 | 3 | | |
4 | 4 | | |
5 | 5 | | |
6 | | - | |
7 | | - | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
8 | 11 | | |
9 | | - | |
10 | 12 | | |
11 | 13 | | |
12 | | - | |
13 | | - | |
14 | | - | |
15 | 14 | | |
16 | 15 | | |
17 | 16 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | 1 | | |
2 | 2 | | |
3 | | - | |
| 3 | + | |
4 | 4 | | |
5 | 5 | | |
6 | 6 | | |
| |||
54 | 54 | | |
55 | 55 | | |
56 | 56 | | |
| 57 | + | |
| 58 | + | |
| 59 | + | |
57 | 60 | | |
58 | | - | |
59 | | - | |
60 | | - | |
61 | | - | |
62 | | - | |
63 | | - | |
64 | | - | |
65 | | - | |
| 61 | + | |
| 62 | + | |
| 63 | + | |
| 64 | + | |
| 65 | + | |
| 66 | + | |
| 67 | + | |
| 68 | + | |
| 69 | + | |
| 70 | + | |
66 | 71 | | |
67 | 72 | | |
68 | 73 | | |
69 | 74 | | |
70 | 75 | | |
71 | 76 | | |
72 | 77 | | |
73 | | - | |
74 | | - | |
| 78 | + | |
| 79 | + | |
| 80 | + | |
| 81 | + | |
75 | 82 | | |
76 | 83 | | |
77 | 84 | | |
78 | | - | |
| 85 | + | |
79 | 86 | | |
80 | | - | |
| 87 | + | |
81 | 88 | | |
82 | 89 | | |
83 | 90 | | |
84 | 91 | | |
85 | 92 | | |
86 | | - | |
| 93 | + | |
| 94 | + | |
| 95 | + | |
| 96 | + | |
| 97 | + | |
| 98 | + | |
| 99 | + | |
87 | 100 | | |
88 | 101 | | |
89 | 102 | | |
90 | 103 | | |
91 | 104 | | |
92 | | - | |
93 | | - | |
94 | | - | |
| 105 | + | |
95 | 106 | | |
96 | 107 | | |
97 | 108 | | |
98 | | - | |
99 | | - | |
| 109 | + | |
| 110 | + | |
| 111 | + | |
| 112 | + | |
| 113 | + | |
| 114 | + | |
| 115 | + | |
| 116 | + | |
| 117 | + | |
| 118 | + | |
100 | 119 | | |
101 | 120 | | |
102 | 121 | | |
| |||
151 | 170 | | |
152 | 171 | | |
153 | 172 | | |
154 | | - | |
155 | | - | |
156 | | - | |
157 | | - | |
158 | | - | |
159 | 173 | | |
160 | 174 | | |
161 | 175 | | |
| |||
173 | 187 | | |
174 | 188 | | |
175 | 189 | | |
176 | | - | |
| 190 | + | |
177 | 191 | | |
178 | 192 | | |
179 | 193 | | |
180 | | - | |
181 | 194 | | |
182 | 195 | | |
| 196 | + | |
| 197 | + | |
| 198 | + | |
| 199 | + | |
| 200 | + | |
183 | 201 | | |
184 | 202 | | |
185 | 203 | | |
| |||
197 | 215 | | |
198 | 216 | | |
199 | 217 | | |
200 | | - | |
| 218 | + | |
201 | 219 | | |
202 | 220 | | |
203 | 221 | | |
| |||
245 | 263 | | |
246 | 264 | | |
247 | 265 | | |
248 | | - | |
249 | | - | |
250 | | - | |
251 | | - | |
252 | | - | |
253 | | - | |
254 | | - | |
255 | | - | |
256 | | - | |
| 266 | + | |
| 267 | + | |
257 | 268 | | |
258 | | - | |
| 269 | + | |
259 | 270 | | |
260 | 271 | | |
261 | 272 | | |
262 | | - | |
| 273 | + | |
| 274 | + | |
| 275 | + | |
| 276 | + | |
| 277 | + | |
| 278 | + | |
| 279 | + | |
| 280 | + | |
| 281 | + | |
| 282 | + | |
| 283 | + | |
| 284 | + | |
263 | 285 | | |
264 | | - | |
265 | 286 | | |
266 | 287 | | |
267 | 288 | | |
268 | 289 | | |
269 | | - | |
270 | 290 | | |
271 | 291 | | |
272 | | - | |
273 | | - | |
274 | | - | |
275 | | - | |
276 | | - | |
277 | | - | |
278 | | - | |
279 | | - | |
280 | | - | |
| 292 | + | |
| 293 | + | |
| 294 | + | |
| 295 | + | |
| 296 | + | |
| 297 | + | |
| 298 | + | |
| 299 | + | |
| 300 | + | |
| 301 | + | |
| 302 | + | |
| 303 | + | |
| 304 | + | |
| 305 | + | |
| 306 | + | |
| 307 | + | |
| 308 | + | |
| 309 | + | |
| 310 | + | |
281 | 311 | | |
282 | 312 | | |
283 | 313 | | |
| |||
286 | 316 | | |
287 | 317 | | |
288 | 318 | | |
289 | | - | |
290 | | - | |
| 319 | + | |
| 320 | + | |
| 321 | + | |
| 322 | + | |
291 | 323 | | |
292 | 324 | | |
293 | 325 | | |
294 | | - | |
295 | | - | |
296 | | - | |
297 | | - | |
298 | | - | |
299 | | - | |
300 | | - | |
301 | | - | |
302 | | - | |
303 | | - | |
304 | | - | |
305 | | - | |
306 | | - | |
307 | | - | |
308 | | - | |
309 | | - | |
| 326 | + | |
| 327 | + | |
| 328 | + | |
| 329 | + | |
| 330 | + | |
| 331 | + | |
| 332 | + | |
310 | 333 | | |
311 | 334 | | |
312 | 335 | | |
313 | 336 | | |
314 | 337 | | |
315 | | - | |
| 338 | + | |
316 | 339 | | |
317 | 340 | | |
| 341 | + | |
| 342 | + | |
| 343 | + | |
| 344 | + | |
318 | 345 | | |
319 | 346 | | |
320 | | - | |
321 | | - | |
322 | | - | |
323 | | - | |
324 | | - | |
325 | | - | |
326 | | - | |
327 | | - | |
328 | | - | |
329 | | - | |
330 | | - | |
331 | | - | |
332 | | - | |
| 347 | + | |
| 348 | + | |
333 | 349 | | |
334 | 350 | | |
335 | 351 | | |
| |||
356 | 372 | | |
357 | 373 | | |
358 | 374 | | |
359 | | - | |
360 | | - | |
361 | 375 | | |
362 | 376 | | |
363 | 377 | | |
| |||
371 | 385 | | |
372 | 386 | | |
373 | 387 | | |
374 | | - | |
375 | | - | |
| 388 | + | |
376 | 389 | | |
377 | 390 | | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
50 | 50 | | |
51 | 51 | | |
52 | 52 | | |
| 53 | + | |
| 54 | + | |
| 55 | + | |
| 56 | + | |
| 57 | + | |
53 | 58 | | |
54 | 59 | | |
55 | 60 | | |
| |||
69 | 74 | | |
70 | 75 | | |
71 | 76 | | |
72 | | - | |
| 77 | + | |
73 | 78 | | |
74 | 79 | | |
75 | 80 | | |
76 | 81 | | |
77 | | - | |
78 | | - | |
79 | | - | |
80 | | - | |
81 | | - | |
82 | | - | |
83 | | - | |
84 | | - | |
85 | | - | |
86 | | - | |
| 82 | + | |
| 83 | + | |
| 84 | + | |
| 85 | + | |
| 86 | + | |
| 87 | + | |
| 88 | + | |
| 89 | + | |
| 90 | + | |
| 91 | + | |
| 92 | + | |
87 | 93 | | |
88 | 94 | | |
89 | 95 | | |
| |||
98 | 104 | | |
99 | 105 | | |
100 | 106 | | |
101 | | - | |
102 | | - | |
103 | | - | |
104 | | - | |
105 | | - | |
106 | 107 | | |
107 | 108 | | |
108 | 109 | | |
| |||
115 | 116 | | |
116 | 117 | | |
117 | 118 | | |
118 | | - | |
| 119 | + | |
| 120 | + | |
119 | 121 | | |
120 | 122 | | |
121 | 123 | | |
| |||
166 | 168 | | |
167 | 169 | | |
168 | 170 | | |
169 | | - | |
170 | | - | |
171 | | - | |
| 171 | + | |
| 172 | + | |
| 173 | + | |
| 174 | + | |
172 | 175 | | |
173 | 176 | | |
174 | 177 | | |
| |||
0 commit comments