Open shungyantham opened 5 days ago
I have installed trl<0.12.0 to run qlora_finetune.py in the QLoRA/trl-example but it requires transformers 4.46.2 which causes the error below.
So I downgraded trl from 0.11.4 to 0.9.6 and I got another padding error.
These errors is caused by transformers version mismatch. Can you downgrade transformers version to 4.36.0
?
pip install transformers==4.36.0 datasets
Hi, I have also downgraded the transformers to 4.36.0 when I downgrade the trl to 0.9.6 and I got this error
https://github.com/intel-analytics/ipex-llm/blob/main/docker/llm/finetune/xpu/Dockerfile
I build this Dockerfile and then manually pip install trl==0.9.6 in the docker container. I ran the qlora_finetune.py in LLM_Finetuning/QLoRA/trl-example. Is there anything I missed?
https://github.com/intel-analytics/ipex-llm/blob/main/docker/llm/finetune/xpu/Dockerfile
I build this Dockerfile and then manually pip install trl==0.9.6 in the docker container. I ran the qlora_finetune.py in LLM_Finetuning/QLoRA/trl-example. Is there anything I missed?
Hi @shungyantham , we have reproduced this issue in our local env.
Please modify qlora_finetune.py
Line 91. Add data_collator=transformers.DataCollatorForSeq2Seq( tokenizer, pad_to_multiple_of=8, return_tensors="pt", padding=True )
to SFTTrainer.
Code should look like this:
trainer = SFTTrainer(
model=model,
train_dataset=train_data,
args=transformers.TrainingArguments(
per_device_train_batch_size=4,
gradient_accumulation_steps= 1,
warmup_steps=20,
max_steps=200,
learning_rate=2e-5,
save_steps=100,
bf16=True, # bf16 is more stable in training
logging_steps=20,
output_dir="outputs",
optim="adamw_hf", # paged_adamw_8bit is not supported yet
gradient_checkpointing=True, # can further reduce memory but slower
),
dataset_text_field="instruction",
data_collator=transformers.DataCollatorForSeq2Seq(
tokenizer, pad_to_multiple_of=8, return_tensors="pt", padding=True
)
)
Hi @qiyuangong , I have faced another issue after adding the padding to the Trainer
Hi @qiyuangong , I have faced another issue after adding the padding to the Trainer
Please provide transformers and trl version, as well as finetune.py.
I have installed trl<0.12.0 to run qlora_finetune.py in the QLoRA/trl-example but it requires transformers 4.46.2 which causes the error below.
So I downgraded trl from 0.11.4 to 0.9.6 and I got another padding error.