Exclude unreferenced global data and op doc strings in the opschema object. The first causes a decrease in the binary size by at least 85k. The latter reduces resident memory size. (#823)

* Exclude unreferenced global data and op doc strings in the opschema object. The first causes a decrease in the binary size by at least 85k. The latter reduces resident memory size.

* Update onnx to incorporate my PR that fixes SetDoc compiler warnings
This commit is contained in:
Pranav Sharma 2019-04-15 15:57:19 -07:00 committed by GitHub
parent e999af61b2
commit 4b4a359943
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
5 changed files with 13 additions and 7 deletions

View file

@ -49,7 +49,7 @@
"component":{
"type":"git",
"git":{
"commitHash":"7a112a6f930aac375da5a38d744ccda93e37632c",
"commitHash":"a80c3371a6514bd11664249e59cae958f45b3b59",
"repositoryUrl":"https://github.com/onnx/onnx.git"
}
}

View file

@ -148,8 +148,8 @@ if (MSVC)
#Disable 4100 globally. Too many this kind errors in protobuf
SET (CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} /wd4100")
if (NOT onnxruntime_USE_CUDA)
SET (CMAKE_CXX_FLAGS_RELEASE "${CMAKE_CXX_FLAGS_RELEASE} /GL")
SET (CMAKE_CXX_FLAGS_RELWITHDEBINFO "${CMAKE_CXX_FLAGS_RELWITHDEBINFO} /GL")
SET (CMAKE_CXX_FLAGS_RELEASE "${CMAKE_CXX_FLAGS_RELEASE} /Gw /GL")
SET (CMAKE_CXX_FLAGS_RELWITHDEBINFO "${CMAKE_CXX_FLAGS_RELWITHDEBINFO} /Gw /GL")
endif()
check_cxx_compiler_flag(-Qspectre HAS_QSPECTRE)
if (HAS_QSPECTRE)

2
cmake/external/onnx vendored

@ -1 +1 @@
Subproject commit 7a112a6f930aac375da5a38d744ccda93e37632c
Subproject commit a80c3371a6514bd11664249e59cae958f45b3b59

View file

@ -24,6 +24,11 @@ file(GLOB_RECURSE onnx_exclude_src
"${ONNX_SOURCE_ROOT}/onnx/cpp2py_export.cc"
)
if (MSVC)
SET (CMAKE_CXX_FLAGS_RELEASE "${CMAKE_CXX_FLAGS_RELEASE} /Gw /GL")
SET (CMAKE_CXX_FLAGS_RELWITHDEBINFO "${CMAKE_CXX_FLAGS_RELWITHDEBINFO} /Gw /GL")
endif()
list(REMOVE_ITEM onnx_src ${onnx_exclude_src})
add_library(onnx ${onnx_src})
add_dependencies(onnx onnx_proto)
@ -33,7 +38,7 @@ target_compile_definitions(onnx PUBLIC $<TARGET_PROPERTY:onnx_proto,INTERFACE_CO
if (onnxruntime_USE_FULL_PROTOBUF)
target_compile_definitions(onnx PUBLIC "ONNX_ML" "ONNX_NAMESPACE=onnx")
else()
target_compile_definitions(onnx PUBLIC "ONNX_ML" "ONNX_NAMESPACE=onnx" "ONNX_USE_LITE_PROTO")
target_compile_definitions(onnx PUBLIC "ONNX_ML" "ONNX_NAMESPACE=onnx" "ONNX_USE_LITE_PROTO" "__ONNX_NO_DOC_STRINGS")
endif()
if (WIN32)
target_compile_options(onnx PRIVATE

View file

@ -38,8 +38,9 @@ else
#5af210ca8a1c73aa6bae8754c9346ec54d0a756e is v1.2.3
#bae6333e149a59a3faa9c4d9c44974373dcf5256 is v1.3.0
#9e55ace55aad1ada27516038dfbdc66a8a0763db is v1.4.1
#7a112a6f930aac375da5a38d744ccda93e37632c" is v1.4.1 latest
for onnx_version in "5af210ca8a1c73aa6bae8754c9346ec54d0a756e" "bae6333e149a59a3faa9c4d9c44974373dcf5256" "9e55ace55aad1ada27516038dfbdc66a8a0763db" "7a112a6f930aac375da5a38d744ccda93e37632c" ; do
#7a112a6f930aac375da5a38d744ccda93e37632c" is v1.4.1
#a80c3371a6514bd11664249e59cae958f45b3b59 latest
for onnx_version in "5af210ca8a1c73aa6bae8754c9346ec54d0a756e" "bae6333e149a59a3faa9c4d9c44974373dcf5256" "9e55ace55aad1ada27516038dfbdc66a8a0763db" "7a112a6f930aac375da5a38d744ccda93e37632c" "a80c3371a6514bd11664249e59cae958f45b3b59"; do
if [ -z ${lastest_onnx_version+x} ]; then
echo "first pass";
else