transformers_tasks icon indicating copy to clipboard operation
transformers_tasks copied to clipboard

LLM的finetune需要多大的显存啊?为什么我batch__size调到了1,24g的显存还是不够。。。。。。。

Open SlothRan opened this issue 1 year ago • 2 comments

报错:OutOfMemoryError: CUDA out of memory. Tried to allocate 128.00 MiB (GPU 0; 24.00 GiB total capacity; 23.13 GiB already allocated; 0 bytes free; 23.15 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

SlothRan avatar Apr 16 '23 14:04 SlothRan

Hi,您可以尝试减小 这里max_source_seq_lenmax_target_seq_len 的长度。

HarderThenHarder avatar Apr 20 '23 06:04 HarderThenHarder

我是4090显卡,24g显存,长度设置为50都报错

haizeiwanglf avatar May 08 '23 09:05 haizeiwanglf