报错
torch.OutOfMemoryError: CUDA out of memory. Tried to allocate 2.07 GiB. GPU 0 has a total capacity of 23.68 GiB of which 609.81 MiB is free. Process 10405 has 23.08 GiB memory in use. Of the allocated memory 20.90 GiB is allocated by PyTorch, and 1.87 GiB is reserved by PyTorch but unallocated. If reserved but unallocated memory is large try setting PYTORCH_CUDA_ALLOC_CONF=expandable_segments:True to avoid fragmentation. See documentation for Memory Management (https://pytorch.org/docs/stable/notes/cuda.html#environment-variables)
Train: 18%|████████████████ | 88/494 [04:04<18:48, 2.78s/it]
lora微调qwen2.5-7b逐渐爆显存
版本 torch 2.4.0 transformers 4.46.1 ms-swift 2.5.1.post1
报错 torch.OutOfMemoryError: CUDA out of memory. Tried to allocate 2.07 GiB. GPU 0 has a total capacity of 23.68 GiB of which 609.81 MiB is free. Process 10405 has 23.08 GiB memory in use. Of the allocated memory 20.90 GiB is allocated by PyTorch, and 1.87 GiB is reserved by PyTorch but unallocated. If reserved but unallocated memory is large try setting PYTORCH_CUDA_ALLOC_CONF=expandable_segments:True to avoid fragmentation. See documentation for Memory Management (https://pytorch.org/docs/stable/notes/cuda.html#environment-variables) Train: 18%|████████████████ | 88/494 [04:04<18:48, 2.78s/it]
显存占用