当前位置:网站首页>Pytorch分布式并行处理
Pytorch分布式并行处理
2022-08-05 05:25:00 【ProfSnail】
Pytorch在1.9版本的官方文档中,明确说明了不再建议使用nn.DataParallel,或者是multiprocessing,而是推荐使用nn.parallel.DistributedDataParllel。即使只有一个GPU核,同样也推荐使用nn.paralle.DistributeDataParalle。官方文档给出的理由是:
The difference between
DistributedDataParallelandDataParallelis:DistributedDataParalleluses multiprocessing where a process is created for each GPU, whileDataParalleluses 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来说,用户必须要显式的对每个进程创建一个独立的、关于主训练脚本的副本。这不方便。
边栏推荐
- Tencent Cloud Message Queue CMQ
- DevOps-了解学习
- The highlight moment of operation and maintenance starts with intelligence
- selenium模块的操作之拉钩
- One-arm routing experiment and three-layer switch experiment
- What impact does CIPU have on the cloud computing industry?
- Come, come, let you understand how Cocos Creator reads and writes JSON files
- Network Troubleshooting Basics - Study Notes
- What is the website ICP record?
- [问题已处理]-jenkins流水线checkout超时
猜你喜欢

What?CDN cache acceleration only works for accelerating static content?

vs2017关于函数命名方面的注意事项

前置++和后置++的区别

初识网页与浏览器

RAID disk array

带你深入了解Cookie

多行文本省略

错误类型:反射。ReflectionException:无法设置属性“xxx”的“类”xxx”与价值“xxx”

What are some things that you only know when you do operation and maintenance?

LinkSLA insists that users come first and creates a sustainable operation and maintenance service plan
随机推荐
document.querySelector()方法
Difference between link and @improt
LeetCode练习及自己理解记录(1)
通过反射获取Class对象的四种方式
5分钟完成mysql离线安装
初识网页与浏览器
Will intelligent operation and maintenance replace manual operation and maintenance?
H5开发调试-Fiddler手机抓包
What impact does CIPU have on the cloud computing industry?
The hook of the operation of the selenium module
Introduction to Network Layer Protocols
[Problem has been resolved]-Virtual machine error contains a file system with errors check forced
Transformer详细解读与预测实例记录
Tencent greetings function SCF - entry instructions
LinkSLA insists that users come first and creates a sustainable operation and maintenance service plan
Mina's long and short connections
深夜小酌,50道经典SQL题,真香~
The use of three parameters of ref, out, and Params in Unity3D
product learning materials
Advantages of overseas servers