You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
When Flash Attention 2 is used and "use_dora = True", errored out: "RuntimeError: FlashAttention only support fp16 and bf16 data type" #1013
When FA2 is enabled ("FA2=True" shows up when tuning),
"Unsloth 2024.8: Fast Llama patching. Transformers = 4.44.2.
\ /| GPU: NVIDIA GeForce RTX 4090. Max memory: 23.617 GB. Platform = Linux.
O^O/ _/ \ Pytorch: 2.4.0. CUDA = 8.9. CUDA Toolkit = 12.1.
\ / Bfloat16 = TRUE. FA [Xformers = 0.0.27.post2. FA2 = True]"
and "use_dora = True," in the script,
it always errors out "RuntimeError: FlashAttention only support fp16 and bf16 data type".
And there is no way to disable FA2 in the script - I have tried many FA2 configs in the script.
The only way to use dora is to use Unsloth in a env which has no FA2 installed.
I also have this issue.
Is DoRA fine-tuning officially supported by Unsloth?
I tried many different configurations with Llama 3.1 8B, using DoRA, and all failed. The error mentioned in this issue is triggered when I use load_in_4bit. Otherwise, the fine-tuning runs out of memory (RTX 4090). Setting use_dora=False runs well.
Activity
danielhanchen commentedon Sep 14, 2024
@rohhro Sorry on the delay! Did you use
bf16 = Trueorfp16 = Truein the trainer?rohhro commentedon Sep 14, 2024
I have tried
bf16 = Trueorfp16 = True.Same error in both cases.
benjamin-marie commentedon Apr 22, 2025
I also have this issue.
Is DoRA fine-tuning officially supported by Unsloth?
I tried many different configurations with Llama 3.1 8B, using DoRA, and all failed. The error mentioned in this issue is triggered when I use load_in_4bit. Otherwise, the fine-tuning runs out of memory (RTX 4090). Setting use_dora=False runs well.
CanGeng commentedon Aug 29, 2025
Same error. My solution is:
after get_peft_model().
but it doesn't work when resume_from_checkpoint=True
Fix FlashAttention fp32 crash with DoRA (use_dora=True) (unslothai#6526)
Downcast fp32 QKV and reject non-2D masks under context parallelism
Keep attention in fp32 for fp32 models instead of downcasting to bf16 (…