Skip to content

Commit 72e6717

Browse files
morrison-turnanskypytorchmergebot
authored andcommitted
Avoid crash with release_available_cached_blocks (pytorch#162269)
updated release behavior for cached blocks Fixes pytorch#159567 Pull Request resolved: pytorch#162269 Approved by: https://github.com/eqy, https://github.com/Skylion007
1 parent ebd29a1 commit 72e6717

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

c10/cuda/CUDACachingAllocator.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3237,8 +3237,8 @@ class DeviceCachingAllocator {
32373237
--it;
32383238
}
32393239
if (!(*cur)->expandable_segment_) {
3240-
release_block(*cur, context);
32413240
totalReleased += (*cur)->size;
3241+
release_block(*cur, context);
32423242
}
32433243
if (is_first) {
32443244
break;

0 commit comments

Comments
 (0)