Comments (5)
那你可以看一下是不是你模型本身比较大的问题,还有这个和pytorch的版本也有关系,太新的pytorch还没有经过调试
from balanced-dataparallel.
from balanced-dataparallel.
30M应该不会出现这样的情况吧,这个模型和bert-base比都要小很多。我当时测试的应该是1.3附近的一个版本,具体是哪个我已经记不清楚了。
如果不是pytorch版本的问题,我感觉这个可能是模型需要在0号GPU计算梯度,你的batch size本身特别大,这个可能需要的显存比较多。
如果想要排除一下问题,你可以使用官方提供的DataParallel看看显存占用是啥情况。
from balanced-dataparallel.
30M应该不会出现这样的情况吧,这个模型和bert-base比都要小很多。我当时测试的应该是1.3附近的一个版本,具体是哪个我已经记不清楚了。
如果不是pytorch版本的问题,我感觉这个可能是模型需要在0号GPU计算梯度,你的batch size本身特别大,这个可能需要的显存比较多。
如果想要排除一下问题,你可以使用官方提供的DataParallel看看显存占用是啥情况。
我的模型是hiddensize为256的transformer-base,pytorch版本为1.6.0,batchsize为120。
+-----------------------------------------------------------------------------+
| Processes: GPU Memory |
| GPU PID Type Process name Usage |
|=============================================================================|
| 0 24562 C python 9737MiB |
| 1 24562 C python 3549MiB |
| 4 24562 C python 3549MiB |
| 5 24562 C python 3549MiB |
| 6 24562 C python 3549MiB |
| 7 24562 C python 3549MiB |
上面是采用DataParallel的显存占用情况。
之前的batchsize为150左右。
from balanced-dataparallel.
The GPU memory-usage is balanced and can run a larger batchsize, but the accuracy of the trained model has decreased, and it is unclear where the problem is.
from balanced-dataparallel.
Related Issues (16)
- 参数应该如何传递?
- dataparallel运行到某个epoch死锁 HOT 2
- error HOT 2
- BalancedDataParallel 如何指定显卡 HOT 6
- 我这个说'BalancedDataParallel' object has no attribute 'model' 请问知道是什么原因吗 HOT 1
- 用原版的就可以,用这个版本就一直报错 IndexError: tuple index out of range HOT 1
- 您好,我使用这个代码,发现评估效果特别差。
- 参数如何传递? HOT 5
- Your code is error when gpu0bs=0 HOT 1
- 关于batchsize=1 HOT 2
- 代码能够正常运行,但显存不足的问题仍未解决 HOT 12
- IndexError: tuple index out of range HOT 4
- inputs is empty HOT 1
- 使用后还是不平衡 HOT 4
- pytorch1.3.0+py36+3090 cuda11.2下面parallel_apply报错 HOT 5
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from balanced-dataparallel.