2020-03-19 16:48:09 +08:00
|
|
|
add_subdirectory(Interface)
|
2020-03-20 22:40:51 +08:00
|
|
|
add_subdirectory(Dialect)
|
|
|
|
add_subdirectory(Conversion)
|
2020-03-19 16:48:09 +08:00
|
|
|
add_subdirectory(Transform)
|
|
|
|
add_subdirectory(Builder)
|
|
|
|
add_subdirectory(Runtime)
|
2019-12-23 13:13:52 +08:00
|
|
|
|
2020-06-19 00:21:27 +08:00
|
|
|
# All ONNX-MLIR libraries.
|
|
|
|
set(OMLibs
|
|
|
|
OMBuilder
|
|
|
|
OMKrnlOps
|
|
|
|
OMONNXOps
|
|
|
|
OMKrnlToAffine
|
|
|
|
OMKrnlToLLVM
|
|
|
|
OMONNXToKrnl
|
|
|
|
OMONNXRewrite
|
|
|
|
OMShapeInference
|
|
|
|
OMShapeInferenceOpInterface
|
|
|
|
OMAttributePromotion
|
|
|
|
OMPromotableConstOperandsOpInterface
|
|
|
|
OMResultTypeInferenceOpInterface
|
|
|
|
OMElideConstants
|
|
|
|
OMElideKrnlGlobalConstants
|
|
|
|
OMPackKrnlGlobalConstants
|
2020-07-09 00:35:31 +08:00
|
|
|
OMEnableMemoryPool
|
|
|
|
OMBundleMemoryPools)
|
2020-06-19 00:21:27 +08:00
|
|
|
set(OMLibs ${OMLibs} PARENT_SCOPE)
|
|
|
|
|
|
|
|
add_subdirectory(Tool)
|
|
|
|
|
2020-06-08 10:18:55 +08:00
|
|
|
add_library(MainUtils
|
2020-03-25 01:48:54 +08:00
|
|
|
MainUtils.hpp
|
2020-06-08 10:18:55 +08:00
|
|
|
MainUtils.cpp)
|
2020-06-19 00:21:27 +08:00
|
|
|
target_link_libraries(MainUtils
|
|
|
|
${OMLibs}
|
|
|
|
${MLIRLibs}
|
|
|
|
${CMAKE_DL_LIBS}
|
|
|
|
onnx)
|
2020-06-08 10:18:55 +08:00
|
|
|
|
|
|
|
target_include_directories(MainUtils PRIVATE ${ONNX_MLIR_SRC_ROOT})
|
|
|
|
target_include_directories(MainUtils PRIVATE ${CMAKE_BINARY_DIR})
|
|
|
|
target_include_directories(MainUtils PRIVATE ${ONNX_MLIR_BIN_ROOT})
|
|
|
|
|
|
|
|
add_executable(onnx-mlir
|
2020-03-25 01:48:54 +08:00
|
|
|
main.cpp)
|
2020-06-08 10:18:55 +08:00
|
|
|
target_link_libraries(onnx-mlir MainUtils)
|
2020-04-14 17:40:05 +08:00
|
|
|
|
2020-05-19 10:15:48 +08:00
|
|
|
# Locate llc, which is needed for translating LLVM bitcode
|
|
|
|
# to object file.
|
|
|
|
if(NOT EXISTS "${LLVM_PROJ_BUILD}/bin/llc")
|
|
|
|
message(ERROR "Cannot find llc.")
|
|
|
|
endif()
|
|
|
|
|
|
|
|
configure_file(${CMAKE_CURRENT_SOURCE_DIR}/ExternalUtil.hpp.in
|
|
|
|
${CMAKE_CURRENT_BINARY_DIR}/ExternalUtil.hpp)
|
|
|
|
|
2020-04-14 17:40:05 +08:00
|
|
|
# Libraries specified on the target_link_libraries for the add_subdirectory
|
|
|
|
# targets get added to the end of the list here. This creates two problems:
|
|
|
|
# 1. It produces duplicated libraries being specified for the link command.
|
|
|
|
# 2. The libraries added at the end may depend on other libraries thus
|
|
|
|
# cause linkage errors due to undefined symbols.
|
|
|
|
# So it's better not to use target_link_libraries for the add_subdirectory
|
|
|
|
# targets, or only use it for libraries that have no further dependencies
|
|
|
|
# (except system libraries such as libc).
|
2020-06-09 10:38:32 +08:00
|
|
|
add_dependencies(onnx-mlir OMKrnlOpsInc OMONNXOpsInc)
|
2019-12-21 14:58:23 +08:00
|
|
|
|
Compiling Models with Large Constant Arrays (#146)
* PoC works.
* MNist works.
* Clean up.
* Fix test.
* Make Linux work.
* Use consistent symbol name.
* Fix variable name.
* Fix array addr access.
* Bug fix.
* Bug fix.
* install before running e2e tests.
* Fix build config.
* Use sudo when installing.
* Make embeddedDataLoader position independent.
* Enable ResNet50.
* Format code.
* Format MainUtil.
* Try not using sudo to install.
* Supply runtime dir via environment variable.
* Dump problematic operation.
* Dump entire function.
* Debug.
* Dump input.
* Dump constant op.
* Debug.
* Debug.
* Debug.
* Print to stderr.
* take care of endianness.
* Use endianness-aware execution session.
* Fix ZLinux error.
* Include warning when desired output endianness can't be deduced.
* Remove debug code.
* Remove debug code in shape inference.
* Support binary-decoder for testing constants packing.
* Support filename, move-to-file, elision-threshold configurations in constant packing pass for easy testing.
* Add lit test, fix lit test type mismatch.
* Add more consts packing tests.
* Ensure intermediate files are properly cleaned up.
* No need for constant elimination.
* Link with threading libraries.
* Remove debug code.
* Format code.
* More tests.
* test nit.
* Remove debug code.
* Reduce hard-coded constants.
* Use temporary and unique working directory for hosting model parameters.
* Test if it works.
* Try to find objcopy.
* Rename symbols using objcopy.
* Move sanitized name to linux section.
* Use verbose mode for debugging.
* Disambiguate pass constructor.
* Fix symbol name.
* Use Command API to build and execute commands.
* Move linux to use Command API.
* Fix reset args.
* Execute redefine sym.
* Format code.
* Do not use verbose mode for CircleCI.
* Remove debug code.
* Prettify code, add comments.
* getSegmentData -> getEmbeddedConstPool
* vector -> std::vector.
* Make sure we properly clean up intermediate files.
* Fix test cases.
* Add runtime directory.
* Trigger rebuild.
* [Merge with master] fix debug script.
* Diable affine fusion pass for now.
* Support generic fallback const packing mechanism.
* Remove debug code.
* Handle the case where objcopy is not available.
* Fix Windows missing types.
* Support int64.
* Copy packed constant to a local directory for non-Linux/Mac platforms.
* Nit: remove debug code, refactor const pack preprocessing out as a separate function.
* Cannot make preprocessConstPack a standalone function because file removers are stack-allocated, and they are deallocated prematurely when function stack gets popped, deleteing intermediate files too early.
* Don't require executable filename.
* Import ONNX data types directly.
* Fix LIT test.
* Bug fix, use moved string value.
* Remove redundant filenames.
* Fix CMake script.
* Embed endianness information as a symbol, and check during runtime.
* More comments, update lit tests.
* Fix lit test on BE machine.
* Copyright notices.
2020-06-12 10:27:05 +08:00
|
|
|
add_dependencies(onnx-mlir cruntime)
|
|
|
|
add_dependencies(onnx-mlir EmbeddedDataLoader)
|
|
|
|
|
2020-03-21 00:04:22 +08:00
|
|
|
target_include_directories(onnx-mlir PRIVATE ${ONNX_MLIR_SRC_ROOT})
|
2020-03-17 21:16:33 +08:00
|
|
|
target_include_directories(onnx-mlir PRIVATE ${CMAKE_BINARY_DIR})
|
2020-03-21 00:04:22 +08:00
|
|
|
target_include_directories(onnx-mlir PRIVATE ${ONNX_MLIR_BIN_ROOT})
|
2019-11-12 10:31:56 +08:00
|
|
|
|
2020-03-17 21:16:33 +08:00
|
|
|
install(TARGETS onnx-mlir DESTINATION bin)
|