Code Monkey home page Code Monkey logo

Comments (5)

Link-Li avatar Link-Li commented on June 22, 2024

那你可以看一下是不是你模型本身比较大的问题,还有这个和pytorch的版本也有关系,太新的pytorch还没有经过调试

from balanced-dataparallel.

leileilin avatar leileilin commented on June 22, 2024

from balanced-dataparallel.

Link-Li avatar Link-Li commented on June 22, 2024

30M应该不会出现这样的情况吧,这个模型和bert-base比都要小很多。我当时测试的应该是1.3附近的一个版本,具体是哪个我已经记不清楚了。
如果不是pytorch版本的问题,我感觉这个可能是模型需要在0号GPU计算梯度,你的batch size本身特别大,这个可能需要的显存比较多。
如果想要排除一下问题,你可以使用官方提供的DataParallel看看显存占用是啥情况。

from balanced-dataparallel.

leileilin avatar leileilin commented on June 22, 2024

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.

birdwcp avatar birdwcp commented on June 22, 2024

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)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.