Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
MegEngine 天元
MegEngine
提交
6bb6787d
MegEngine
项目概览
MegEngine 天元
/
MegEngine
大约 1 年 前同步成功
通知
399
Star
4705
Fork
582
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
DevOps
流水线
流水线任务
计划
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
MegEngine
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
DevOps
DevOps
流水线
流水线任务
计划
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
流水线任务
提交
Issue看板
体验新版 GitCode,发现更多精彩内容 >>
提交
6bb6787d
编写于
5月 10, 2021
作者:
M
Megvii Engine Team
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
feat(mge): add a tool which can analyze the file generated by compare_binary_iodump.py
GitOrigin-RevId: 9acab0a49f3089723144cc3ff6a70357d59eada9
上级
43ef9748
变更
3
隐藏空白更改
内联
并排
Showing
3 changed file
with
139 addition
and
15 deletion
+139
-15
dnn/src/cuda/cudnn_wrapper.cpp
dnn/src/cuda/cudnn_wrapper.cpp
+1
-1
imperative/python/megengine/tools/accuracy_shake_var_tree.py
imperative/python/megengine/tools/accuracy_shake_var_tree.py
+130
-0
sdk/load-and-run/src/mgblar.cpp
sdk/load-and-run/src/mgblar.cpp
+8
-14
未找到文件。
dnn/src/cuda/cudnn_wrapper.cpp
浏览文件 @
6bb6787d
...
...
@@ -485,7 +485,7 @@ CudnnAlgoPack::conv_bwd_data_algos() {
CudnnAlgoPack
::
Attr
>
algos
=
{
DEF_ALGO
(
CUDNN_CONVOLUTION_BWD_DATA_ALGO_0
,
false
,
false
),
DEF_ALGO
(
CUDNN_CONVOLUTION_BWD_DATA_ALGO_1
,
true
,
fals
e
),
DEF_ALGO
(
CUDNN_CONVOLUTION_BWD_DATA_ALGO_1
,
true
,
tru
e
),
DEF_ALGO
(
CUDNN_CONVOLUTION_BWD_DATA_ALGO_FFT
,
true
,
true
),
DEF_ALGO
(
CUDNN_CONVOLUTION_BWD_DATA_ALGO_FFT_TILING
,
true
,
true
),
#if CUDNN_MAJOR >= 5
...
...
imperative/python/megengine/tools/accuracy_shake_var_tree.py
0 → 100755
浏览文件 @
6bb6787d
#!/usr/bin/env python3
# -*-coding=utf-8-*-
# This tool is used to analyze the file generated by compare_binary_iodump.py.
# parse() can build a dependency tree with those varnodes
# where accuracy shake occurs and show the root varnodes.
# get_varNode()/get_dependence_list()/get_reference_list()/show_src_info()
# are some functions which are used to query dependencies between varnodes.
import
argparse
import
os
class
varNode
:
var_node_dict
=
{}
var_node_root_dict
=
{}
def
__init__
(
self
,
id
,
dependence_list
,
src_info
):
self
.
src_info
=
src_info
if
not
id
in
varNode
.
var_node_dict
.
keys
():
self
.
id
=
id
self
.
dependence_list
=
[]
self
.
reference_list
=
[]
else
:
self
=
varNode
.
var_node_dict
[
id
]
if
dependence_list
:
self
.
vitrual
=
False
self
.
is_root
=
True
else
:
self
.
vitrual
=
True
self
.
is_root
=
False
for
i
in
dependence_list
:
if
not
i
in
varNode
.
var_node_dict
.
keys
():
varNode
.
var_node_dict
[
i
]
=
varNode
(
i
,
[],
""
)
dv
=
varNode
.
var_node_dict
[
i
]
self
.
dependence_list
.
append
(
dv
)
if
not
dv
.
vitrual
:
self
.
is_root
=
False
dv
.
reference_list
.
append
(
self
)
for
i
in
self
.
reference_list
:
i
.
is_root
=
False
varNode
.
var_node_root_dict
.
pop
[
i
.
id
]
if
self
.
is_root
:
varNode
.
var_node_root_dict
[
id
]
=
self
varNode
.
var_node_dict
[
id
]
=
self
@
staticmethod
def
get_varNode
(
id
):
return
varNode
.
var_node_dict
[
id
]
def
get_dependence_list
(
self
):
return
self
.
dependence_list
def
get_reference_list
(
self
):
return
self
.
reference_list
def
show_src_info
(
self
):
print
(
self
.
src_info
)
def
get_dependence
(
string
,
src_info
):
start1
=
"id:"
end1
=
","
e
=
0
count
=
string
.
count
(
start1
)
dependence_list
=
[]
for
x
in
range
(
0
,
count
):
s
=
string
.
find
(
start1
,
e
)
e
=
string
.
find
(
end1
,
s
)
sub_str
=
string
[
s
:
e
]
if
x
==
0
:
var
=
sub_str
else
:
dependence_list
.
append
(
sub_str
)
varNode
(
var
,
dependence_list
,
src_info
)
def
parse
(
filename
):
with
open
(
filename
)
as
f
:
varNode
.
var_node_dict
.
clear
()
varNode
.
var_node_root_dict
.
clear
()
line
=
f
.
readline
()
s
=
[
""
,
""
,
""
]
idx
=
1
while
line
:
if
line
.
find
(
"not equal: "
)
!=
-
1
:
s
[
2
]
=
line
src_info
=
s
[
0
]
+
"
\n
"
+
s
[
1
]
+
"
\n
"
+
s
[
2
]
get_dependence
(
s
[
0
],
src_info
)
else
:
if
line
.
find
(
"var={id:"
)
!=
-
1
:
idx
=
idx
^
1
s
[
idx
]
=
""
s
[
idx
]
=
s
[
idx
]
+
line
.
strip
()
line
=
f
.
readline
()
return
varNode
.
var_node_root_dict
def
main
():
parser
=
argparse
.
ArgumentParser
(
description
=
(
"Analyze the outputs of compare_binary_iodump.py"
"Should save the outputs of compare_binary_iodump.py"
"as a file"
),
formatter_class
=
argparse
.
ArgumentDefaultsHelpFormatter
,
)
parser
.
add_argument
(
"filename"
,
help
=
"file which save the outputs of compare_binary_iodump.py"
)
args
=
parser
.
parse_args
()
parse
(
args
.
filename
)
print
(
"varnode root:"
)
for
key
,
value
in
varNode
.
var_node_root_dict
.
items
():
print
(
key
)
print
(
"detail info:"
)
value
.
show_src_info
()
if
__name__
==
"__main__"
:
main
()
sdk/load-and-run/src/mgblar.cpp
浏览文件 @
6bb6787d
...
...
@@ -701,25 +701,19 @@ void run_test_st(Args &env) {
mgb
::
gopt
::
set_opr_algo_workspace_limit_inplace
(
vars
,
env
.
workspace_limit
);
using
S
=
opr
::
mixin
::
AlgoChooserHelper
::
ExecutionPolicy
::
Strategy
;
S
strategy
=
S
::
HEURISTIC
;
if
(
env
.
reproducible
)
{
strategy
=
S
::
REPRODUCIBLE
;
}
#if MGB_ENABLE_FASTRUN
if
(
env
.
use_full_run
)
{
if
(
env
.
reproducible
)
{
strategy
=
S
::
PROFILE
|
S
::
REPRODUCIBLE
;
}
else
{
strategy
=
S
::
PROFILE
;
}
strategy
=
S
::
PROFILE
|
strategy
;
}
else
if
(
env
.
use_fast_run
)
{
strategy
=
S
::
PROFILE
|
S
::
OPTIMIZED
;
if
(
env
.
reproducible
){
strategy
=
strategy
|
S
::
REPRODUCIBLE
;
}
}
else
if
(
env
.
reproducible
)
{
strategy
=
S
::
HEURISTIC
|
S
::
REPRODUCIBLE
;
strategy
=
S
::
PROFILE
|
S
::
OPTIMIZED
|
strategy
;
}
else
{
strategy
=
S
::
HEURISTIC
|
strategy
;
}
#else
if
(
env
.
reproducible
)
{
strategy
=
S
::
HEURISTIC
|
S
::
REPRODUCIBLE
;
}
strategy
=
S
::
HEURISTIC
|
strategy
;
#endif
mgb
::
gopt
::
modify_opr_algo_strategy_inplace
(
vars
,
strategy
);
if
(
!
env
.
fast_run_cache_path
.
empty
())
{
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录