/home/csf3o/kohya_ss/venv/lib/python3.10/site-packages/torch/nn/modules/linear.py:125: UserWarning: Attempting to use hipBLASLt on an unsupported architecture! Overriding blas backend to hipblas (Triggered internally at ../aten/src/ATen/Context.cpp:296.)
return F.linear(input, self.weight, self.bias)
Traceback (most recent call last):
File "/home/csf3o/kohya_ss/sd-scripts/flux_train.py", line 998, in <module>
train(args)
File "/home/csf3o/kohya_ss/sd-scripts/flux_train.py", line 787, in train
model_pred = flux(
File "/home/csf3o/kohya_ss/venv/lib/python3.10/site-packages/torch/nn/modules/module.py", line 1736, in _wrapped_call_impl
return self._call_impl(*args, **kwargs)
File "/home/csf3o/kohya_ss/venv/lib/python3.10/site-packages/torch/nn/modules/module.py", line 1747, in _call_impl
return forward_call(*args, **kwargs)
File "/home/csf3o/kohya_ss/venv/lib/python3.10/site-packages/accelerate/utils/operations.py", line 819, in forward
return model_forward(*args, **kwargs)
File "/home/csf3o/kohya_ss/venv/lib/python3.10/site-packages/accelerate/utils/operations.py", line 807, in __call__
return convert_to_fp32(self.model_forward(*args, **kwargs))
File "/home/csf3o/kohya_ss/venv/lib/python3.10/site-packages/torch/amp/autocast_mode.py", line 44, in decorate_autocast
return func(*args, **kwargs)
File "/home/csf3o/kohya_ss/sd-scripts/library/flux_models.py", line 1084, in forward
img, txt = block(img=img, txt=txt, vec=vec, pe=pe, txt_attention_mask=txt_attention_mask)
File "/home/csf3o/kohya_ss/venv/lib/python3.10/site-packages/torch/nn/modules/module.py", line 1736, in _wrapped_call_impl
return self._call_impl(*args, **kwargs)
File "/home/csf3o/kohya_ss/venv/lib/python3.10/site-packages/torch/nn/modules/module.py", line 1747, in _call_impl
return forward_call(*args, **kwargs)
File "/home/csf3o/kohya_ss/sd-scripts/library/flux_models.py", line 751, in forward
return torch.utils.checkpoint.checkpoint(
File "/home/csf3o/kohya_ss/venv/lib/python3.10/site-packages/torch/_compile.py", line 32, in inner
return disable_fn(*args, **kwargs)
File "/home/csf3o/kohya_ss/venv/lib/python3.10/site-packages/torch/_dynamo/eval_frame.py", line 632, in _fn
return fn(*args, **kwargs)
File "/home/csf3o/kohya_ss/venv/lib/python3.10/site-packages/torch/utils/checkpoint.py", line 496, in checkpoint
ret = function(*args, **kwargs)
File "/home/csf3o/kohya_ss/sd-scripts/library/flux_models.py", line 746, in custom_forward
outputs = func(*cuda_inputs)
File "/home/csf3o/kohya_ss/sd-scripts/library/flux_models.py", line 723, in _forward
attn = attention(q, k, v, pe=pe, attn_mask=attn_mask)
File "/home/csf3o/kohya_ss/sd-scripts/library/flux_models.py", line 449, in attention
x = torch.nn.functional.scaled_dot_product_attention(q, k, v, attn_mask=attn_mask)
torch.OutOfMemoryError: HIP out of memory. Tried to allocate 1.85 GiB. GPU 0 has a total capacity of 15.98 GiB of which 398.00 MiB is free. Of the allocated memory 15.21 GiB is allocated by PyTorch, and 52.63 MiB is reserved by PyTorch but unallocated. If reserved but unallocated memory is large try setting PYTORCH_HIP_ALLOC_CONF=expandable_segments:True to avoid fragmentation. See documentation for Memory Management (https://pytorch.org/docs/stable/notes/cuda.html#environment-variables)
Hey, I was testing out flux dreambooth on my 16GB VRAM AMD GPU with blocks to swap = 36, CPU Checkpoint offloading, and Memory Efficient Save.
I see in #1764 a value of 36 on nvidia should enable ~6GB of VRAM usage, instead what I see is ~5.4GB usage when caching latents, then it drops with a long pause of loading state dicts (at ~300MB) while it loads into RAM.
It then starts rising slowly to ~9.6GB, before it reaches
It then quickly rises to ~11GB of usage, printing
And then it spikes up to 15GB and ultimately fails to allocate 1.85GB printing the traceback:
Traceback
I've tried a few different configurations, like turning on/off sdpa, enabling and disabling full fp16 training.
The command used:
config.toml
The commit I am using:
264328d117dc5d17772ec0bdbac2b9f0cf4695f5If you need any more detail or if I can help in any other way to test I would be more than happy to do so.
Or maybe I have some wrong settings, which in that case I'm sorry for any trouble I may have caused.
Thank you in advance!