forked from pytorch/pytorch
-
Notifications
You must be signed in to change notification settings - Fork 9
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add API to configure memory allocator settings (#453)
- Added the Python API torch.mps.memory.set_allocator_settings(str) to adjust high/low watermark ratios, small/large/xlarge heap size divisors, max pow2 roundup size, and debug verbosity of MPSAllocator messages. - Added the env-var "PYTORCH_MPS_ALLOC_CONF" to pass the settings as an alternative to API set_allocator_settings() (similar to CUDA). - Removed the old env-vars PYTORCH_DEBUG_MPS_ALLOCATOR, PYTORCH_MPS_HIGH_WATERMARK_RATIO, and PYTORCH_MPS_LOW_WATERMARK_RATIO - Fixed the bug with total_memory_allocated_size to count the total size of MTLHeaps and not MTLBuffers (in case heaps aren't fully occupied)
- Loading branch information
1 parent
299f4bc
commit 1d5022f
Showing
12 changed files
with
447 additions
and
225 deletions.
There are no files selected for viewing
This file contains 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
This file contains 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
Oops, something went wrong.