Baichuan-7B [问题] 明明内存充足,却显示内存不足,

iq3niunx  于 2个月前  发布在  其他
关注(0)|答案(3)|浏览(47)

必需的先决条件

问题

明显还有很多内存没有分配,但显示内存不足
OutOfMemoryError: CUDA out of memory. Tried to allocate 86.00 MiB (GPU 0; 24.00 GiB total capacity; 9.07 GiB already allocated; 13.70 GiB free; 9.08 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

检查清单

  • 我已在上面提供了所有相关且必要的信息。
  • 我已为这个问题选择了合适的标题。
z0qdvdin

z0qdvdin1#

可以看一下是否是程序内部限制了显存比例。

pgccezyw

pgccezyw2#

model = AutoModelForCausalLM.from_pretrained("../baichuan-inc/baichuan-7B", device_map="auto", torch_dtype=torch.float16, trust_remote_code=True)

这样有效。

pvabu6sv

pvabu6sv3#

+1 跑train时内存溢出了

相关问题