Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

使用后还是不平衡 #8

Closed
mynewstart opened this issue Dec 25, 2020 · 4 comments
Closed

使用后还是不平衡 #8

mynewstart opened this issue Dec 25, 2020 · 4 comments

Comments

@mynewstart
Copy link

单个GPU只能跑一个1 batch,所以将gpusz设为0,总共的batch为1。但是这样却发现跑不了了。
运行一个gpu时,bz=1,gpu占用量11750/12196
运行两个gpu, bz=1,gpu0=0,gpu占用: gpu0:12179 gpu1:5245

@mynewstart mynewstart changed the title 使用后还是不平横 使用后还是不平衡 Dec 25, 2020
@Link-Li
Copy link
Owner

Link-Li commented Dec 25, 2020

当你用一条数据训练的时候,显存就达到了11gb,说明你的模型很大。而且你使用两块GPU进行计算的时候,第一块GPU的显存占用量肯定会增加,所以也不奇怪了。

@mynewstart
Copy link
Author

当你用一条数据训练的时候,显存就达到了11gb,说明你的模型很大。而且你使用两块GPU进行计算的时候,第一块GPU的显存占用量肯定会增加,所以也不奇怪了。

但是gpu0不应该只是在计算梯度的时候使用吗,还有其他什么操作会增加gpu0的显存量吗?

@Link-Li
Copy link
Owner

Link-Li commented Dec 25, 2020

我也不是很了解pytorch占用显存的机制,但是从我做实验的经验来看,pytorch占用的显存并不会释放,除非程序结束

@mynewstart
Copy link
Author

我也不是很了解pytorch占用显存的机制,但是从我做实验的经验来看,pytorch占用的显存并不会释放,除非程序结束

是的,我也有这个体会。我尝试再研究下,感谢回答

@Link-Li Link-Li closed this as completed Mar 11, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants