Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
PaddlePaddle
Paddle
提交
ddd60444
P
Paddle
项目概览
PaddlePaddle
/
Paddle
大约 1 年 前同步成功
通知
2299
Star
20931
Fork
5422
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
1423
列表
看板
标记
里程碑
合并请求
543
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
P
Paddle
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
1,423
Issue
1,423
列表
看板
标记
里程碑
合并请求
543
合并请求
543
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
未验证
提交
ddd60444
编写于
4月 14, 2020
作者:
C
Chengmo
提交者:
GitHub
4月 14, 2020
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Fix judge pslib transpiler (#23720)
* fix judge pslib & ranspiler
上级
de3e299d
变更
4
显示空白变更内容
内联
并排
Showing
4 changed file
with
74 addition
and
16 deletion
+74
-16
python/paddle/fluid/device_worker.py
python/paddle/fluid/device_worker.py
+14
-7
python/paddle/fluid/incubate/fleet/base/fleet_base.py
python/paddle/fluid/incubate/fleet/base/fleet_base.py
+5
-9
python/paddle/fluid/incubate/fleet/base/mode.py
python/paddle/fluid/incubate/fleet/base/mode.py
+26
-0
python/setup.py.in
python/setup.py.in
+29
-0
未找到文件。
python/paddle/fluid/device_worker.py
浏览文件 @
ddd60444
...
@@ -13,6 +13,10 @@
...
@@ -13,6 +13,10 @@
# limitations under the License.
# limitations under the License.
"""Defination of device workers."""
"""Defination of device workers."""
from
__future__
import
print_function
from
paddle.fluid.incubate.fleet.parameter_server
import
version
__all__
=
[
__all__
=
[
'DeviceWorker'
,
'Hogwild'
,
'DownpourSGD'
,
'Section'
,
'DownpourSGDOPT'
'DeviceWorker'
,
'Hogwild'
,
'DownpourSGD'
,
'Section'
,
'DownpourSGDOPT'
]
]
...
@@ -101,6 +105,9 @@ class Hogwild(DeviceWorker):
...
@@ -101,6 +105,9 @@ class Hogwild(DeviceWorker):
if
not
opt_info
:
if
not
opt_info
:
return
return
if
version
.
is_transpiler
()
and
"fleet_desc"
not
in
opt_info
:
return
program_configs
=
opt_info
[
"program_configs"
]
program_configs
=
opt_info
[
"program_configs"
]
downpour
=
trainer_desc
.
downpour_param
downpour
=
trainer_desc
.
downpour_param
hogwild
=
trainer_desc
.
hogwild_param
hogwild
=
trainer_desc
.
hogwild_param
...
@@ -406,7 +413,7 @@ class Section(DeviceWorker):
...
@@ -406,7 +413,7 @@ class Section(DeviceWorker):
cfg
.
program_desc
.
ParseFromString
(
program
[
"program"
].
_get_desc
()
cfg
.
program_desc
.
ParseFromString
(
program
[
"program"
].
_get_desc
()
.
serialize_to_string
())
.
serialize_to_string
())
# TODO: why does not work
# TODO: why does not work
#cfg.program_desc.CopyFrom(program.program._get_desc())
#
cfg.program_desc.CopyFrom(program.program._get_desc())
place
=
pipeline_opt
[
"place_list"
][
i
]
place
=
pipeline_opt
[
"place_list"
][
i
]
if
isinstance
(
place
,
core
.
CPUPlace
):
if
isinstance
(
place
,
core
.
CPUPlace
):
cfg
.
place
=
cfg
.
CPUPlace
cfg
.
place
=
cfg
.
CPUPlace
...
...
python/paddle/fluid/incubate/fleet/base/fleet_base.py
浏览文件 @
ddd60444
...
@@ -20,19 +20,15 @@ import paddle.fluid as fluid
...
@@ -20,19 +20,15 @@ import paddle.fluid as fluid
from
paddle.fluid.executor
import
Executor
from
paddle.fluid.executor
import
Executor
from
paddle.fluid.optimizer
import
SGD
from
paddle.fluid.optimizer
import
SGD
from
paddle.fluid.incubate.fleet.base.mode
import
Mode
from
paddle.fluid.incubate.fleet.base.role_maker
import
MPISymetricRoleMaker
from
paddle.fluid.incubate.fleet.base.role_maker
import
MPISymetricRoleMaker
from
paddle.fluid.incubate.fleet.base.role_maker
import
RoleMakerBase
from
paddle.fluid.incubate.fleet.base.role_maker
import
RoleMakerBase
from
paddle.fluid.incubate.fleet.base.role_maker
import
UserDefinedRoleMaker
from
paddle.fluid.incubate.fleet.base.role_maker
import
UserDefinedRoleMaker
from
paddle.fluid.contrib.mixed_precision.decorator
import
OptimizerWithMixedPrecision
from
paddle.fluid.contrib.mixed_precision.decorator
import
OptimizerWithMixedPrecision
from
.
import
mode
__all__
=
[
'Fleet'
,
'DistributedOptimizer'
]
class
Mode
:
__all__
+=
mode
.
__all__
"""
There are various mode for fleet, each of them is designed for different model.
"""
TRANSPILER
=
1
PSLIB
=
2
COLLECTIVE
=
3
class
Fleet
(
object
):
class
Fleet
(
object
):
...
...
python/paddle/fluid/incubate/fleet/base/mode.py
0 → 100644
浏览文件 @
ddd60444
# Copyright (c) 2020 PaddlePaddle Authors. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
from
__future__
import
print_function
__all__
=
[
'Mode'
]
class
Mode
:
"""
There are various mode for fleet, each of them is designed for different model.
"""
TRANSPILER
=
1
PSLIB
=
2
COLLECTIVE
=
3
python/setup.py.in
浏览文件 @
ddd60444
...
@@ -5,6 +5,7 @@ import re
...
@@ -5,6 +5,7 @@ import re
import shutil
import shutil
import sys
import sys
import fnmatch
import fnmatch
import errno
from contextlib import contextmanager
from contextlib import contextmanager
from setuptools import Command
from setuptools import Command
...
@@ -103,6 +104,34 @@ def mkl():
...
@@ -103,6 +104,34 @@ def mkl():
write_version_py(filename='@PADDLE_BINARY_DIR@/python/paddle/version.py')
write_version_py(filename='@PADDLE_BINARY_DIR@/python/paddle/version.py')
def write_distributed_training_mode_py(filename='paddle/fluid/incubate/fleet/parameter_server/version.py'):
cnt = '''from __future__ import print_function
# THIS FILE IS GENERATED FROM PADDLEPADDLE SETUP.PY
from paddle.fluid.incubate.fleet.base.mode import Mode
BUILD_MODE=Mode.%(mode)s
def is_transpiler():
return Mode.TRANSPILER == BUILD_MODE
'''
dirname = os.path.dirname(filename)
try:
os.makedirs(dirname)
except OSError as e:
if e.errno != errno.EEXIST:
raise
with open(filename, 'w') as f:
f.write(cnt % {
'mode': 'PSLIB' if '${WITH_PSLIB}' == 'ON' else 'TRANSPILER'
})
write_distributed_training_mode_py(filename='@PADDLE_BINARY_DIR@/python/paddle/fluid/incubate/fleet/parameter_server/version.py')
packages=['paddle',
packages=['paddle',
'paddle.libs',
'paddle.libs',
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录