当前位置:网站首页>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来说,用户必须要显式的对每个进程创建一个独立的、关于主训练脚本的副本。这不方便。
边栏推荐
- 滚动条问题,未解决
- Programmers should understand I/O this way
- 多线程之传递参数
- D39_ coordinate transformation
- Network Protocol Fundamentals - Study Notes
- 指针常量与常量指针 巧记
- 通过反射获取Class对象的四种方式
- What is Alibaba Cloud Express Beauty Station?
- Tencent Internal Technology: Evolution of Server Architecture of "The Legend of Xuanyuan"
- Seven Ways to Center a Box Horizontally and Vertically
猜你喜欢

单片机原理与应用复习

Mina disconnects and reconnects

Mina's long and short connections

多线程之传递参数

input detailed file upload

NB-IOT智能云家具项目系列实站

DevOps process demo (practical record)

Complete mysql offline installation in 5 minutes

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

前置++和后置++的区别
随机推荐
The 25 best free games on mobile in 2020
What is Alibaba Cloud Express Beauty Station?
Advantages of overseas servers
Tencent greetings function SCF - entry instructions
通过反射获取Class对象的四种方式
Chengyun Technology was invited to attend the 2022 Alibaba Cloud Partner Conference and won the "Gathering Strength and Going Far" Award
VLAN介绍与实验
浏览器存储WebStorage
In-depth Zabbix user guide - from the green boy
The future of cloud gaming
Insight into the general trend of the Internet, after reading this article, you will have a thorough understanding of Chinese domain names
ES2020新特性
Media query, rem mobile terminal adaptation
Transformer详细解读与预测实例记录
DisabledDate date picker datePicker
Alibaba Cloud Video on Demand
Come, come, let you understand how Cocos Creator reads and writes JSON files
The method of using ROS1 bag under ROS2
What is the website ICP record?
Browser Storage for H5