-
Notifications
You must be signed in to change notification settings - Fork 636
InternVL3-9B LoRA微调数据集预处理速度缓慢问题(大约7h) #4076
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
Comments
微调和预处理的时间是重叠的 如果需要加速微调过程,可以参考这里:https://github.com/modelscope/ms-swift/blob/main/examples/train/packing/streaming.sh |
您好,感谢回复!
非常期待您的回复! |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
数据集示例
{
\nIs there a blue or green color cast in the photo?"
"messages": [
{
"role": "user",
"content": "
},
{
"role": "assistant",
"content": "Yes"
}
],
"images": [
"/fine_tune/M_Database/1.jpg"
]
},
我的数据集中共有78170个上面的样本。
环境
RTX 3090 * 4
python 3.10.0
ms-swift 3.4.0
--lazy_tokenize
起初我没有注意到这个参数,官方文档描述它在MLLM微调中默认为True,意味着模型的微调过程会边微调边做数据预处理,在这种情况下我需要11天才能完成微调任务。
所以我将其设置为False,但是它的数据预处理过程依然很缓慢,我设置了dataset_num_proc=12依然需要花费大概7小时才能完成。
微调指令
export HF_DATASETS_CACHE="/fine_tune/cachefile/"
swift sft
--model /fine_tune/InternVL3-9B/
--train_type lora
--dataset '/fine_tune/InternVL3-9B/swift_data.json'
--enable_cache True
--lazy_tokenize False
--dataset_num_proc 12
--torch_dtype bfloat16
--num_train_epochs 1
--per_device_train_batch_size 4
--per_device_eval_batch_size 4
--learning_rate 1e-4
--lora_rank 8
--lora_alpha 32
--target_modules all-linear
--gradient_accumulation_steps 16
--eval_steps 50
--save_steps 50
--save_total_limit 2
--logging_steps 5
--max_length 2048
--output_dir output
--system 'You are a helpful assistant.'
--warmup_ratio 0.05
--dataloader_num_workers 4 \
The text was updated successfully, but these errors were encountered: