当前位置:网站首页>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
来说,用户必须要显式的对每个进程创建一个独立的、关于主训练脚本的副本。这不方便。
边栏推荐
猜你喜欢
初识网页与浏览器
In-depth Zabbix user guide - from the green boy
单臂路由实验和三层交换机实验
Take you in-depth understanding of cookies
Alibaba Cloud Video on Demand
NB-IOT智能云家具项目系列实站
The highlight moment of operation and maintenance starts with intelligence
config.js相关配置汇总
disabledDate 日期选择器 datePicker
Transformer interprets and predicts instance records in detail
随机推荐
设置文本向两边居中展示
Billions of IT operations in the market, the product by strength to speak
Insight into the general trend of the Internet, after reading this article, you will have a thorough understanding of Chinese domain names
Configuration of routers and static routes
ALC experiment
Teach you simple steps to achieve industrial raspberries pie properly installed RS232 USB drive
What should I do if the SSL certificate prompts that it is expired or invalid?
input详解之文件上传
618, you may be able to wake up a little bit
NB-IOT智能云家具项目系列实站
产品学习资料
Passing parameters in multiple threads
Alibaba Cloud Video on Demand
By solving these three problems, the operation and maintenance efficiency will exceed 90% of the hospital
The highlight moment of operation and maintenance starts with intelligence
js判断文字是否超过区域
network issue?Service packet loss?This is enough
Advantages of overseas servers
原生JS带你了解数组方法实现及使用
The cocos interview answers you are looking for are all here!