Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
机器未来
Paddle
提交
bd018360
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看板
未验证
提交
bd018360
编写于
6月 01, 2022
作者:
C
caozhou
提交者:
GitHub
6月 01, 2022
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
add some comp op costs (#43114)
上级
010aba33
变更
2
展开全部
隐藏空白更改
内联
并排
Showing
2 changed file
with
752 addition
and
36 deletion
+752
-36
python/paddle/distributed/auto_parallel/cost/comp_op_cost.py
python/paddle/distributed/auto_parallel/cost/comp_op_cost.py
+574
-36
python/paddle/fluid/tests/unittests/auto_parallel/test_comp_cost.py
...dle/fluid/tests/unittests/auto_parallel/test_comp_cost.py
+178
-0
未找到文件。
python/paddle/distributed/auto_parallel/cost/comp_op_cost.py
浏览文件 @
bd018360
此差异已折叠。
点击以展开。
python/paddle/fluid/tests/unittests/auto_parallel/test_comp_cost.py
浏览文件 @
bd018360
...
...
@@ -54,6 +54,35 @@ from paddle.distributed.auto_parallel.cost.comp_op_cost import LookupTableV2Grad
from
paddle.distributed.auto_parallel.cost.comp_op_cost
import
MatmulOpCost
from
paddle.distributed.auto_parallel.cost.comp_op_cost
import
MatmulGradOpCost
from
paddle.distributed.auto_parallel.cost.comp_op_cost
import
MatmulV2OpCost
from
paddle.distributed.auto_parallel.cost.comp_op_cost
import
MatmulV2GradOpCost
from
paddle.distributed.auto_parallel.cost.comp_op_cost
import
MemcpyOpCost
from
paddle.distributed.auto_parallel.cost.comp_op_cost
import
MulOpCost
from
paddle.distributed.auto_parallel.cost.comp_op_cost
import
MulGradOpCost
from
paddle.distributed.auto_parallel.cost.comp_op_cost
import
OneHotOpCost
from
paddle.distributed.auto_parallel.cost.comp_op_cost
import
ReadFromArrayOpCost
from
paddle.distributed.auto_parallel.cost.comp_op_cost
import
ReduceSumOpCost
from
paddle.distributed.auto_parallel.cost.comp_op_cost
import
ReduceSumGradOpCost
from
paddle.distributed.auto_parallel.cost.comp_op_cost
import
Reshape2OpCost
from
paddle.distributed.auto_parallel.cost.comp_op_cost
import
Reshape2GradOpCost
from
paddle.distributed.auto_parallel.cost.comp_op_cost
import
ReduceMeanOpCost
from
paddle.distributed.auto_parallel.cost.comp_op_cost
import
ReduceMeanGradOpCost
from
paddle.distributed.auto_parallel.cost.comp_op_cost
import
SamplingIdOpCost
from
paddle.distributed.auto_parallel.cost.comp_op_cost
import
ScaleOpCost
from
paddle.distributed.auto_parallel.cost.comp_op_cost
import
SliceOpCost
from
paddle.distributed.auto_parallel.cost.comp_op_cost
import
SoftmaxOpCost
from
paddle.distributed.auto_parallel.cost.comp_op_cost
import
SoftmaxGradOpCost
from
paddle.distributed.auto_parallel.cost.comp_op_cost
import
SoftmaxWithCrossEntropyOpCost
from
paddle.distributed.auto_parallel.cost.comp_op_cost
import
SoftmaxWithCrossEntropyGradOpCost
from
paddle.distributed.auto_parallel.cost.comp_op_cost
import
SplitOpCost
from
paddle.distributed.auto_parallel.cost.comp_op_cost
import
Squeeze2OpCost
from
paddle.distributed.auto_parallel.cost.comp_op_cost
import
SquareOpCost
from
paddle.distributed.auto_parallel.cost.comp_op_cost
import
SquareGradOpCost
from
paddle.distributed.auto_parallel.cost.comp_op_cost
import
SumOpCost
from
paddle.distributed.auto_parallel.cost.comp_op_cost
import
TopKOpCost
from
paddle.distributed.auto_parallel.cost.comp_op_cost
import
Transpose2OpCost
from
paddle.distributed.auto_parallel.cost.comp_op_cost
import
Transpose2GradOpCost
from
paddle.distributed.auto_parallel.cost.comp_op_cost
import
Unsqueeze2OpCost
from
paddle.distributed.auto_parallel.cost.comp_op_cost
import
WriteToArrayOpCost
from
test_cluster
import
cluster_json
...
...
@@ -244,6 +273,155 @@ class TestCompOpCost(unittest.TestCase):
self
.
assertTrue
(
op_cost
.
time
>=
0
)
self
.
assertTrue
(
op_cost
.
memory
>=
0
)
op_cost
=
MatmulV2GradOpCost
(
cluster
=
cluster
)
self
.
assertTrue
(
op_cost
.
flops
>=
0
)
self
.
assertTrue
(
op_cost
.
time
>=
0
)
self
.
assertTrue
(
op_cost
.
memory
>=
0
)
op_cost
=
MemcpyOpCost
(
cluster
=
cluster
)
self
.
assertTrue
(
op_cost
.
flops
>=
0
)
self
.
assertTrue
(
op_cost
.
time
>=
0
)
self
.
assertTrue
(
op_cost
.
memory
>=
0
)
op_cost
=
MulOpCost
(
cluster
=
cluster
)
self
.
assertTrue
(
op_cost
.
flops
>=
0
)
self
.
assertTrue
(
op_cost
.
time
>=
0
)
self
.
assertTrue
(
op_cost
.
memory
>=
0
)
op_cost
=
MulGradOpCost
(
cluster
=
cluster
)
self
.
assertTrue
(
op_cost
.
flops
>=
0
)
self
.
assertTrue
(
op_cost
.
time
>=
0
)
self
.
assertTrue
(
op_cost
.
memory
>=
0
)
op_cost
=
OneHotOpCost
(
cluster
=
cluster
)
self
.
assertTrue
(
op_cost
.
flops
>=
0
)
self
.
assertTrue
(
op_cost
.
time
>=
0
)
self
.
assertTrue
(
op_cost
.
memory
>=
0
)
op_cost
=
ReadFromArrayOpCost
(
cluster
=
cluster
)
self
.
assertTrue
(
op_cost
.
flops
>=
0
)
self
.
assertTrue
(
op_cost
.
time
>=
0
)
self
.
assertTrue
(
op_cost
.
memory
>=
0
)
op_cost
=
ReduceSumOpCost
(
cluster
=
cluster
)
self
.
assertTrue
(
op_cost
.
flops
>=
0
)
self
.
assertTrue
(
op_cost
.
time
>=
0
)
self
.
assertTrue
(
op_cost
.
memory
>=
0
)
op_cost
=
ReduceSumGradOpCost
(
cluster
=
cluster
)
self
.
assertTrue
(
op_cost
.
flops
>=
0
)
self
.
assertTrue
(
op_cost
.
time
>=
0
)
self
.
assertTrue
(
op_cost
.
memory
>=
0
)
op_cost
=
Reshape2OpCost
(
cluster
=
cluster
)
self
.
assertTrue
(
op_cost
.
flops
>=
0
)
self
.
assertTrue
(
op_cost
.
time
>=
0
)
self
.
assertTrue
(
op_cost
.
memory
>=
0
)
op_cost
=
MatmulV2OpCost
(
cluster
=
cluster
)
self
.
assertTrue
(
op_cost
.
flops
>=
0
)
self
.
assertTrue
(
op_cost
.
time
>=
0
)
self
.
assertTrue
(
op_cost
.
memory
>=
0
)
op_cost
=
Reshape2GradOpCost
(
cluster
=
cluster
)
self
.
assertTrue
(
op_cost
.
flops
>=
0
)
self
.
assertTrue
(
op_cost
.
time
>=
0
)
self
.
assertTrue
(
op_cost
.
memory
>=
0
)
op_cost
=
ReduceMeanOpCost
(
cluster
=
cluster
)
self
.
assertTrue
(
op_cost
.
flops
>=
0
)
self
.
assertTrue
(
op_cost
.
time
>=
0
)
self
.
assertTrue
(
op_cost
.
memory
>=
0
)
op_cost
=
ReduceMeanGradOpCost
(
cluster
=
cluster
)
self
.
assertTrue
(
op_cost
.
flops
>=
0
)
self
.
assertTrue
(
op_cost
.
time
>=
0
)
self
.
assertTrue
(
op_cost
.
memory
>=
0
)
op_cost
=
SamplingIdOpCost
(
cluster
=
cluster
)
self
.
assertTrue
(
op_cost
.
flops
>=
0
)
self
.
assertTrue
(
op_cost
.
time
>=
0
)
self
.
assertTrue
(
op_cost
.
memory
>=
0
)
op_cost
=
ScaleOpCost
(
cluster
=
cluster
)
self
.
assertTrue
(
op_cost
.
flops
>=
0
)
self
.
assertTrue
(
op_cost
.
time
>=
0
)
self
.
assertTrue
(
op_cost
.
memory
>=
0
)
op_cost
=
SliceOpCost
(
cluster
=
cluster
)
self
.
assertTrue
(
op_cost
.
flops
>=
0
)
self
.
assertTrue
(
op_cost
.
time
>=
0
)
self
.
assertTrue
(
op_cost
.
memory
>=
0
)
op_cost
=
SoftmaxOpCost
(
cluster
=
cluster
)
self
.
assertTrue
(
op_cost
.
flops
>=
0
)
self
.
assertTrue
(
op_cost
.
time
>=
0
)
self
.
assertTrue
(
op_cost
.
memory
>=
0
)
op_cost
=
SoftmaxGradOpCost
(
cluster
=
cluster
)
self
.
assertTrue
(
op_cost
.
flops
>=
0
)
self
.
assertTrue
(
op_cost
.
time
>=
0
)
self
.
assertTrue
(
op_cost
.
memory
>=
0
)
op_cost
=
SoftmaxWithCrossEntropyOpCost
(
cluster
=
cluster
)
self
.
assertTrue
(
op_cost
.
flops
>=
0
)
self
.
assertTrue
(
op_cost
.
time
>=
0
)
self
.
assertTrue
(
op_cost
.
memory
>=
0
)
op_cost
=
SoftmaxWithCrossEntropyGradOpCost
(
cluster
=
cluster
)
self
.
assertTrue
(
op_cost
.
flops
>=
0
)
self
.
assertTrue
(
op_cost
.
time
>=
0
)
self
.
assertTrue
(
op_cost
.
memory
>=
0
)
op_cost
=
SplitOpCost
(
cluster
=
cluster
)
self
.
assertTrue
(
op_cost
.
flops
>=
0
)
self
.
assertTrue
(
op_cost
.
time
>=
0
)
self
.
assertTrue
(
op_cost
.
memory
>=
0
)
op_cost
=
Squeeze2OpCost
(
cluster
=
cluster
)
self
.
assertTrue
(
op_cost
.
flops
>=
0
)
self
.
assertTrue
(
op_cost
.
time
>=
0
)
self
.
assertTrue
(
op_cost
.
memory
>=
0
)
op_cost
=
SquareOpCost
(
cluster
=
cluster
)
self
.
assertTrue
(
op_cost
.
flops
>=
0
)
self
.
assertTrue
(
op_cost
.
time
>=
0
)
self
.
assertTrue
(
op_cost
.
memory
>=
0
)
op_cost
=
SquareGradOpCost
(
cluster
=
cluster
)
self
.
assertTrue
(
op_cost
.
flops
>=
0
)
self
.
assertTrue
(
op_cost
.
time
>=
0
)
self
.
assertTrue
(
op_cost
.
memory
>=
0
)
op_cost
=
SumOpCost
(
cluster
=
cluster
)
self
.
assertTrue
(
op_cost
.
flops
>=
0
)
self
.
assertTrue
(
op_cost
.
time
>=
0
)
self
.
assertTrue
(
op_cost
.
memory
>=
0
)
op_cost
=
TopKOpCost
(
cluster
=
cluster
)
self
.
assertTrue
(
op_cost
.
flops
>=
0
)
self
.
assertTrue
(
op_cost
.
time
>=
0
)
self
.
assertTrue
(
op_cost
.
memory
>=
0
)
op_cost
=
Transpose2OpCost
(
cluster
=
cluster
)
self
.
assertTrue
(
op_cost
.
flops
>=
0
)
self
.
assertTrue
(
op_cost
.
time
>=
0
)
self
.
assertTrue
(
op_cost
.
memory
>=
0
)
op_cost
=
Transpose2GradOpCost
(
cluster
=
cluster
)
self
.
assertTrue
(
op_cost
.
flops
>=
0
)
self
.
assertTrue
(
op_cost
.
time
>=
0
)
self
.
assertTrue
(
op_cost
.
memory
>=
0
)
op_cost
=
Unsqueeze2OpCost
(
cluster
=
cluster
)
self
.
assertTrue
(
op_cost
.
flops
>=
0
)
self
.
assertTrue
(
op_cost
.
time
>=
0
)
self
.
assertTrue
(
op_cost
.
memory
>=
0
)
op_cost
=
WriteToArrayOpCost
(
cluster
=
cluster
)
self
.
assertTrue
(
op_cost
.
flops
>=
0
)
self
.
assertTrue
(
op_cost
.
time
>=
0
)
self
.
assertTrue
(
op_cost
.
memory
>=
0
)
# Remove unnecessary files
if
os
.
path
.
exists
(
cluster_json_path
):
os
.
remove
(
cluster_json_path
)
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录