Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
机器未来
Paddle
提交
a0f4ac54
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看板
未验证
提交
a0f4ac54
编写于
5月 03, 2021
作者:
L
lilong12
提交者:
GitHub
5月 03, 2021
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Fix the bug in pipeline for dygraph mode (#32716)
* update, test=develop
上级
f4a3f85b
变更
3
展开全部
隐藏空白更改
内联
并排
Showing
3 changed file
with
231 addition
and
155 deletion
+231
-155
python/paddle/distributed/fleet/meta_parallel/parallel_layers/pp_layers.py
...tributed/fleet/meta_parallel/parallel_layers/pp_layers.py
+0
-1
python/paddle/distributed/fleet/meta_parallel/pipeline_parallel.py
...ddle/distributed/fleet/meta_parallel/pipeline_parallel.py
+201
-141
python/paddle/distributed/fleet/meta_parallel/pp_utils/utils.py
.../paddle/distributed/fleet/meta_parallel/pp_utils/utils.py
+30
-13
未找到文件。
python/paddle/distributed/fleet/meta_parallel/parallel_layers/pp_layers.py
浏览文件 @
a0f4ac54
...
...
@@ -108,7 +108,6 @@ class PipelineLayer(Layer):
# construct layer
self
.
run_function
=
[]
self
.
_build_layer
()
self
.
to
(
paddle
.
CUDAPlace
(
self
.
device_id
))
def
_segment_network
(
self
,
seg_method
):
logger
.
info
(
"start segment network.."
)
...
...
python/paddle/distributed/fleet/meta_parallel/pipeline_parallel.py
浏览文件 @
a0f4ac54
此差异已折叠。
点击以展开。
python/paddle/distributed/fleet/meta_parallel/pp_utils/utils.py
浏览文件 @
a0f4ac54
...
...
@@ -16,7 +16,21 @@ import abc
import
paddle
from
...utils
import
hybrid_parallel_util
as
hp_util
__all__
=
[
'get_tensor_bytes'
,
]
__all__
=
[
'get_tensor_bytes'
,
'is_float_tensor'
,
]
FLOAT_TYPES
=
[
paddle
.
float16
,
paddle
.
float32
,
paddle
.
float64
,
]
def
is_float_tensor
(
tensor
):
"""Is a float tensor"""
return
tensor
.
dtype
in
FLOAT_TYPES
def
get_tensor_bytes
(
tensor
):
...
...
@@ -48,10 +62,6 @@ class Generator():
self
.
stage_id
=
stage_id
self
.
prev_stage
=
self
.
stage_id
-
1
self
.
next_stage
=
self
.
stage_id
+
1
assert
self
.
micro_batches
>=
self
.
stages
,
(
"micro_batches {} "
"must be greater than or equal to {}"
.
format
(
self
.
micro_batches
,
self
.
stages
))
@
abc
.
abstractmethod
def
generate
(
self
):
...
...
@@ -73,18 +83,25 @@ class TrainGenerator(Generator):
cmds
=
[]
forward_steps
=
0
backward_steps
=
0
while
(
forward_steps
<
startup_steps
):
cmds
.
append
(
Forward
)
forward_steps
+=
1
#while (forward_steps < startup_steps):
# cmds.append(Forward(cache_id=forward_steps))
# forward_steps += 1
#while (forward_steps < self.micro_batches):
# cmds.append(Forward(cache_id=forward_steps))
# forward_steps += 1
# cmds.append(Backward(cache_id=backward_steps))
# backward_steps += 1
#while (backward_steps < self.micro_batches):
# cmds.append(Backward(cache_id=backward_steps))
# backward_steps += 1
#cmds.append(Optimize())
while
(
forward_steps
<
self
.
micro_batches
):
cmds
.
append
(
Forward
)
cmds
.
append
(
Forward
(
cache_id
=
forward_steps
)
)
forward_steps
+=
1
cmds
.
append
(
Backward
)
backward_steps
+=
1
while
(
backward_steps
<
self
.
micro_batches
):
cmds
.
append
(
Backward
)
cmds
.
append
(
Backward
(
cache_id
=
backward_steps
)
)
backward_steps
+=
1
cmds
.
append
(
Optimize
)
cmds
.
append
(
Optimize
()
)
yield
cmds
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录