Closed sidtandon2014 closed 4 months ago
Can you try to run this additional snippet:
model = get_peft_model(...)
# convert all peft parameters to float32
for param in model.parameters():
if param.requires_grad:
param.data = param.data.float()
This issue has been automatically marked as stale because it has not had recent activity. If you think this still needs to be addressed please comment on this thread.
System Info
I am trying to fine tune gemma 7b model in 4 bit with additional vocab and using following configuration, but getting NaN in train and eval loss. Though train loss first decreases for couple of steps and then turn to NaN
In order to update the vocab I have extended sentencepiece model instead of add_tokens method (FYI: add_tokens is degrading tokens quality) https://github.com/huggingface/tokenizers/issues/627#issuecomment-2076489455 https://github.com/google/sentencepiece/blob/master/python/add_new_vocab.ipynb
Along with this while training, I am setting embedding values to 0 for all new tokens
Additional properties:
Who can help?
@BenjaminBossan
Information
Tasks
examples
folderReproduction
Task: Translate Sanskrit to English Dataset:"rahular/itihasa"
Loss Snapshot: [A{'eval_loss': nan, 'eval_runtime': 708.8687, 'eval_samples_per_second': 13.125, 'eval_steps_per_second': 1.641, 'epoch': 0.15}
Expected behavior
Validation loss should not be NaN