Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
BaiXuePrincess
Paddle
提交
5be7a1ff
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看板
未验证
提交
5be7a1ff
编写于
7月 27, 2022
作者:
Z
zhaoyingli
提交者:
GitHub
7月 27, 2022
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
retain dist op returns (#44634)
上级
f49b0cb9
变更
4
隐藏空白更改
内联
并排
Showing
4 changed file
with
12 addition
and
20 deletion
+12
-20
python/paddle/distributed/auto_parallel/dist_op.py
python/paddle/distributed/auto_parallel/dist_op.py
+1
-3
python/paddle/fluid/tests/unittests/auto_parallel/engine_api.py
.../paddle/fluid/tests/unittests/auto_parallel/engine_api.py
+2
-2
python/paddle/fluid/tests/unittests/auto_parallel_gpt_model.py
...n/paddle/fluid/tests/unittests/auto_parallel_gpt_model.py
+8
-8
python/paddle/fluid/tests/unittests/test_auto_parallel_reshard_mppp.py
.../fluid/tests/unittests/test_auto_parallel_reshard_mppp.py
+1
-7
未找到文件。
python/paddle/distributed/auto_parallel/dist_op.py
浏览文件 @
5be7a1ff
...
...
@@ -267,6 +267,4 @@ class DistributedModule:
dist_op
=
DistributedOperator
(
op
,
self
.
_dist_attr
)
dist_op
.
dist_attr
.
mark_annotated_as
(
self
.
_dist_attr
)
default_dist_ctx
.
add_dist_op_for_program
(
dist_op
)
if
isinstance
(
output
,
Variable
):
output
=
[
output
]
return
list
(
output
)
return
output
python/paddle/fluid/tests/unittests/auto_parallel/engine_api.py
浏览文件 @
5be7a1ff
...
...
@@ -89,11 +89,11 @@ class MLPLayer(nn.Layer):
def
forward
(
self
,
input
):
out
=
auto
.
shard_op
(
self
.
norm
,
dist_attr
=
{
"process_mesh"
:
PP_MESH_0
})(
input
)
[
0
]
PP_MESH_0
})(
input
)
out
=
self
.
linear0
(
out
)
out
=
F
.
gelu
(
out
,
approximate
=
True
)
out
=
auto
.
shard_op
(
self
.
linear1
,
dist_attr
=
{
"process_mesh"
:
PP_MESH_1
})(
out
)
[
0
]
PP_MESH_1
})(
out
)
out
=
self
.
dropout
(
out
)
out
=
self
.
linear2
(
out
)
self
.
out
=
out
...
...
python/paddle/fluid/tests/unittests/auto_parallel_gpt_model.py
浏览文件 @
5be7a1ff
...
...
@@ -391,7 +391,7 @@ class TransformerDecoder(nn.Layer):
mod
,
dist_attr
=
{
"process_mesh"
:
PP_MESH_LIST
[
mod
.
mesh_idx
]
})(
output
,
memory
,
tgt_mask
,
use_cache
,
cache
)
[
0
]
})(
output
,
memory
,
tgt_mask
,
use_cache
,
cache
)
auto
.
shard_tensor
(
output
,
dist_attr
=
{
...
...
@@ -405,7 +405,7 @@ class TransformerDecoder(nn.Layer):
mod
,
dist_attr
=
{
"process_mesh"
:
DPPP_MESH_LIST
[
mod
.
mesh_idx
]
})(
output
,
memory
,
tgt_mask
,
use_cache
,
cache
)
[
0
]
})(
output
,
memory
,
tgt_mask
,
use_cache
,
cache
)
auto
.
shard_tensor
(
output
,
dist_attr
=
{
...
...
@@ -419,7 +419,7 @@ class TransformerDecoder(nn.Layer):
mod
,
dist_attr
=
{
"process_mesh"
:
MPPP_MESH_LIST
[
mod
.
mesh_idx
]
})(
output
,
memory
,
tgt_mask
,
use_cache
,
cache
)
[
0
]
})(
output
,
memory
,
tgt_mask
,
use_cache
,
cache
)
auto
.
shard_tensor
(
output
,
dist_attr
=
{
...
...
@@ -433,7 +433,7 @@ class TransformerDecoder(nn.Layer):
mod
,
dist_attr
=
{
"process_mesh"
:
DPMPPP_MESH_LIST
[
mod
.
mesh_idx
]
})(
output
,
memory
,
tgt_mask
,
use_cache
,
cache
)
[
0
]
})(
output
,
memory
,
tgt_mask
,
use_cache
,
cache
)
auto
.
shard_tensor
(
output
,
dist_attr
=
{
...
...
@@ -456,7 +456,7 @@ class TransformerDecoder(nn.Layer):
"process_mesh"
:
PP_MESH_LIST
[
mod
.
mesh_idx
]
})(
output
,
memory
,
tgt_mask
,
use_cache
,
cache
)
[
0
]
use_cache
,
cache
)
auto
.
shard_tensor
(
output
,
dist_attr
=
{
...
...
@@ -471,7 +471,7 @@ class TransformerDecoder(nn.Layer):
"process_mesh"
:
DPPP_MESH_LIST
[
mod
.
mesh_idx
]
})(
output
,
memory
,
tgt_mask
,
use_cache
,
cache
)
[
0
]
use_cache
,
cache
)
auto
.
shard_tensor
(
output
,
dist_attr
=
{
...
...
@@ -486,7 +486,7 @@ class TransformerDecoder(nn.Layer):
"process_mesh"
:
MPPP_MESH_LIST
[
mod
.
mesh_idx
]
})(
output
,
memory
,
tgt_mask
,
use_cache
,
cache
)
[
0
]
use_cache
,
cache
)
auto
.
shard_tensor
(
output
,
dist_attr
=
{
...
...
@@ -500,7 +500,7 @@ class TransformerDecoder(nn.Layer):
mod
,
dist_attr
=
{
"process_mesh"
:
DPMPPP_MESH_LIST
[
mod
.
mesh_idx
]
})(
output
,
memory
,
tgt_mask
,
use_cache
,
cache
)
[
0
]
})(
output
,
memory
,
tgt_mask
,
use_cache
,
cache
)
auto
.
shard_tensor
(
output
,
dist_attr
=
{
...
...
python/paddle/fluid/tests/unittests/test_auto_parallel_reshard_mppp.py
浏览文件 @
5be7a1ff
...
...
@@ -255,12 +255,6 @@ class TestMLPReshard(unittest.TestCase):
"dims_mapping"
:
[
-
1
,
-
1
]
})
# y = paddle.distributed.shard_op(paddle.matmul, process_mesh, {
# x.name: [-1, -1],
# w.name: [-1, -1]
# }, **{"x": x,
# "y": w})[0]
y
=
paddle
.
distributed
.
shard_op
(
paddle
.
matmul
,
dist_attr
=
{
"process_mesh"
:
process_mesh
,
...
...
@@ -270,7 +264,7 @@ class TestMLPReshard(unittest.TestCase):
w
:
{
"dims_mapping"
:
[
-
1
,
-
1
]
}
})(
x
,
w
)
[
0
]
})(
x
,
w
)
rank_id
=
0
dist_context
=
DistributedContext
()
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录