Skip to content

sft lora finetune的loss和gradient norm的数值过于大,sft训练后性能反而显著下降 #26

Description

@WeitengHu

我用finetune的代码在我的数据集上进行lora微调,finetune.py没有任何修改,但是训练过程中的loss和gradient norm的数值都是好几十,感觉不正常啊,训练完后性能也下降了,请问这是正常的吗?
我的训练Log数值:
{'loss': 17.0996, 'grad_norm': 14.1919527053833, 'learning_rate': 4.9146347821251266e-05, 'epoch': 0.55}
我的微调脚本:
accelerate launch --num_processes 4 finetune/finetune.py
--model_dir openmoss/MOSS-Audio-8B-Thinking
--data_path path/to/data
--eval_data_path path/to/data
--eval_strategy steps
--save_strategy steps
--output_dir path/to/output
--attn_implementation sdpa
--max_len 2048
--use_lora
--lora_rank 8
--lora_alpha 32
--lora_on_audio_encoder true
--bf16
--per_device_train_batch_size 1
--per_device_eval_batch_size 1
--gradient_accumulation_steps 8
--num_train_epochs 1
--learning_rate 1e-4
--logging_steps 1
--save_steps 10
--eval_steps 10
--lr_scheduler_type cosine
--warmup_steps 50
--save_total_limit 5
--max_grad_norm 1.0 \

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions