Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
机器未来
Paddle
提交
3b5064d6
P
Paddle
项目概览
机器未来
/
Paddle
与 Fork 源项目一致
Fork自
PaddlePaddle / Paddle
通知
1
Star
1
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
1
列表
看板
标记
里程碑
合并请求
0
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
P
Paddle
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
1
Issue
1
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
未验证
提交
3b5064d6
编写于
10月 11, 2022
作者:
C
caozhou
提交者:
GitHub
10月 11, 2022
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
update instantiate for auto parallel (#46883)
上级
0773639a
变更
1
显示空白变更内容
内联
并排
Showing
1 changed file
with
5 addition
and
4 deletion
+5
-4
python/paddle/distributed/auto_parallel/process_group.py
python/paddle/distributed/auto_parallel/process_group.py
+5
-4
未找到文件。
python/paddle/distributed/auto_parallel/process_group.py
浏览文件 @
3b5064d6
...
@@ -21,7 +21,7 @@ from ..collective import _get_global_env
...
@@ -21,7 +21,7 @@ from ..collective import _get_global_env
from
..collective
import
_new_ring_id
from
..collective
import
_new_ring_id
from
...fluid.framework
import
_non_static_mode
from
...fluid.framework
import
_non_static_mode
from
...fluid.layers.tensor
import
fill_constant
from
...fluid.layers.tensor
import
fill_constant
from
paddle
.fluid.framework
import
_enable_legacy_dygraph
from
paddle
import
_legacy_C_ops
def
get_all_process_groups
():
def
get_all_process_groups
():
...
@@ -145,14 +145,15 @@ class ProcessGroup:
...
@@ -145,14 +145,15 @@ class ProcessGroup:
# TODO(shenliang03): This is a temporary solution to solve the problem of
# TODO(shenliang03): This is a temporary solution to solve the problem of
# hang caused by cross-creation of new_group
# hang caused by cross-creation of new_group
paddle
.
disable_static
()
paddle
.
disable_static
()
_enable_legacy_dygraph
()
paddle
.
set_device
(
'gpu:%d'
%
paddle
.
set_device
(
'gpu:%d'
%
paddle
.
distributed
.
ParallelEnv
().
dev_id
)
paddle
.
distributed
.
ParallelEnv
().
dev_id
)
tmp
=
paddle
.
to_tensor
(
tmp
=
paddle
.
to_tensor
(
[
1
],
dtype
=
"int32"
)
if
_non_static_mode
()
else
fill_constant
(
[
1
],
dtype
=
"int32"
)
if
_non_static_mode
()
else
fill_constant
(
[
0
],
dtype
=
"int32"
,
value
=
"1"
)
[
0
],
dtype
=
"int32"
,
value
=
"1"
)
paddle
.
distributed
.
all_reduce
(
tmp
,
sync_op
=
True
,
group
=
self
)
# use legacy ops
paddle
.
distributed
.
wait
(
tmp
,
group
=
self
)
_legacy_C_ops
.
c_allreduce_sum_
(
tmp
,
'use_calc_stream'
,
True
,
'ring_id'
,
self
.
id
)
_legacy_C_ops
.
c_sync_calc_stream
(
tmp
,
tmp
)
paddle
.
enable_static
()
paddle
.
enable_static
()
self
.
_is_instantiate
=
True
self
.
_is_instantiate
=
True
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录