Repository navigation
Commit d2b1f3a
Free slot-memory arenas once every graphed callable is reset
Every callable returned with _graph_memory_slots holds the shared allocator pool and the
saved, offload and user-gradient arenas as attributes, and reset() left them in place, so a
caller that kept reset callables also kept their GPU and pinned host memory. reset() now drops
the callable's own references, the arenas before the pool because the pool's destructor
returns only blocks that are already free; peers keep their references, so the memory is freed
once every callable that shares it has been reset. The staging matcher referred to itself, a
cycle that kept staging buffers allocated in the pool alive until gc ran; it is now deleted
after use.
The new test keeps the handles, resets one callable and checks that its peer still replays
correctly, then resets the other with gc disabled and checks that the arena storages are gone
and that the pool holds no device segment.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Signed-off-by: Tailai Ma <tailaim@nvidia.com>1 parent c3d3d0d commit d2b1f3a
2 files changed
Lines changed: 95 additions & 6 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
172 | 172 | | |
173 | 173 | | |
174 | 174 | | |
| 175 | + | |
| 176 | + | |
| 177 | + | |
| 178 | + | |
| 179 | + | |
| 180 | + | |
| 181 | + | |
| 182 | + | |
| 183 | + | |
| 184 | + | |
| 185 | + | |
| 186 | + | |
| 187 | + | |
| 188 | + | |
| 189 | + | |
| 190 | + | |
| 191 | + | |
| 192 | + | |
| 193 | + | |
| 194 | + | |
| 195 | + | |
| 196 | + | |
| 197 | + | |
| 198 | + | |
| 199 | + | |
| 200 | + | |
| 201 | + | |
| 202 | + | |
| 203 | + | |
| 204 | + | |
| 205 | + | |
| 206 | + | |
| 207 | + | |
| 208 | + | |
| 209 | + | |
| 210 | + | |
| 211 | + | |
| 212 | + | |
| 213 | + | |
| 214 | + | |
| 215 | + | |
| 216 | + | |
| 217 | + | |
| 218 | + | |
| 219 | + | |
| 220 | + | |
| 221 | + | |
| 222 | + | |
| 223 | + | |
| 224 | + | |
| 225 | + | |
| 226 | + | |
| 227 | + | |
| 228 | + | |
| 229 | + | |
| 230 | + | |
| 231 | + | |
| 232 | + | |
| 233 | + | |
| 234 | + | |
| 235 | + | |
175 | 236 | | |
176 | 237 | | |
177 | 238 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
106 | 106 | | |
107 | 107 | | |
108 | 108 | | |
| 109 | + | |
| 110 | + | |
| 111 | + | |
| 112 | + | |
| 113 | + | |
| 114 | + | |
| 115 | + | |
| 116 | + | |
| 117 | + | |
| 118 | + | |
| 119 | + | |
109 | 120 | | |
110 | 121 | | |
111 | 122 | | |
| |||
1740 | 1751 | | |
1741 | 1752 | | |
1742 | 1753 | | |
| 1754 | + | |
| 1755 | + | |
1743 | 1756 | | |
1744 | 1757 | | |
1745 | 1758 | | |
| |||
3089 | 3102 | | |
3090 | 3103 | | |
3091 | 3104 | | |
3092 | | - | |
| 3105 | + | |
3093 | 3106 | | |
3094 | 3107 | | |
3095 | 3108 | | |
3096 | 3109 | | |
3097 | 3110 | | |
3098 | 3111 | | |
3099 | 3112 | | |
| 3113 | + | |
| 3114 | + | |
3100 | 3115 | | |
3101 | 3116 | | |
3102 | 3117 | | |
| |||
3136 | 3151 | | |
3137 | 3152 | | |
3138 | 3153 | | |
| 3154 | + | |
| 3155 | + | |
| 3156 | + | |
| 3157 | + | |
| 3158 | + | |
| 3159 | + | |
3139 | 3160 | | |
3140 | 3161 | | |
3141 | 3162 | | |
| |||
3234 | 3255 | | |
3235 | 3256 | | |
3236 | 3257 | | |
| 3258 | + | |
3237 | 3259 | | |
3238 | 3260 | | |
3239 | 3261 | | |
3240 | 3262 | | |
3241 | | - | |
3242 | | - | |
3243 | | - | |
3244 | | - | |
| 3263 | + | |
| 3264 | + | |
| 3265 | + | |
| 3266 | + | |
| 3267 | + | |
| 3268 | + | |
| 3269 | + | |
| 3270 | + | |
3245 | 3271 | | |
3246 | 3272 | | |
3247 | 3273 | | |
| |||
3374 | 3400 | | |
3375 | 3401 | | |
3376 | 3402 | | |
3377 | | - | |
| 3403 | + | |
| 3404 | + | |
| 3405 | + | |
3378 | 3406 | | |
3379 | 3407 | | |
3380 | 3408 | | |
| |||
0 commit comments