mymusise / ChatGLM-Tuning

基于ChatGLM-6B + LoRA的Fintune方案
MIT License
3.71k stars 444 forks source link

双卡,每卡12g显存,一共24g显存,为啥会爆显存溢出 #180

Closed feingto closed 1 year ago

feingto commented 1 year ago

torch.cuda.OutOfMemoryError: CUDA out of memory. Tried to allocate 128.00 MiB (GPU 0; 14.61 GiB total capacity; 13.73 GiB already allocated; 83.12 MiB free; 13.79 GiB reserved in total by PyTorch) If reserved memory is >> allocated memory try setting max_split_size_mb to avoid fragmentation. See documentation for Memory Management and PYTORCH_CUDA_ALLOC_CONF

jackaduma commented 1 year ago

超参数配置发下呢 我是单卡 2080Ti 12G 就可以run

feingto commented 1 year ago

cd ptuning python main.py --do_train --train_file ../answers.json \ --validation_file ../dev.json \ --prompt_column prompt \ --response_column response \ --overwrite_cache \ --model_name_or_path ../model/chatglm-6b \ --output_dir ../output \ --overwrite_output_dir \ --max_source_length 256 \ --max_target_length 256 \ --per_device_train_batch_size 1 \ --per_device_eval_batch_size 1 \ --gradient_accumulation_steps 16 \ --predict_with_generate \ --max_steps 500 \ --logging_steps 10 \ --save_steps 50 \ --learning_rate 2e-2 \ --pre_seq_len 128

xv994 commented 1 year ago

实在不行跑量化模型吧

cristianohello commented 1 year ago

@feingto 你这个main.py函数是自己写的?本项目没有这个脚本吧

suc16 commented 1 year ago

这是官方库里p-tuning的脚本吧。。。

feingto commented 1 year ago

这是官方库里p-tuning的脚本吧。。。

是的

feingto commented 1 year ago

@feingto 你这个main.py函数是自己写的?本项目没有这个脚本吧

官方训练库的

suc16 commented 1 year ago

这是官方库里p-tuning的脚本吧。。。

是的

可这个库是lora的。。。

feingto commented 1 year ago

windows下解决