Commit 790ab3a
committed
[Perf][MoE] Share FlashInfer B12x MoE workspaces across layers
Every MoE layer allocated its own B12xMoEWrapper workspaces, which is
a large per-layer GPU memory cost. The workspaces are identical for
every layer and layers execute sequentially, so all layers in a worker
process can share the buffers allocated by the first wrapper.
Depends on flashinfer-ai/flashinfer#4603, which adds the
shared_static_workspace / shared_dynamic_workspace / shared_output
parameters to B12xMoEWrapper.
Signed-off-by: Zihua Wu <13583761+lucifer1004@users.noreply.github.com>1 parent f1178f3 commit 790ab3a
1 file changed
Lines changed: 28 additions & 0 deletions
Lines changed: 28 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
49 | 49 | | |
50 | 50 | | |
51 | 51 | | |
| 52 | + | |
| 53 | + | |
| 54 | + | |
| 55 | + | |
52 | 56 | | |
53 | 57 | | |
54 | 58 | | |
| |||
239 | 243 | | |
240 | 244 | | |
241 | 245 | | |
| 246 | + | |
| 247 | + | |
| 248 | + | |
| 249 | + | |
| 250 | + | |
| 251 | + | |
| 252 | + | |
| 253 | + | |
| 254 | + | |
| 255 | + | |
| 256 | + | |
| 257 | + | |
| 258 | + | |
| 259 | + | |
| 260 | + | |
242 | 261 | | |
243 | 262 | | |
244 | 263 | | |
| |||
248 | 267 | | |
249 | 268 | | |
250 | 269 | | |
| 270 | + | |
| 271 | + | |
| 272 | + | |
251 | 273 | | |
| 274 | + | |
| 275 | + | |
| 276 | + | |
| 277 | + | |
| 278 | + | |
| 279 | + | |
252 | 280 | | |
253 | 281 | | |
254 | 282 | | |
| |||
0 commit comments