ryujaehun / pytorch-gpu-benchmark

Using the famous cnn model in Pytorch, we run benchmarks on various gpu.
MIT License
226 stars 85 forks source link

RuntimeError: CUDA out of memory. Tried to allocate 32.00 MiB (GPU 0; 7.79 GiB total capacity; 6.64 GiB already allocated; 21.00 MiB free; 150.86 MiB cached) . #5

Closed M-Abdallah closed 4 years ago

M-Abdallah commented 4 years ago

It clearly shows I still have over 1GB unallocated

angkec commented 4 years ago

same thing: RuntimeError: CUDA out of memory. Tried to allocate 16.00 MiB (GPU 0; 5.77 GiB total capacity; 4.51 GiB already allocated; 15.75 MiB free; 84.29 MiB cached)

ryujaehun commented 4 years ago

it 'll be helpful reducing BATCH_SIZE. and i recommended removing other processes used by gpu.

Edwardmark commented 4 years ago

@ryujaehun have you tried batch size 1? I see no speed up using fp16 vs fp32.

ryujaehun commented 4 years ago

@ryujaehun have you tried batch size 1? I see no speed up using fp16 vs fp32.

https://pytorch.org/docs/stable/bottleneck.html will help you