Comments (4)
实验条件:4卡 Ubuntu 背景:项目的其他 训练脚本 都能运行复现成功,所以框架环境应该没问题,只有下面的脚本执行有问题 运行命令:CUDA_VISIBLE_DEVICES=0,1 python multi-gpu-dataparallel-cls.py 报错如下: warnings.warn('Was asked to gather along dimension 0, but all '
我的排查过程: 我把模型的输出(logits, label = self.on_step(batch_data) loss = self.criterion(logits, label)这两行的结果变量)打印了一下,然后手动计算loss,发现确实是inf 然后我把同样的输入在 model(不打开 数据并行)单卡测试,发现loss正常, 然后把通常的输入在 model(打开 数据并行)上双卡测试,发现loss确实 inf. 一直没有排查出原因,还请大佬指教
可能的解决方法:
1、调小学习率。
2、代码中增加梯度裁剪策略。
from pytorch-distributed-nlp.
实验如下(单一变量操作):
大佬,疑惑一个问题:
- 同样的模型,同样的输入,为啥单卡时,输出的logits和多卡的输出logits不同呢?dataparallel不就是 每个GPU加载同样的模型吗?
感谢大佬百忙之中指教
from pytorch-distributed-nlp.
我也不知道是什么原因了。
from pytorch-distributed-nlp.
感谢,我再研究下,如果解决就贴在这里
from pytorch-distributed-nlp.
Related Issues (5)
- 分布式保存模型,需要model.module.state_dict() HOT 2
- autodl HOT 1
- 在哪里指定多个节点的信息? HOT 3
- deepspeed版本运行速度 HOT 4
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 pytorch-distributed-nlp.