Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
机器未来
Paddle
提交
994bea93
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看板
未验证
提交
994bea93
编写于
9月 22, 2022
作者:
Z
zhaoyingli
提交者:
GitHub
9月 22, 2022
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
[Auto Parallel] fix lazyinit (#46355)
上级
66a4b2e8
变更
3
隐藏空白更改
内联
并排
Showing
3 changed file
with
10 addition
and
5 deletion
+10
-5
python/paddle/distributed/auto_parallel/helper.py
python/paddle/distributed/auto_parallel/helper.py
+1
-0
python/paddle/distributed/auto_parallel/parallelizer_v2.py
python/paddle/distributed/auto_parallel/parallelizer_v2.py
+8
-4
python/paddle/fluid/lazy_init.py
python/paddle/fluid/lazy_init.py
+1
-1
未找到文件。
python/paddle/distributed/auto_parallel/helper.py
浏览文件 @
994bea93
...
...
@@ -341,6 +341,7 @@ class ProgramHelper(object):
try
:
return
self
.
proxy_layer
.
startup_program
except
Exception
as
err
:
self
.
_logger
.
warning
(
"`lazy init` failed."
)
if
isinstance
(
err
,
AssertionError
):
return
self
.
concrete_program
.
startup_program
raise
err
...
...
python/paddle/distributed/auto_parallel/parallelizer_v2.py
浏览文件 @
994bea93
...
...
@@ -105,9 +105,13 @@ class Parallelizer:
format
(
time
.
time
()
-
time0
,
self
.
_mode
))
else
:
# Apply pre optimization passes
# self._apply_pre_optimization(serial_main_program,
# serial_startup_program, None, None,
# None)
time0
=
time
.
time
()
self
.
_apply_pre_optimization
(
serial_main_program
,
serial_startup_program
,
None
,
None
,
None
)
self
.
_logger
.
info
(
"within parallel apply_pre_optimization time: {}, mode {}"
.
format
(
time
.
time
()
-
time0
,
self
.
_mode
))
# Do logical partition
time0
=
time
.
time
()
partitioner
=
Partitioner
(
self
.
_dist_context
,
rank
)
...
...
@@ -176,7 +180,7 @@ class Parallelizer:
# apply amp pass
# FIXME we disenable amp for eval since it has a little bug with
# eval program and which will be fixed in future
if
self
.
_
mode
==
'train'
and
self
.
_
strategy
.
amp
.
enable
:
if
self
.
_strategy
.
amp
.
enable
:
config
=
copy
.
deepcopy
(
self
.
_strategy
.
amp
.
to_dict
())
config
[
"dist_context"
]
=
self
.
_dist_context
config
[
"params_grads"
]
=
params_grads
...
...
python/paddle/fluid/lazy_init.py
浏览文件 @
994bea93
...
...
@@ -36,7 +36,7 @@ class LazyInitHelper(object):
"""
if
self
.
_state
:
return
assert
framework
.
in_dygraph
_mode
(
assert
framework
.
_non_static
_mode
(
),
"LazyInit.enable() is only available in dygraph mode."
self
.
_state
=
True
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录