RedditPP Mascot

RedditPP

r/StableDiffusion • … • u/LetterRip

Does your WSL Linux allow you to pin more than 2GB of memory?

Using Deepspeed with diffusers pins 16GB of ram for training Dreambooth, unfortunately CUDA under WSL appears to limit pinned RAM to 2GB (or more exactly 2.147481e9) However I'm interested if anyone has been able to pin more, or knows a work around,

Here is code you can try to test,

import torch

cpu = torch.device('cpu') alloc_size = 2.147481e9 #should succeed, comment out after testing then uncomment next line and retest #alloc_size = 2.147482e9 #should fail print('Allocating') x = torch.zeros(int(alloc_size / 8), dtype=torch.float32, device=cpu) print('Pinning') x = x.pin_memory()

print('Accessing') m = torch.mean(x) assert m == 0 print('Done')

If you succeed or fail please mention it. If you know a work around, please mention it.

— 0