当前位置:网站首页>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来说,用户必须要显式的对每个进程创建一个独立的、关于主训练脚本的副本。这不方便。
边栏推荐
- Dry!Teach you to use industrial raspberries pie combining CODESYS configuration EtherCAT master station
- The future of cloud gaming
- Native JS takes you to understand the implementation and use of array methods
- [问题已处理]-虚拟机报错contains a file system with errors check forced
- el-autocomplete use
- NAT experiment
- 媒体查询、rem移动端适配
- 浏览器兼容汇总
- Billions of IT operations in the market, the product by strength to speak
- 教您简单几步实现工业树莓派正确安装RS232转USB驱动
猜你喜欢

Wireshark packet capture and common filtering methods

Dry!Teach you to use industrial raspberries pie combining CODESYS configuration EtherCAT master station

el-progress implements different colors of the progress bar

数组&的运算

By solving these three problems, the operation and maintenance efficiency will exceed 90% of the hospital

selenium learning

Tencent Internal Technology: Evolution of Server Architecture of "The Legend of Xuanyuan"

Mina's long and short connections

Transformer详细解读与预测实例记录

ev加密视频转换成MP4格式,亲测可用
随机推荐
What should I do if the SSL certificate prompts that it is expired or invalid?
Cocos Creator Mini Game Case "Stick Soldier"
Tencent Cloud Message Queue CMQ
Does flink cdc currently support Gauss database sources?
ALC experiment
Tencent Internal Technology: Evolution of Server Architecture of "The Legend of Xuanyuan"
记录vue-页面缓存问题
七种让盒子水平垂直居中的方法
Alibaba Cloud Video on Demand
Autoware--Beike Tianhui rfans lidar uses the camera & lidar joint calibration file to verify the fusion effect of point cloud images
Wireshark packet capture and common filtering methods
初识网页与浏览器
selenium学习
DevOps-了解学习
sql server 重复值在后面计数
浏览器存储WebStorage
Complete mysql offline installation in 5 minutes
网络排错基础-学习笔记
Shadowless Cloud Desktop
The size of the screen adaptation