Last active
December 12, 2022 06:43
-
-
Save wittawasw/c8e6146a135f494834f23d3eca5bf1ac to your computer and use it in GitHub Desktop.
pytorch setting: max_split_size_mb
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import torch | |
# Use when setting up CUDA in the beginning. | |
# Set max split size = 256 MB | |
torch.cuda.memory._set_allocator_settings("max_split_size_mb:256") |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# In terminal active session, use export or set var directly in profile | |
# Set max split size = 256 MB | |
export PYTORCH_CUDA_ALLOC_CONF=max_split_size_mb:256 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment