当前位置:网站首页>Pytorch分布式并行处理
Pytorch分布式并行处理
2022-08-05 05:25:00 【ProfSnail】
Pytorch在1.9版本的官方文档中,明确说明了不再建议使用nn.DataParallel
,或者是multiprocessin
g,而是推荐使用nn.parallel.DistributedDataParllel
。即使只有一个GPU核,同样也推荐使用nn.paralle.DistributeDataParalle
。官方文档给出的理由是:
The difference between
DistributedDataParallel
andDataParallel
is:DistributedDataParallel
uses multiprocessing where a process is created for each GPU, whileDataParallel
uses multithreading. By using multiprocessing, each GPU has its dedicated process, this avoids the performance overhead caused by GIL of Python interpreter.
大意是,DistributedDataParallel
比较优秀,是因为他对每个GPU分配一个固定的进程;而DataParallel
不推荐,因为使用的是多线程的方法,这可能会导致来自于GIL或者Python解释器的性能开销。
另一个Basic
文档里面提到,对于torch.multiprocessing
或者是torch.nn.DataParallel
来说,用户必须要显式的对每个进程创建一个独立的、关于主训练脚本的副本。这不方便。
边栏推荐
- 错误类型:反射。ReflectionException:无法设置属性“xxx”的“类”xxx”与价值“xxx”
- 浏览器兼容汇总
- LinkSLA insists that users come first and creates a sustainable operation and maintenance service plan
- H5开发调试-Fiddler手机抓包
- What?CDN cache acceleration only works for accelerating static content?
- 设置文本向两边居中展示
- Difference between link and @improt
- selenium模块的操作之拉钩
- network issue?Service packet loss?This is enough
- Quick question and quick answer - FAQ of Tencent Cloud Server
猜你喜欢
随机推荐
el-progress implements different colors of the progress bar
H5开发调试-Fiddler手机抓包
DevOps process demo (practical record)
Network Protocol Fundamentals - Study Notes
【考研结束第一天,过于空虚,想对自己进行总结一下】
Nacos集群的搭建过程详解
What should I do if the SSL certificate prompts that it is expired or invalid?
link 和@improt的区别
[Problem has been resolved]-Virtual machine error contains a file system with errors check forced
VRRP overview and experiment
Nacos配置服务的源码解析(全)
Does flink cdc currently support Gauss database sources?
CIPU, what impact does it have on the cloud computing industry?
Cocos Creator Mini Game Case "Stick Soldier"
多行文本省略
RAID disk array
NAT experiment
D46_Force applied to rigid body
wc, grep, tar, vi/vim
Four ways to obtain Class objects through reflection