Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
机器未来
Paddle
提交
70eb21c5
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看板
提交
70eb21c5
编写于
2月 07, 2021
作者:
S
sandyhouse
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
update, test=develop
上级
594bbcb1
变更
4
隐藏空白更改
内联
并排
Showing
4 changed file
with
16 addition
and
6 deletion
+16
-6
paddle/fluid/framework/distributed_strategy.proto
paddle/fluid/framework/distributed_strategy.proto
+7
-0
paddle/fluid/framework/section_worker.cc
paddle/fluid/framework/section_worker.cc
+1
-1
python/paddle/distributed/fleet/meta_optimizers/amp_optimizer.py
...paddle/distributed/fleet/meta_optimizers/amp_optimizer.py
+4
-3
python/paddle/distributed/fleet/meta_optimizers/pipeline_optimizer.py
...e/distributed/fleet/meta_optimizers/pipeline_optimizer.py
+4
-2
未找到文件。
paddle/fluid/framework/distributed_strategy.proto
浏览文件 @
70eb21c5
...
...
@@ -32,6 +32,9 @@ message ShardingConfig {
optional
float
fuse_broadcast_MB
=
1
[
default
=
32.0
];
optional
bool
hybrid_dp
=
2
[
default
=
false
];
optional
int32
sharding_group_size
=
3
[
default
=
8
];
optional
bool
as_outer_parallelism
=
4
[
default
=
false
];
optional
int32
inner_parallelism_size
=
5
[
default
=
8
];
optional
bool
use_pipeline
=
6
[
default
=
false
];
}
message
AMPConfig
{
...
...
@@ -117,6 +120,8 @@ message AsyncConfig {
message
PipelineConfig
{
optional
int32
micro_batch
=
1
[
default
=
1
];
}
message
ModelParallelConfig
{
optional
int32
parallelism
=
1
[
default
=
1
];
}
message
DistributedStrategy
{
// bool options
optional
Mode
mode
=
1
[
default
=
COLLECTIVE
];
...
...
@@ -146,6 +151,7 @@ message DistributedStrategy {
optional
bool
fp16_allreduce
=
25
[
default
=
false
];
optional
bool
sharding
=
26
[
default
=
false
];
optional
float
last_comm_group_size_MB
=
27
[
default
=
1
];
optional
bool
model_parallel
=
28
[
default
=
false
];
optional
RecomputeConfig
recompute_configs
=
101
;
optional
AMPConfig
amp_configs
=
102
;
...
...
@@ -158,6 +164,7 @@ message DistributedStrategy {
optional
LambConfig
lamb_configs
=
109
;
optional
AdaptiveLocalSGDConfig
adaptive_localsgd_configs
=
110
;
optional
ShardingConfig
sharding_configs
=
111
;
optional
ModelParallelConfig
model_parallel_configs
=
112
;
optional
BuildStrategy
build_strategy
=
201
;
optional
ExecutionStrategy
execution_strategy
=
202
;
}
...
...
paddle/fluid/framework/section_worker.cc
浏览文件 @
70eb21c5
...
...
@@ -107,7 +107,7 @@ void SectionWorker::TrainFiles() {
int
op_role
=
op
->
Attr
<
int
>
(
std
::
string
(
"op_role"
));
if
(
op_role
==
static_cast
<
int
>
(
OpRole
::
kOptimize
))
{
VLOG
(
3
)
<<
"Update: running op "
<<
op
->
Type
();
op
->
Run
(
*
microbatch_scopes_
[
0
],
place_
);
op
->
Run
(
*
microbatch_scopes_
[
num_microbatches_
-
1
],
place_
);
if
(
gc
)
{
DeleteUnusedTensors
(
*
microbatch_scopes_
[
0
],
op
.
get
(),
unused_vars_
,
gc
.
get
());
...
...
python/paddle/distributed/fleet/meta_optimizers/amp_optimizer.py
浏览文件 @
70eb21c5
...
...
@@ -56,9 +56,10 @@ class AMPOptimizer(MetaOptimizerBase):
# add is_distributed to optimize amp, overlap communication and
# computation by split the check_finite_and_unscale op.
is_distributed
=
self
.
role_maker
.
_worker_num
()
>
1
if
self
.
user_defined_strategy
.
sharding
:
# FIXME(wangxi). sharding failed when split check_finite_and_unscale
is_distributed
=
False
#if self.user_defined_strategy.sharding or self.user_defined_strategy.model_parallel:
# # FIXME(wangxi). sharding failed when split check_finite_and_unscale
# # FIXME(JZ-LIANG). To support Sharding-Megatron-AMP, Megatron should follow Sharding's behavior
# is_distributed = False
self
.
wrapped_opt
.
_set_distributed
(
is_distributed
)
def
_can_apply
(
self
):
...
...
python/paddle/distributed/fleet/meta_optimizers/pipeline_optimizer.py
浏览文件 @
70eb21c5
...
...
@@ -154,8 +154,10 @@ class PipelineOptimizer(MetaOptimizerBase):
def
__init__
(
self
,
optimizer
):
super
(
PipelineOptimizer
,
self
).
__init__
(
optimizer
)
self
.
inner_opt
=
optimizer
# we do not allow meta optimizer to be inner optimizer currently
self
.
meta_optimizers_white_list
=
[]
self
.
meta_optimizers_white_list
=
[
"RecomputeOptimizer"
,
"AMPOptimizer"
,
]
self
.
meta_optimizers_black_list
=
[
"GraphExecutionOptimizer"
,
]
def
_set_basic_info
(
self
,
loss
,
role_maker
,
user_defined_optimizer
,
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录