Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
BaiXuePrincess
Paddle
提交
2cec4c88
P
Paddle
项目概览
BaiXuePrincess
/
Paddle
与 Fork 源项目一致
Fork自
PaddlePaddle / Paddle
通知
1
Star
1
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
P
Paddle
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
未验证
提交
2cec4c88
编写于
7月 28, 2022
作者:
Z
zhaoyingli
提交者:
GitHub
7月 28, 2022
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
adapt for resnet (#44685)
上级
a9f76d07
变更
3
隐藏空白更改
内联
并排
Showing
3 changed file
with
8 addition
and
4 deletion
+8
-4
python/paddle/distributed/auto_parallel/completion.py
python/paddle/distributed/auto_parallel/completion.py
+1
-1
python/paddle/distributed/auto_parallel/operators/dist_default.py
...addle/distributed/auto_parallel/operators/dist_default.py
+3
-1
python/paddle/distributed/auto_parallel/utils.py
python/paddle/distributed/auto_parallel/utils.py
+4
-2
未找到文件。
python/paddle/distributed/auto_parallel/completion.py
浏览文件 @
2cec4c88
...
@@ -1396,7 +1396,7 @@ class Completer:
...
@@ -1396,7 +1396,7 @@ class Completer:
op_dist_attr
.
set_output_dims_mapping
(
op_dist_attr
.
set_output_dims_mapping
(
input_var
.
name
,
[
-
1
])
input_var
.
name
,
[
-
1
])
else
:
else
:
assert
"Moment"
in
input_name
assert
"Moment"
in
input_name
or
"Velocity"
in
input_name
input_var_attr
.
dims_mapping
=
ref_dims_mapping
input_var_attr
.
dims_mapping
=
ref_dims_mapping
op_dist_attr
.
set_input_dims_mapping
(
op_dist_attr
.
set_input_dims_mapping
(
input_var
.
name
,
ref_dims_mapping
)
input_var
.
name
,
ref_dims_mapping
)
...
...
python/paddle/distributed/auto_parallel/operators/dist_default.py
浏览文件 @
2cec4c88
...
@@ -555,8 +555,10 @@ class DistributedDefaultImpl0(DistributedOperatorImpl):
...
@@ -555,8 +555,10 @@ class DistributedDefaultImpl0(DistributedOperatorImpl):
rank_id
=
_get_corresponding_rank
(
rank_id
=
_get_corresponding_rank
(
ctx
,
process_mesh
,
rank_id
)
ctx
,
process_mesh
,
rank_id
)
# NOTE: consider that the variable's shape is None
mesh_shape
=
process_mesh
.
topology
mesh_shape
=
process_mesh
.
topology
batch_size_axis
=
var_dim_mapping
[
0
]
batch_size_axis
=
var_dim_mapping
[
0
]
if
len
(
var_dim_mapping
)
>
0
else
-
1
if
batch_size_axis
>
-
1
and
mesh_shape
[
batch_size_axis
]
>
1
:
if
batch_size_axis
>
-
1
and
mesh_shape
[
batch_size_axis
]
>
1
:
need_gradient_allreduce
=
True
need_gradient_allreduce
=
True
group_ranks
=
_get_comm_group
(
process_mesh
.
processes
,
group_ranks
=
_get_comm_group
(
process_mesh
.
processes
,
...
...
python/paddle/distributed/auto_parallel/utils.py
浏览文件 @
2cec4c88
...
@@ -1058,14 +1058,16 @@ def set_grad_var_shape(program, dist_context):
...
@@ -1058,14 +1058,16 @@ def set_grad_var_shape(program, dist_context):
"dropout_grad"
,
"tanh_grad"
,
"slice"
,
"assign"
,
"dropout_grad"
,
"tanh_grad"
,
"slice"
,
"assign"
,
"matmul_v2_triple_grad"
,
"elementwise_add_triple_grad"
,
"matmul_v2_triple_grad"
,
"elementwise_add_triple_grad"
,
"fill_constant"
,
"sqrt_grad"
,
"fill_constant"
,
"sqrt_grad"
,
"fused_softmax_mask_upper_triangle_grad"
"fused_softmax_mask_upper_triangle_grad"
,
"flatten_contiguous_range_grad"
,
"relu_grad"
]
]
forward_list
=
[
forward_list
=
[
"reshape2"
,
"softmax_with_cross_entropy"
,
"transpose2"
,
"reshape2"
,
"softmax_with_cross_entropy"
,
"transpose2"
,
"softmax"
,
"cross_entropy2"
,
"dropout"
,
"tanh"
,
"softmax"
,
"cross_entropy2"
,
"dropout"
,
"tanh"
,
[
"slice_grad"
,
"c_allgather"
],
"assign"
,
"matmul_v2_grad_grad"
,
[
"slice_grad"
,
"c_allgather"
],
"assign"
,
"matmul_v2_grad_grad"
,
"elementwise_add_grad_grad"
,
"shape"
,
"sqrt"
,
"elementwise_add_grad_grad"
,
"shape"
,
"sqrt"
,
"fused_softmax_mask_upper_triangle"
"fused_softmax_mask_upper_triangle"
,
"flatten_contiguous_range"
,
"relu"
]
]
if
op
.
type
in
need_set_shape_list
:
if
op
.
type
in
need_set_shape_list
:
for
forward_op
in
block
.
ops
:
for
forward_op
in
block
.
ops
:
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录