pytorch/docs
Will Constable bedefa46a9 Document non-pytorch CUDA memory allocation and how to query it (#150880)
This PR documents the fact that PyTorch does not have visibility into how every CUDA memory allocation happend - it only knows about allocations that went through the pytorch CUDA allocator.

It also adds a code snippet showing how to use pynvml to query current GPU memory usage.

## Preview
Added a note at the top of "Understanding CUDA Memory Usage" doc:
<img width="732" alt="image" src="https://github.com/user-attachments/assets/69e28d2a-841a-4b1b-b886-e96fb5d76582" />

which links to a section below:
<img width="733" alt="image" src="https://github.com/user-attachments/assets/cab4f252-9ac2-4fc6-a45d-fdb958fc7dbc" />

Pull Request resolved: https://github.com/pytorch/pytorch/pull/150880
Approved by: https://github.com/kwen2501, https://github.com/ngimel
2025-04-18 03:48:54 +00:00
..
cpp Migrate to new theme (#149331) 2025-04-16 21:35:19 +00:00
source Document non-pytorch CUDA memory allocation and how to query it (#150880) 2025-04-18 03:48:54 +00:00
.gitignore
libtorch.rst Add ROCm documentation to libtorch (C++) reST. (#136378) 2024-09-25 02:30:56 +00:00
make.bat
Makefile Add scripts to generate plots of LRSchedulers (#149189) 2025-04-14 09:53:38 +00:00
README.md
requirements.txt Migrate to new theme (#149331) 2025-04-16 21:35:19 +00:00

Please see the Writing documentation section of CONTRIBUTING.md for details on both writing and building the docs.