ChatGLM-Tuning icon indicating copy to clipboard operation
ChatGLM-Tuning copied to clipboard

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

Open feingto opened this issue 1 year ago • 4 comments

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

feingto avatar Apr 19 '23 08:04 feingto

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

jackaduma avatar Apr 20 '23 01:04 jackaduma

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

feingto avatar Apr 20 '23 06:04 feingto

实在不行跑量化模型吧

xv994 avatar Apr 20 '23 07:04 xv994

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

cristianohello avatar Apr 21 '23 03:04 cristianohello

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

suc16 avatar Apr 25 '23 14:04 suc16

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

是的

feingto avatar Apr 26 '23 08:04 feingto

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

官方训练库的

feingto avatar Apr 26 '23 08:04 feingto

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

是的

可这个库是lora的。。。

suc16 avatar Apr 26 '23 08:04 suc16

windows下解决

feingto avatar Apr 26 '23 08:04 feingto