-
Notifications
You must be signed in to change notification settings - Fork 1.1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
How to make use of NVIDIA GH200 Grace Hopper Superchip #1892
Comments
Hi there. Based on the message you are getting, it looks like all the memory is used. Based on your nvidia-smi output, you have 97871 MiB, which is 97871 / 1024 ≈ 95 GiB. This would match the statement
For general strategies to reduce memory usage, you can try bf16 training, smaller batch and block sizes, etc. Pretraining can be a bit resource-hungry. |
The question is how to use the unified memory. |
Oh I see now, I didn't realize it was a unified memory between CPU and GPU (I thought it was somehow between multiple GPUs). In that case, I am actually not sure how to leverage that in PyTorch in general. My guess is that there will be larger transfer speeds between CPU and GPU memory, but not sure how to leverage that additional CPU RAM in PyTorch during training. Here, I am assuming the 95 Gb RAM are not already part of it, and there is an additional available memory on the CPU that you want to use. The only way I could think of right now is to enable CPU offloading in FSDP/FSDPStrategy. I.e., by setting |
Looks like unified memory support is still work in progress on the PyTorch side: vllm-project/vllm#10267 & pytorch/pytorch#124807 |
I have access to a GH200 gpu and I'm trying to do model pretraining but when running the pretrain command i get Cuda out of memory error because litgpt isn't using the available unified memory of the chip.
torch.OutOfMemoryError: CUDA out of memory. Tried to allocate 224.00 MiB. GPU 0 has a total capacity of 94.88 GiB of which 172.19 MiB is free. Including non-PyTorch memory, this process has 94.69 GiB memory in use. Of the allocated memory 91.40 GiB is allocated by PyTorch, and 2.55 GiB is reserved by PyTorch but unallocated. If reserved but unallocated memory is large try setting PYTORCH_CUDA_ALLOC_CONF=expandable_segments:True to avoid fragmentation. See documentation for Memory Management (https://pytorch.org/docs/stable/notes/cuda.html#environment-variables)
Is there a way to use all the available memory?
The text was updated successfully, but these errors were encountered: