-
Notifications
You must be signed in to change notification settings - Fork 4.3k
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和lora训练的区别是啥 #4206
Comments
通过 quantization_bit 区分 |
谢谢! 1,我的这个理解是否正确? 2,如果使用的gptq版本模型,quantization_bit=4存在与否都是lora训练吗? |
|
gptq 不需要加额外参数 |
请问你懂了吗?我看gptq和普通lora的yaml文件是一样的,除了模型名字,那应该就是对gptq量化后的模型来进行lora?不知我这个理解对不对,想请教一下 |
qlora是在加载模型时候采用nf4量化方式【其中涉及量化的技巧,比如参数服从(0,1)正态分布】,所以使用的模型需要非量化版本,并且增加参数quantization_bit: 4 ,以此区分是lora还是qlora |
所以佬,gptq的那个example是啥意思...从配置文件感觉像是对量化过的模型做lora |
我理解是这个意思 |
|
gptq量化后,可以继续QLORA微调吧。 |
Reminder
System Info
qwen_lora_sft_gptq.yaml的配置信息如下:
model
model_name_or_path: /data/LLM/qwen/Qwen1.5-7B-Chat
quantization_bit: 4
method
stage: sft
do_train: true
finetuning_type: lora
lora_target: all
dataset
dataset: asia_data
template: qwen
cutoff_len: 1024
max_samples: 1000
val_size: 0.1
overwrite_cache: true
preprocessing_num_workers: 16
output
output_dir: saves/qwen1.5-7b-int4/all
logging_steps: 10
save_steps: 200
plot_loss: true
overwrite_output_dir: true
train
per_device_train_batch_size: 2
gradient_accumulation_steps: 2
learning_rate: 0.0001
num_train_epochs: 5.0
lr_scheduler_type: cosine
warmup_steps: 0.1
fp16: true
eval
per_device_eval_batch_size: 1
evaluation_strategy: steps
eval_steps: 500
Reproduction
CUDA_VISIBLE_DEVICES=1 python3 src/train.py examples/qlora_single_gpu/qwen_lora_sft_gptq.yaml
Expected behavior
看到有人问相同的问题,但貌似没有看到答复,所以也提交了issue。
看着配置文件lora和qlora是一样的,那我们怎么区分是Lora还是qlora的?
个人理解:quantization_bit: 4 增加这个参数,是不是模型加载时候用nf4格式加载【qlora的核心之一】,所以此时是启动了qlora方式训练?
Others
No response
The text was updated successfully, but these errors were encountered: