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
error when finetune gemma2-2b when Running Evaluation #853
File "torch/_dynamo/variables/constant.py", line 176, in call_method
return ConstantVariable.create(op(self.value, add_target))
torch._dynamo.exc.InternalTorchDynamoError: 'bool' object is not subscriptable
from user code:
File "unsloth/kernels/flex_attention.py", line 73, in slow_attention_softcapping
A += causal_mask[:q_len, :q_len]
Set TORCH_LOGS="+dynamo" and TORCHDYNAMO_VERBOSE=1 for more information
changed the title [-]error when finetune gemma2-2b without HAS_FLASH_ATTENTION_SOFTCAPPING[/-][+]error when finetune gemma2-2b when Running Evaluation[/+]on Aug 1, 2024
Hello. After completely reinstalling everything with the latest commit, I can confirm that the error no longer occurs. Interestingly, this also resolved a non-breaking issue I had where the state of each step was missing during training (the dataframe-like state report after each step). Thank you for such an instant fix!
Now my only problem is that I can't test the model evaluation due to CUDA Out of Memory (OOM) errors. I have tried both unsloth/gemma-2-2b-bnb-4bit and unsloth/gemma-2-9b-it-bnb-4bit. I'm on Windows with WSL, running the code with ipynb in VS Code, and my GPU is an RTX 4090. Do you any suggestions I can try?
Hello. After completely reinstalling everything with the latest commit, I can confirm that the error no longer occurs. Interestingly, this also resolved a non-breaking issue I had where the state of each step was missing during training (the dataframe-like state report after each step). Thank you for such an instant fix!
Now my only problem is that I can't test the model evaluation due to CUDA Out of Memory (OOM) errors. I have tried both unsloth/gemma-2-2b-bnb-4bit and unsloth/gemma-2-9b-it-bnb-4bit. I'm on Windows with WSL, running the code with ipynb in VS Code, and my GPU is an RTX 4090. Do you any suggestions I can try?
Thanks
I just realized there's a per_device_eval_batch_size parameter. After setting it to 1, I no longer encountered OOM errors. Model evaluation ran smoothly until the end of training.
I still receive the same error when installing from source with pip install "unsloth[colab-new] @ git+https://github.com/unslothai/unsloth.git". I'm on Python 3.10, using torch==2.3, xformers<0.0.27, trl<0.9.0 using the Gemma 2b fine-tuning demo notebook.
EDIT: Getting the same error after updating to xformers 0.0.27.post2, torch==2.5.0:
Failed running call_function <built-in function iadd>(*(FakeTensor(..., device='cuda:0', size=(s10, s2*s3, s19, s11),
dtype=torch.bfloat16, grad_fn=<MulBackward0>), FakeTensor(..., device='cuda:0', size=(s20, 1, s21, s22), dtype=torch.bfloat16)), **{}):
Attempting to broadcast a dimension of length s22 at -1! Mismatching argument at index 1 had torch.Size([s20, 1, s21, s22]); but expected shape should be broadcastable to [s10, s2*s3, s19, s11]
from user code:
File "/opt/conda/lib/python3.10/site-packages/unsloth/kernels/flex_attention.py", line 73, in slow_attention_softcapping
A += causal_mask[:q_len, :q_len]
Set TORCH_LOGS="+dynamo" and TORCHDYNAMO_VERBOSE=1 for more information
I am experiencing the same error. I am using the 'unsloth/gemma-2-9b-it-bnb-4bit' model with CUDA 11.8 and Torch 2.2.0. For Unsloth, I used the following installation command:
from user code:
File "/home/ksj/.pyenv/versions/3.11.8/lib/python3.11/site-packages/unsloth/kernels/flex_attention.py", line 73, in slow_attention_softcapping
A += causal_mask[:q_len, :q_len]
If anyone has encountered and resolved this issue, I would greatly appreciate it if you could share how you resolved it.
Activity
zfflxx commentedon Aug 1, 2024
I check my flash_attn=2.6.3, I got this error when Running Evaluation
[-]error when finetune gemma2-2b without HAS_FLASH_ATTENTION_SOFTCAPPING[/-][+]error when finetune gemma2-2b when Running Evaluation[/+]danielhanchen commentedon Aug 2, 2024
Oh try uninstalling Unsloth and reinstalling (hopefully that'll fix it!)
Simplegram commentedon Aug 7, 2024
I have this issue as well when using DPOTrainer with unsloth/gemma-2-9b-it-bnb-4bit. I have reinstalled Unsloth along with all dependencies.
danielhanchen commentedon Aug 10, 2024
Will check again apologies!
danielhanchen commentedon Aug 12, 2024
I think I fixed it!
Simplegram commentedon Aug 12, 2024
Hello. After completely reinstalling everything with the latest commit, I can confirm that the error no longer occurs. Interestingly, this also resolved a non-breaking issue I had where the state of each step was missing during training (the dataframe-like state report after each step). Thank you for such an instant fix!
Now my only problem is that I can't test the model evaluation due to CUDA Out of Memory (OOM) errors. I have tried both
unsloth/gemma-2-2b-bnb-4bitandunsloth/gemma-2-9b-it-bnb-4bit. I'm on Windows with WSL, running the code with ipynb in VS Code, and my GPU is an RTX 4090. Do you any suggestions I can try?Thanks
Simplegram commentedon Aug 12, 2024
I just realized there's a
per_device_eval_batch_sizeparameter. After setting it to 1, I no longer encountered OOM errors. Model evaluation ran smoothly until the end of training.danielhanchen commentedon Aug 13, 2024
Oh great you solved it :)
gsarti commentedon Aug 13, 2024
I still receive the same error when installing from source with
pip install "unsloth[colab-new] @ git+https://github.com/unslothai/unsloth.git". I'm on Python 3.10, usingtorch==2.3, xformers<0.0.27, trl<0.9.0using the Gemma 2b fine-tuning demo notebook.EDIT: Getting the same error after updating to
xformers 0.0.27.post2, torch==2.5.0:ivsanro1 commentedon Aug 19, 2024
Having this problem as well.
Interestingly enough, it happens arbitrarily with some sample once in evaluation
edit: Seems to happen with gemma 9b as well
kimseungju-00 commentedon Aug 21, 2024
I am experiencing the same error. I am using the 'unsloth/gemma-2-9b-it-bnb-4bit' model with CUDA 11.8 and Torch 2.2.0. For Unsloth, I used the following installation command:
pip install "unsloth[cu118-ampere-torch220] @ git+https://github.com/unslothai/unsloth.git"
The error I am encountering is:
torch._dynamo.exc.TorchRuntimeError: Failed running call_function ((FakeTensor(..., device='cuda:0', size=(1, s2s3, s10, s10), dtype=torch.bfloat16), FakeTensor(..., device='cuda:0', size=(s9, 1, s10, s10), dtype=torch.bfloat16)), **{}):
output with shape torch.Size([1, s2s3, s10, s10]) doesn't match the broadcast shape (s9, s2s3, s10, s10)
from user code:
File "/home/ksj/.pyenv/versions/3.11.8/lib/python3.11/site-packages/unsloth/kernels/flex_attention.py", line 73, in slow_attention_softcapping
A += causal_mask[:q_len, :q_len]
If anyone has encountered and resolved this issue, I would greatly appreciate it if you could share how you resolved it.
25 remaining items
Fix vision model tokenizer padding side. (#1384)
Llama 3.3 (#1393)
Bug fixes (#1458)
Bug Fixes (#1470)
Bug fixes (#1473)
Fix unslothai#853
Vision support (unslothai#1315)
Bug fixes for vision (unslothai#1340)
Fix llama.cpp GGUF (unslothai#1375)
Dynamic quants (unslothai#1379)
Fix vision model tokenizer padding side. (unslothai#1384)
Llama 3.3 (unslothai#1393)
Bug fixes (unslothai#1458)
Bug Fixes (unslothai#1470)
Bug fixes (unslothai#1473)