Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
MegEngine 天元
MegEngine
提交
0c3699ff
MegEngine
项目概览
MegEngine 天元
/
MegEngine
大约 1 年 前同步成功
通知
394
Star
4704
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,发现更多精彩内容 >>
提交
0c3699ff
编写于
11月 01, 2021
作者:
M
Megvii Engine Team
提交者:
XindaH
12月 16, 2021
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
test(imperative/python): fix testcase for magicmind runtime module
GitOrigin-RevId: baf2f72f01f05e87cbfe181c879785e7d24d6d1e
上级
f398c8e6
变更
4
隐藏空白更改
内联
并排
Showing
4 changed file
with
9 addition
and
5 deletion
+9
-5
.gitattributes
.gitattributes
+1
-0
imperative/python/megengine/module/external.py
imperative/python/megengine/module/external.py
+2
-3
src/cambricon/impl/magicmind_runtime_opr.cpp
src/cambricon/impl/magicmind_runtime_opr.cpp
+2
-2
src/core/impl/comp_node_env.cpp
src/core/impl/comp_node_env.cpp
+4
-0
未找到文件。
.gitattributes
浏览文件 @
0c3699ff
...
...
@@ -20,3 +20,4 @@ ci/resource/dump/batch_conv_bias_with_policy_8.8.0.mdl filter=lfs diff=lfs merge
ci/resource/prof/model_with_err_assert.mdl filter=lfs diff=lfs merge=lfs -text
ci/resource/prof/test_mge.mge filter=lfs diff=lfs merge=lfs -text
lite/test/resource/lite/ax_models/64-58063ce2.axe filter=lfs diff=lfs merge=lfs -text
imperative/python/test/unit/module/MagicMindRuntimeOprTest.GraphShapeMutable.mlu filter=lfs diff=lfs merge=lfs -text
imperative/python/megengine/module/external.py
浏览文件 @
0c3699ff
...
...
@@ -13,6 +13,7 @@ from ..functional.external import (
atlas_runtime_opr
,
cambricon_runtime_opr
,
extern_opr_subgraph
,
magicmind_runtime_opr
,
tensorrt_runtime_opr
,
)
from
.module
import
Module
...
...
@@ -131,6 +132,7 @@ class AtlasRuntimeSubgraph(Module):
def
forward
(
self
,
*
inputs
):
return
atlas_runtime_opr
(
inputs
,
data
=
self
.
_data
)
class
MagicMindRuntimeSubgraph
(
Module
):
r
"""Load a serialized MagicMindRuntime subgraph.
...
...
@@ -151,6 +153,3 @@ class MagicMindRuntimeSubgraph(Module):
def
forward
(
self
,
*
inputs
):
return
magicmind_runtime_opr
(
inputs
,
data
=
self
.
_data
)
src/cambricon/impl/magicmind_runtime_opr.cpp
浏览文件 @
0c3699ff
...
...
@@ -267,7 +267,7 @@ void MagicMindRuntimeOpr::get_output_var_shape(
mgb_assert
(
tensor
!=
nullptr
,
"failed to find input tensor(name:%s)"
,
iname
.
c_str
());
MM_CHECK
(
tensor
->
SetDimensions
(
mgb_shape_to_mm_dims
(
inp
ut
(
i
)
->
shape
()
)));
MM_CHECK
(
tensor
->
SetDimensions
(
mgb_shape_to_mm_dims
(
inp
_shape
[
i
]
)));
}
if
(
Status
::
OK
()
==
m_context
->
InferOutputShape
(
inputs
,
outputs
))
{
size_t
nr_outputs
=
output
().
size
();
...
...
@@ -283,7 +283,7 @@ void MagicMindRuntimeOpr::get_output_var_shape(
}
std
::
vector
<
Dims
>
shape
(
inp_shape
.
size
());
for
(
size_t
i
=
0
;
i
<
nr_inputs
;
++
i
)
{
shape
[
i
]
=
mgb_shape_to_mm_dims
(
inp
ut
(
i
)
->
shape
()
);
shape
[
i
]
=
mgb_shape_to_mm_dims
(
inp
_shape
[
i
]
);
}
size_t
wk_size
=
0
;
MM_CHECK
(
m_engine
->
QueryContextMaxWorkspaceSize
(
shape
,
&
wk_size
));
...
...
src/core/impl/comp_node_env.cpp
浏览文件 @
0c3699ff
...
...
@@ -390,7 +390,11 @@ void CompNodeEnv::init_cnrt(
MGB_CNRT_CHECK
(
cnrtGetDeviceInfo
(
&
m_cnrt_env
.
device_info
,
dev
));
// FIXME: doc doesn't describe the aligment requirement for device memory
// address
#if CNRT_MAJOR_VERSION >= 5
m_property
.
mem_alignment
=
256u
;
#else
m_property
.
mem_alignment
=
1u
;
#endif
// ensure exception safe
bool
queue_created
=
false
;
MGB_MARK_USED_VAR
(
queue_created
);
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录