Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
MegEngine 天元
MegEngine
提交
b9f3077d
MegEngine
项目概览
MegEngine 天元
/
MegEngine
1 年多 前同步成功
通知
403
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看板
提交
b9f3077d
编写于
8月 31, 2020
作者:
M
Megvii Engine Team
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
feat(opr): remove old weight preprocess adapter in fastrun
GitOrigin-RevId: f467c0db80b1f917228cbc2e5e9594ee0a00bef5
上级
75eebb7c
变更
1
隐藏空白更改
内联
并排
Showing
1 changed file
with
0 addition
and
68 deletion
+0
-68
src/opr/impl/dnn/convolution.cpp
src/opr/impl/dnn/convolution.cpp
+0
-68
未找到文件。
src/opr/impl/dnn/convolution.cpp
浏览文件 @
b9f3077d
...
...
@@ -550,16 +550,6 @@ class AlgoChooser {
ImplAlgo
algo
,
double
&
timeout
)
const
;
private:
/*!
* \brief modify param passed to prof_impl by weights preprcess.
*
* \param param: param passed.
*
* \warning invoke when is_weights_persistent is true.
*/
void
modify_param_with_weights_preprocessed
(
typename
TimedProfiler
<
Opr
>::
Param
&
param
)
const
{}
Maybe
<
PreprocessFilter
<
Opr
>>
construct_fake_preprocess_filter
()
const
{
Maybe
<
PreprocessFilter
<
Opr
>>
result
=
None
;
if_constexpr
<
opr_supports_preprocess
<
Opr
>
()
>
([
&
](
auto
_
)
{
...
...
@@ -778,60 +768,6 @@ typename AlgoChooser<Opr>::ImplAlgo AlgoChooser<Opr>::choose_by_profile(
MIDOUT_E
}
template
<
>
void
AlgoChooser
<
megdnn
::
ConvBias
>::
ExeContext
::
modify_param_with_weights_preprocessed
(
typename
TimedProfiler
<
megdnn
::
ConvBias
>::
Param
&
param
)
const
{
if
(
param
.
opr_param
.
format
==
megdnn
::
ConvBias
::
Param
::
Format
::
NCHW
||
param
.
opr_param
.
format
==
megdnn
::
ConvBias
::
Param
::
Format
::
NCHW44
||
param
.
opr_param
.
format
==
megdnn
::
ConvBias
::
Param
::
Format
::
NCHW88
)
{
auto
winograd_param
=
megdnn
::
ConvBias
::
parse_winograd_name
(
param
.
algo_name
);
if
(
winograd_param
==
megdnn
::
ConvBias
::
INVALID_WINOGRAD_PARAM
)
{
return
;
}
ConvBiasForward
::
check_winograd_param_valid
(
winograd_param
,
m_layouts
[
1
].
dtype
);
auto
winograd_preprocess_opr
=
intl
::
create_megdnn_opr
<
megdnn
::
WinogradFilterPreprocess
>
(
m_mgb_opr
->
output
(
0
)
->
comp_node
());
winograd_preprocess_opr
->
param
().
format
=
ConvBiasForward
::
get_matmul_format
(
winograd_param
);
winograd_preprocess_opr
->
param
().
output_block_size
=
winograd_param
.
output_block_size
;
//! When filter input is qint8 and Matmul format is MK4, the winograd
//! compute type is float
if
(
m_layouts
[
1
].
dtype
.
enumv
()
==
DTypeEnum
::
QuantizedS8
&&
param
.
opr_param
.
format
==
megdnn
::
ConvBias
::
Param
::
Format
::
NCHW44
)
{
if
(
winograd_preprocess_opr
->
param
().
format
==
megdnn
::
param
::
MatrixMul
::
Format
::
MK4
)
{
winograd_preprocess_opr
->
param
().
compute_mode
=
ConvBias
::
Param
::
ComputeMode
::
FLOAT32
;
param
.
opr_param
.
compute_mode
=
ConvBias
::
Param
::
ComputeMode
::
FLOAT32
;
}
}
TensorLayout
filter_transform_layout
;
winograd_preprocess_opr
->
deduce_layout
(
m_layouts
[
1
],
filter_transform_layout
);
param
.
shapes
[
1
]
=
filter_transform_layout
;
param
.
dtypes
[
1
]
=
filter_transform_layout
.
dtype
.
enumv
();
if
(
param
.
opr_param
.
format
==
megdnn
::
ConvBias
::
Param
::
Format
::
NCHW
)
{
param
.
opr_param
.
format
=
megdnn
::
ConvBias
::
Param
::
Format
::
NCHW_WINOGRAD
;
}
else
if
(
param
.
opr_param
.
format
==
megdnn
::
ConvBias
::
Param
::
Format
::
NCHW44
)
{
param
.
opr_param
.
format
=
megdnn
::
ConvBias
::
Param
::
Format
::
NCHW44_WINOGRAD
;
}
else
if
(
param
.
opr_param
.
format
==
megdnn
::
ConvBias
::
Param
::
Format
::
NCHW88
)
{
param
.
opr_param
.
format
=
megdnn
::
ConvBias
::
Param
::
Format
::
NCHW88_WINOGRAD
;
}
param
.
opr_param
.
output_block_size
=
winograd_param
.
output_block_size
;
}
}
template
<
typename
Opr
>
Maybe
<
AlgoChooserProfileCache
::
ResultEntry
>
AlgoChooser
<
Opr
>::
ExeContext
::
profile_single_algo
(
ImplAlgo
algo
,
...
...
@@ -862,10 +798,6 @@ AlgoChooser<Opr>::ExeContext::profile_single_algo(ImplAlgo algo,
param
.
opr_param
=
m_megdnn_opr
->
param
();
param
.
allow_weight_preprocess
=
m_allow_weight_preprocess
;
if
(
m_allow_weight_preprocess
)
{
modify_param_with_weights_preprocessed
(
param
);
}
auto
rst
=
TimedProfiler
<
Opr
>::
profile
(
param
,
timeout
);
// MIOpen conv profiles all available algos when a specfic shape is
// provided for the first time, which probably adds to the result time.
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录