Open QiJune opened 4 years ago
We are trying to compare the GPU memory consumption between GoTorch and PyTorch with the Resnet50 model. The scripts locate at https://github.com/wangkuiyi/gotorch/tree/develop/example/resnet.
The GPU card is P100 with 16G memory.
Experiment 1:
Following is the result, it's measured with nvidia-smi command.
nvidia-smi
We remove three-line codes in Only Forward scenario:
# optimizer.zero_grad() # loss.backward() # optimizer.step()
Experiment 2:
GPU memory with different batch size:
From this answer https://discuss.pytorch.org/t/how-to-delete-pytorch-objects-correctly-from-memory/947, it seems that GPU memory consumption value with nvidia-smi is not accurate.
We are trying to compare the GPU memory consumption between GoTorch and PyTorch with the Resnet50 model. The scripts locate at https://github.com/wangkuiyi/gotorch/tree/develop/example/resnet.
The GPU card is P100 with 16G memory.
Experiment 1:
Following is the result, it's measured with
nvidia-smi
command.We remove three-line codes in Only Forward scenario:
Experiment 2:
GPU memory with different batch size: