Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
MegEngine 天元
MegEngine
提交
d62dabe5
MegEngine
项目概览
MegEngine 天元
/
MegEngine
1 年多 前同步成功
通知
404
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看板
提交
d62dabe5
编写于
2月 06, 2021
作者:
M
Megvii Engine Team
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
fix(mgb): fix matmul model compat in flatbuffer
GitOrigin-RevId: 2effad8e5fa8f371bac5b4e28b2110b3a089463e
上级
05692d05
变更
2
隐藏空白更改
内联
并排
Showing
2 changed file
with
7 addition
and
27 deletion
+7
-27
src/opr/impl/blas.oprdecl
src/opr/impl/blas.oprdecl
+2
-19
src/opr/impl/blas.sereg.h
src/opr/impl/blas.sereg.h
+5
-8
未找到文件。
src/opr/impl/blas.oprdecl
浏览文件 @
d62dabe5
...
@@ -13,29 +13,12 @@ decl_opr('BatchedMatrixMul',
...
@@ -13,29 +13,12 @@ decl_opr('BatchedMatrixMul',
'False); then :math:`n` independent matrix multiplications would be '
'False); then :math:`n` independent matrix multiplications would be '
'performed and output shape is (n, a, c)'
)
'performed and output shape is (n, a, c)'
)
decl_opr
(
'MatrixMul'
,
pyname
=
'matrix_mul_v2'
,
inputs
=
[
'opr0'
,
'opr1'
],
params
=
'MatrixMul'
,
desc
=
'matrix multiplication'
,
version
=
2
,
has_out_dtype
=
True
)
decl_opr
(
'BatchedMatrixMul'
,
pyname
=
'batched_matrix_mul_v2'
,
inputs
=
[
'opr0'
,
'opr1'
],
params
=
'MatrixMul'
,
desc
=
'batched matrix multiplication: input shapes should be '
'(n, a, b) and (n, b, c) (assuming transposeA and transeposeB are '
'False); then :math:`n` independent matrix multiplications would be '
'performed and output shape is (n, a, c)'
,
version
=
2
,
has_out_dtype
=
True
)
decl_opr
(
'MatrixMul'
,
decl_opr
(
'MatrixMul'
,
inputs
=
[
'opr0'
,
'opr1'
],
inputs
=
[
'opr0'
,
'opr1'
],
params
=
[(
'param'
,
'MatrixMul'
),
params
=
[(
'param'
,
'MatrixMul'
),
(
'execution_polity'
,
'ExecutionPolicy'
)],
(
'execution_polity'
,
'ExecutionPolicy'
)],
desc
=
'matrix multiplication'
,
desc
=
'matrix multiplication'
,
version
=
3
,
has_out_dtype
=
True
)
version
=
2
,
has_out_dtype
=
True
)
decl_opr
(
'BatchedMatrixMul'
,
decl_opr
(
'BatchedMatrixMul'
,
inputs
=
[
'opr0'
,
'opr1'
],
inputs
=
[
'opr0'
,
'opr1'
],
...
@@ -45,7 +28,7 @@ decl_opr('BatchedMatrixMul',
...
@@ -45,7 +28,7 @@ decl_opr('BatchedMatrixMul',
'(n, a, b) and (n, b, c) (assuming transposeA and transeposeB are '
'(n, a, b) and (n, b, c) (assuming transposeA and transeposeB are '
'False); then :math:`n` independent matrix multiplications would be '
'False); then :math:`n` independent matrix multiplications would be '
'performed and output shape is (n, a, c)'
,
'performed and output shape is (n, a, c)'
,
version
=
3
,
has_out_dtype
=
True
)
version
=
2
,
has_out_dtype
=
True
)
decl_opr
(
'Dot'
,
decl_opr
(
'Dot'
,
inputs
=
[
'opr0'
,
'opr1'
],
inputs
=
[
'opr0'
,
'opr1'
],
...
...
src/opr/impl/blas.sereg.h
浏览文件 @
d62dabe5
...
@@ -51,7 +51,6 @@ struct MatrixMulLoadDumpImpl {
...
@@ -51,7 +51,6 @@ struct MatrixMulLoadDumpImpl {
static
void
dump
(
OprDumpContext
&
ctx
,
const
cg
::
OperatorNodeBase
&
opr_
)
{
static
void
dump
(
OprDumpContext
&
ctx
,
const
cg
::
OperatorNodeBase
&
opr_
)
{
auto
&&
opr
=
opr_
.
cast_final_safe
<
Opr
>
();
auto
&&
opr
=
opr_
.
cast_final_safe
<
Opr
>
();
ctx
.
write_param
<
megdnn
::
param
::
MatrixMul
>
(
opr
.
param
());
ctx
.
write_param
<
megdnn
::
param
::
MatrixMul
>
(
opr
.
param
());
ctx
.
write_param
<
megdnn
::
param
::
ExecutionPolicy
>
(
opr
.
execution_policy
());
}
}
static
VarNode
*
make
(
const
cg
::
VarNodeArray
&
inputs
,
static
VarNode
*
make
(
const
cg
::
VarNodeArray
&
inputs
,
...
@@ -68,9 +67,7 @@ struct MatrixMulLoadDumpImpl {
...
@@ -68,9 +67,7 @@ struct MatrixMulLoadDumpImpl {
const
cg
::
VarNodeArray
&
inputs
,
const
cg
::
VarNodeArray
&
inputs
,
const
OperatorNodeConfig
&
config
)
{
const
OperatorNodeConfig
&
config
)
{
auto
param
=
ctx
.
read_param
<
megdnn
::
param
::
MatrixMul
>
();
auto
param
=
ctx
.
read_param
<
megdnn
::
param
::
MatrixMul
>
();
auto
execution_policy
=
return
make
(
inputs
,
param
,
{},
config
)
->
owner_opr
();
ctx
.
read_param
<
megdnn
::
param
::
ExecutionPolicy
>
();
return
make
(
inputs
,
param
,
execution_policy
,
config
)
->
owner_opr
();
}
}
};
};
...
@@ -90,10 +87,10 @@ struct OprLoadDumpImpl<opr::BatchedMatrixMul, 2>
...
@@ -90,10 +87,10 @@ struct OprLoadDumpImpl<opr::BatchedMatrixMul, 2>
namespace
opr
{
namespace
opr
{
using
MatrixMulV
3
=
MatrixMul
;
using
MatrixMulV
2
=
MatrixMul
;
using
BatchedMatrixMulV
3
=
BatchedMatrixMul
;
using
BatchedMatrixMulV
2
=
BatchedMatrixMul
;
MGB_SEREG_OPR
(
MatrixMulV
3
,
2
);
MGB_SEREG_OPR
(
MatrixMulV
2
,
2
);
MGB_SEREG_OPR
(
BatchedMatrixMulV
3
,
2
);
MGB_SEREG_OPR
(
BatchedMatrixMulV
2
,
2
);
MGB_SEREG_OPR
(
Dot
,
2
);
MGB_SEREG_OPR
(
Dot
,
2
);
MGB_SEREG_OPR
(
MatrixInverse
,
1
);
MGB_SEREG_OPR
(
MatrixInverse
,
1
);
MGB_SEREG_OPR
(
SVD
,
1
);
MGB_SEREG_OPR
(
SVD
,
1
);
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录