Commit 19fe2ee
committed
CANN: fix CPU memory leak in CANN backend
This commit fixes a CPU-side memory leak issue in the CANN backend,
which occurred when intermediate aclTensorList objects were not properly
released after operator execution. The leak happened during repeated
invocations of CANN ops (e.g., FlashAttention), leading to increasing
host memory usage over time.
Proper resource cleanup (aclDestroyTensorList and related release logic)
has been added to ensure that all temporary tensors are correctly freed.1 parent f9bc66c commit 19fe2ee
1 file changed
+6
-8
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
146 | 146 | | |
147 | 147 | | |
148 | 148 | | |
149 | | - | |
150 | | - | |
151 | | - | |
| 149 | + | |
152 | 150 | | |
153 | 151 | | |
154 | 152 | | |
| |||
1851 | 1849 | | |
1852 | 1850 | | |
1853 | 1851 | | |
1854 | | - | |
| 1852 | + | |
1855 | 1853 | | |
1856 | 1854 | | |
1857 | 1855 | | |
| |||
3290 | 3288 | | |
3291 | 3289 | | |
3292 | 3290 | | |
3293 | | - | |
3294 | | - | |
| 3291 | + | |
| 3292 | + | |
3295 | 3293 | | |
3296 | 3294 | | |
3297 | 3295 | | |
| |||
3362 | 3360 | | |
3363 | 3361 | | |
3364 | 3362 | | |
3365 | | - | |
3366 | | - | |
| 3363 | + | |
| 3364 | + | |
3367 | 3365 | | |
3368 | 3366 | | |
3369 | 3367 | | |
| |||
0 commit comments