17
模型应用
K100AI支持微调的时候使用int4量化吗?
2025-12-15 09:50:08
227
镜像:image.sourcefind.cn:5000/dcu/admin/base/jupyterlab-llamafactory:pytorch2.4.1-py3.10-dtk25.04.1-model 安装了:bitsandbytes-0.42.0+das.opt1.dtk24043-py3-none-any.whl 开始微调,报错,提示没有triton包 然后安装:triton-3.0.0+das.opt1.dtk25041-cp310-cp310-manylinux_2_28_x86_64.whl 开始微调,命令 llamafactory-cli train --stage sft --do_train True --model_name_or_path /data/Hugging-Face/hub/models--Qwen--Qwen2.5-32B-Instruct/snapshots/5ede1c97bbab6ce5cda5812749b4c0bdf79b18dd --preprocessing_num_workers 16 --finetuning_type lora --template qwen --flash_attn auto --dataset_dir data --dataset output_B,output_A,jidiqa_dataset,xiaoliu,baiwenbaida --cutoff_len 2048 --learning_rate 5e-05 --num_train_epochs 10.0 --max_samples 100000 --per_device_train_batch_size 2 --gradient_accumulation_steps 8 --lr_scheduler_type cosine --max_grad_norm 1.0 --logging_steps 1 --save_steps 100 --warmup_steps 0 --packing False --enable_thinking True --report_to none --output_dir saves/Qwen2.5-32B-Instruct/lora/train_2025-12-15-09-14-12 --bf16 True --plot_loss True --trust_remote_code True --ddp_timeout 180000000 --include_num_input_tokens_seen True --optim adamw_torch --quantization_bit 4 --quantization_method bnb --double_quantization True --lora_rank 8 --lora_alpha 16 --lora_dropout 0 --lora_target all 报错:[rank2]: File "/opt/conda/lib/python3.10/site-packages/accelerate/big_modeling.py", line 502, in dispatch_model [rank2]: model.to(device) [rank2]: File "/opt/conda/lib/python3.10/site-packages/transformers/modeling_utils.py", line 3688, in to [rank2]: raise ValueError( [rank2]: ValueError: Calling `to()` is not supported for `4-bit` quantized models with the installed version of bitsandbytes. The current device is `cuda:2`. If you intended to move the model, please install bitsandbytes >= 0.43.2. 官网目前最新版本的bitsandbytes是0.42 ps.这个机器我最早五六月份的时候,用过llama-factory int4量化成功微调过模型。 现在完全不行了,不知道是哪里有问题?
全部评论(2)
只看楼主
M
maming
2楼
已经反馈该问题
2025/12/15
S
suily
1楼
目前的0.42.0版本暂不支持4-bit量化(按照官方,低于0.43.2都会报错),等后续适配的新版本应该就可以了
2025/12/15
没有更多内容了
--
楼主
Level.2
0 帖子
楼主热帖
暂无数据