Commit aea463b
[Fix] Prevent memory leak in MLA decode graph (vllm-project#3743)
### What this PR does / why we need it?
The cache for MLA decode graph parameters was holding strong references
to tensors, preventing them from being garbage collected and leading to
increased memory usage.
This change wraps the cached tensors in weak references, allowing them
to be deallocated when no longer in use and reducing overall memory
pressure.
### Does this PR introduce _any_ user-facing change?
None.
### How was this patch tested?
None.
- vLLM version: v0.11.0rc3
- vLLM main:
vllm-project/vllm@c9461e0
---------
Signed-off-by: Yizhou Liu <[email protected]>
Signed-off-by: hwhaokun <[email protected]>1 parent c83adbd commit aea463b
File tree
4 files changed
+29
-19
lines changed- vllm_ascend
- attention
- compilation
4 files changed
+29
-19
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
562 | 562 | | |
563 | 563 | | |
564 | 564 | | |
565 | | - | |
| 565 | + | |
| 566 | + | |
566 | 567 | | |
567 | 568 | | |
568 | 569 | | |
| |||
578 | 579 | | |
579 | 580 | | |
580 | 581 | | |
581 | | - | |
| 582 | + | |
582 | 583 | | |
583 | 584 | | |
584 | 585 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
12 | 12 | | |
13 | 13 | | |
14 | 14 | | |
15 | | - | |
16 | | - | |
17 | 15 | | |
18 | 16 | | |
19 | 17 | | |
| |||
35 | 33 | | |
36 | 34 | | |
37 | 35 | | |
38 | | - | |
| 36 | + | |
| 37 | + | |
39 | 38 | | |
40 | 39 | | |
41 | 40 | | |
42 | | - | |
| 41 | + | |
| 42 | + | |
43 | 43 | | |
44 | 44 | | |
| 45 | + | |
45 | 46 | | |
46 | 47 | | |
47 | 48 | | |
48 | 49 | | |
49 | 50 | | |
50 | | - | |
| 51 | + | |
51 | 52 | | |
52 | 53 | | |
53 | 54 | | |
| |||
743 | 744 | | |
744 | 745 | | |
745 | 746 | | |
746 | | - | |
| 747 | + | |
747 | 748 | | |
748 | 749 | | |
749 | 750 | | |
| |||
1115 | 1116 | | |
1116 | 1117 | | |
1117 | 1118 | | |
1118 | | - | |
| 1119 | + | |
| 1120 | + | |
1119 | 1121 | | |
1120 | 1122 | | |
1121 | 1123 | | |
1122 | 1124 | | |
1123 | 1125 | | |
1124 | 1126 | | |
1125 | 1127 | | |
1126 | | - | |
1127 | | - | |
1128 | | - | |
1129 | | - | |
1130 | | - | |
| 1128 | + | |
| 1129 | + | |
| 1130 | + | |
| 1131 | + | |
| 1132 | + | |
| 1133 | + | |
| 1134 | + | |
1131 | 1135 | | |
1132 | 1136 | | |
1133 | 1137 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
212 | 212 | | |
213 | 213 | | |
214 | 214 | | |
215 | | - | |
216 | 215 | | |
217 | 216 | | |
218 | 217 | | |
| |||
258 | 257 | | |
259 | 258 | | |
260 | 259 | | |
261 | | - | |
262 | | - | |
| 260 | + | |
263 | 261 | | |
264 | 262 | | |
265 | 263 | | |
| |||
295 | 293 | | |
296 | 294 | | |
297 | 295 | | |
298 | | - | |
| 296 | + | |
299 | 297 | | |
300 | 298 | | |
301 | 299 | | |
| |||
329 | 327 | | |
330 | 328 | | |
331 | 329 | | |
332 | | - | |
| 330 | + | |
333 | 331 | | |
334 | 332 | | |
335 | 333 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
697 | 697 | | |
698 | 698 | | |
699 | 699 | | |
| 700 | + | |
| 701 | + | |
| 702 | + | |
| 703 | + | |
| 704 | + | |
| 705 | + | |
| 706 | + | |
700 | 707 | | |
701 | 708 | | |
702 | 709 | | |
| |||
0 commit comments