Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
MegEngine 天元
MegEngine
提交
e7587617
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看板
提交
e7587617
编写于
6月 14, 2022
作者:
M
Megvii Engine Team
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
fix(lite): fix packed model compatibility
GitOrigin-RevId: 47976477d101fc3f931637449f3ff818a59340b5
上级
a0a5fcf1
变更
3
隐藏空白更改
内联
并排
Showing
3 changed file
with
24 addition
and
10 deletion
+24
-10
lite/CMakeLists.txt
lite/CMakeLists.txt
+4
-4
lite/load_and_run/CMakeLists.txt
lite/load_and_run/CMakeLists.txt
+6
-6
lite/src/pack_model/pack_model.cpp
lite/src/pack_model/pack_model.cpp
+14
-0
未找到文件。
lite/CMakeLists.txt
浏览文件 @
e7587617
...
...
@@ -36,8 +36,8 @@ install(FILES ${CMAKE_CURRENT_BINARY_DIR}/genfiles/lite_build_config.h
# begin config lite
if
(
LITE_BUILD_WITH_MGE
AND
LITE_WITH_CUDA
AND NOT
WIN32
)
AND
NOT WIN32
AND NOT
APPLE
)
# FXIME third_party cpp redis do not support build with clang-cl
list
(
APPEND SOURCES_LITE
${
CPP_REDIS_SRCS
}
)
endif
()
...
...
@@ -129,8 +129,8 @@ if(LITE_BUILD_WITH_MGE AND NOT WIN32)
endif
()
if
(
LITE_BUILD_WITH_MGE
AND
LITE_WITH_CUDA
AND NOT
WIN32
)
AND
NOT WIN32
AND NOT
APPLE
)
# FXIME third_party cpp redis do not support build with clang-cl
target_include_directories
(
lite_static PRIVATE
${
CPP_REDIS_INCLUDES
}
)
target_include_directories
(
lite_shared PRIVATE
${
CPP_REDIS_INCLUDES
}
)
...
...
lite/load_and_run/CMakeLists.txt
浏览文件 @
e7587617
...
...
@@ -31,8 +31,8 @@ if(UNIX)
endif
()
if
(
LITE_BUILD_WITH_MGE
AND
LITE_WITH_CUDA
AND NOT
WIN32
)
AND
NOT WIN32
AND NOT
APPLE
)
# FXIME third_party cpp redis do not support build with clang-cl
target_include_directories
(
load_and_run PRIVATE
${
CPP_REDIS_INCLUDES
}
)
endif
()
...
...
@@ -43,8 +43,8 @@ install(
RUNTIME DESTINATION
${
CMAKE_INSTALL_BINDIR
}
)
if
(
BUILD_SHARED_LIBS
)
if
(
LITE_BUILD_WITH_MGE
AND
LITE_WITH_CUDA
AND NOT
WIN32
)
AND
NOT WIN32
AND NOT
APPLE
)
# FXIME third_party cpp redis do not support build with clang-cl
list
(
APPEND SOURCES
${
CPP_REDIS_SRCS
}
)
endif
()
...
...
@@ -72,8 +72,8 @@ if(BUILD_SHARED_LIBS)
endif
()
if
(
LITE_BUILD_WITH_MGE
AND
LITE_WITH_CUDA
AND NOT
WIN32
)
AND
NOT WIN32
AND NOT
APPLE
)
# FXIME third_party cpp redis do not support build with clang-cl
target_include_directories
(
load_and_run_depends_shared
PRIVATE
${
CPP_REDIS_INCLUDES
}
)
...
...
lite/src/pack_model/pack_model.cpp
浏览文件 @
e7587617
...
...
@@ -2,6 +2,7 @@
#include "../misc.h"
#if LITE_BUILD_WITH_MGE
#include "megbrain/utils/infile_persistent_cache.h"
#include "megbrain/utils/json.h"
#endif
#include <flatbuffers/flatbuffers.h>
...
...
@@ -127,6 +128,19 @@ flatbuffers::Offset<ModelInfo> FbsHelper::build_info() {
fb_data
=
m_builder
.
CreateVector
(
data
,
size
);
}
else
if
(
!
m_packer
->
m_info_data
.
empty
())
{
fb_data
=
m_builder
.
CreateVector
(
m_packer
->
m_info_data
);
}
else
{
//! set info->data() to non-null to avoid load_and_run parse model compatibility
//! issue
std
::
string
default_data
;
#if MGB_ENABLE_JSON
std
::
vector
<
std
::
pair
<
mgb
::
json
::
String
,
std
::
shared_ptr
<
mgb
::
json
::
Value
>>>
info
;
info
.
push_back
({
mgb
::
json
::
String
(
"valid"
),
mgb
::
json
::
Bool
::
make
(
false
)});
auto
obj
=
mgb
::
json
::
Object
::
make
(
info
);
default_data
=
obj
->
to_string
();
#endif
std
::
vector
<
uint8_t
>
json_info
(
default_data
.
begin
(),
default_data
.
end
());
fb_data
=
m_builder
.
CreateVector
(
json_info
);
}
flatbuffers
::
Offset
<
flatbuffers
::
Vector
<
uint8_t
>>
fb_algo_policy
;
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录