SimpleTuner OOM on H100 SXM
Hello, I'm trying to fine-tune SD3.5 Large with SimpleTuner on a H100 SXM and I'm getting out of memory errors, i tried with an RTX A6000 before and still not working with 80GB of VRAM, i find it very weird since 80GB should normally be more than enough for SD3.5 training.
Thanks for your help :)
Here are the logs:
***** Running training *****
- Num batches = 511
- Num Epochs = 40
- Current Epoch = 1
- Total train batch size (w. parallel, distributed & accumulation) = 4
- Instantaneous batch size per device = 4
- Gradient Accumulation steps = 1
- Total optimization steps = 20420
- Total optimization steps remaining = 20420
Epoch 1/40, Steps: 0%| | 0/20420 [00:00<?, ?it/s]CUDA out of memory. Tried to allocate 132.00 MiB. GPU 0 has a total capacity of 79.19 GiB of which 11.44 MiB is free. Process 249 has 31.80 GiB memory in use. Including non-PyTorch memory, this process has 47.37 GiB memory in use. Of the allocated memory 45.07 GiB is allocated by PyTorch, and 1.56 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)
Traceback (most recent call last):
File "/workspace/SimpleTuner/train.py", line 51, in <module>
trainer.train()
File "/workspace/SimpleTuner/helpers/training/trainer.py", line 2513, in train
self.accelerator.backward(loss)
File "/workspace/SimpleTuner/.venv/lib/python3.11/site-packages/accelerate/accelerator.py", line 2196, in backward
loss.backward(**kwargs)
File "/workspace/SimpleTuner/.venv/lib/python3.11/site-packages/torch/_tensor.py", line 521, in backward
torch.autograd.backward(
[...]
***** Running training *****
- Num batches = 511
- Num Epochs = 40
- Current Epoch = 1
- Total train batch size (w. parallel, distributed & accumulation) = 4
- Instantaneous batch size per device = 4
- Gradient Accumulation steps = 1
- Total optimization steps = 20420
- Total optimization steps remaining = 20420
Epoch 1/40, Steps: 0%| | 0/20420 [00:00<?, ?it/s]CUDA out of memory. Tried to allocate 132.00 MiB. GPU 0 has a total capacity of 79.19 GiB of which 11.44 MiB is free. Process 249 has 31.80 GiB memory in use. Including non-PyTorch memory, this process has 47.37 GiB memory in use. Of the allocated memory 45.07 GiB is allocated by PyTorch, and 1.56 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)
Traceback (most recent call last):
File "/workspace/SimpleTuner/train.py", line 51, in <module>
trainer.train()
File "/workspace/SimpleTuner/helpers/training/trainer.py", line 2513, in train
self.accelerator.backward(loss)
File "/workspace/SimpleTuner/.venv/lib/python3.11/site-packages/accelerate/accelerator.py", line 2196, in backward
loss.backward(**kwargs)
File "/workspace/SimpleTuner/.venv/lib/python3.11/site-packages/torch/_tensor.py", line 521, in backward
torch.autograd.backward(
[...]
0 Replies