Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

QLoRA 训练报错 #13

Closed
Zarc98 opened this issue Jun 6, 2023 · 3 comments
Closed

QLoRA 训练报错 #13

Zarc98 opened this issue Jun 6, 2023 · 3 comments
Labels
solved This problem has been already solved

Comments

@Zarc98
Copy link

Zarc98 commented Jun 6, 2023

int4 报错:RuntimeError: self and mat2 must have the same dtype
训练参数:
CUDA_VISIBLE_DEVICES=0 python src/train_sft.py
--model_name_or_path /models/bloomz-7b1-mt
--do_train
--dataset alpaca_gpt4_zh
--finetuning_type lora
--quantization_bit 4
--output_dir bloomz_lora
--overwrite_cache
--per_device_train_batch_size 1
--gradient_accumulation_steps 4
--lr_scheduler_type cosine
--logging_steps 10
--save_steps 1000
--learning_rate 5e-5
--num_train_epochs 3.0
--resume_lora_training False
--plot_loss
--fp16

上述参数的 --quantization_bit 如果设置为 8  可正常训练
设备:RTX3080
@suclogger
Copy link

seems relate to #15

@hiyouga
Copy link
Owner

hiyouga commented Jun 7, 2023

请更新 peft 库版本。

pip install -U git+https://github.com/huggingface/peft.git

@hiyouga hiyouga added the pending This problem is yet to be addressed label Jun 7, 2023
@Zarc98
Copy link
Author

Zarc98 commented Jun 7, 2023

更新到最新peft库版本 可以正常开启int4 qlora训练

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
solved This problem has been already solved
Projects
None yet
Development

No branches or pull requests

3 participants