CPM-Bee icon indicating copy to clipboard operation
CPM-Bee copied to clipboard

单卡微调,没有输出微调模型

Open ivancr7 opened this issue 1 year ago • 6 comments

微调命令:torchrun --nnodes=1 --nproc_per_node=1 --rdzv_id=1 --rdzv_backend=c10d --rdzv_endpoint=localhost:12345 finetune_cpm_bee.py --use-delta --model-config config/cpm-bee-10b.json --dataset ../tutorials/basic_task_finetune/bin_data/train --eval_dataset ../tutorials/basic_task_finetune/bin_data/eval --epoch 5 --batch-size 5 --train-iters 100 --save-name cpm_bee_finetune --max-length 32 --save results/ --lr 0.0001 --inspect-iters 100 --warmup-iters 1 --eval-interval 50 --early-stop-patience 5 --lr-decay-style noam --weight-decay 0.01 --clip-grad 1.0 --loss-scale 32768 --start-step 0 --load model/pytorch_model.bin

相关日志: root ├── encoder (Encoder) │ ├── layers (TransformerBlockList) │ │ └── 0-47(CheckpointBlock) │ │ ├── self_att (SelfAttentionBlock) │ │ │ ├── layernorm_before_attention (LayerNorm) weight:[4096] │ │ │ └── self_attention (Attention) │ │ │ ├── project_q,project_v(Linear) weight:[16777216] │ │ │ │ └── lora (DistributedLowRankLinear) lora_A:[32768] lora_B:[32768] │ │ │ └── project_k,attention_out(Linear) weight:[16777216] │ │ └── ffn (FFNBlock) │ │ ├── layernorm_before_ffn (LayerNorm) weight:[4096] │ │ └── ffn (FeedForward) │ │ ├── w_in (DenseGatedACT) │ │ │ └── w_0,w_1(Linear) weight:[41943040] │ │ └── w_out (Linear) weight:[41943040] │ └── output_layernorm (LayerNorm) weight:[4096] ├── input_embedding (EmbeddingExt) weight:[354643968] └── position_bias (BucketPositionBias) relative_attention_bias:[16384] [INFO|(OpenDelta)basemodel:696]2023-06-08 16:07:50,152 >> Trainable Ratio: 6291456/9622372352=0.065384% [INFO|(OpenDelta)basemodel:698]2023-06-08 16:07:50,152 >> Delta Parameter Ratio: 6291456/9622372352=0.065384% [INFO|(OpenDelta)basemodel:700]2023-06-08 16:07:50,152 >> Static Memory 17.92 GB, Max Memory 36.48 GB

在result目录下没有看到有输出,日志也没有报错,请问下是怎么回事?

ivancr7 avatar Jun 08 '23 09:06 ivancr7

试了几次也遇到了这个问题

MKChens avatar Jun 09 '23 10:06 MKChens

可能是max_length=32设置的太小,导致数据因为超过长度限制全都被跳过了,训练并没有开始。

zh-zheng avatar Jun 13 '23 02:06 zh-zheng

可能是max_length=32设置的太小,导致数据因为超过长度限制全都被跳过了,训练并没有开始。

@zh-zheng 但是再大的长度,我这里就OOM了。 使用的是NVIDIA A40 48G。想问问微调的话,最小要求的资源是多少。或者在当前资源下,参数要如何配置才可以运行

ivancr7 avatar Jun 13 '23 06:06 ivancr7

您好,微调的话建议最少80G显存:)

gongbaitao avatar Jun 20 '23 02:06 gongbaitao

用10张消费级3080 8G显卡凑够80G,这样能满足最低条件吗

wangnan229 avatar Jun 29 '23 05:06 wangnan229

--eval-interval 50 这个设置小一些,我猜是你的训练iter比较少,导致没到50个iter就结束了。他这个代码是每次eval以后才保存。

susimonxu avatar Aug 01 '23 10:08 susimonxu