Understanding PyTorch Memory Management Mechanism

Understanding PyTorch Memory Management Mechanism

Author丨Mialo@Zhihu Source丨https://zhuanlan.zhihu.com/p/486360176 1. Background Introduction Analyzing the PyTorch memory management mechanism primarily aims to reduce the impact of “memory fragmentation”. A simple example is as follows: As shown in the figure above, suppose we want to allocate 800MB of memory. Although the total free memory is 1000MB, the free memory shown in the upper figure … Read more