Commit Graph

4 Commits

Author SHA1 Message Date
Tung D. Le dbe0d734b5
Call LLVM opt to optimize bitcode (#245)
* Call LLVM opt to optimize bitcode

* Rename variables
2020-08-03 11:46:21 +08:00
gongsu832 d235f248e4
Add emitjni target (#204)
* Detect llvm-project commit change in utils/clone-mlir.sh and rebuild llvm-project
for zLinux Jenkins build bot

* Add --EmitJNI target (tested working with mnist and resnet50)
- MainUtils
  * first shot at refactoring compileModuleToSharedLibrary
  * add setExecPath call to allow resolving runtime directory from onnx-mlir
    executable path when ONNX_MLIR_RUNTIME_DIR is not set. This allows
    tests to run without having to install onnx-mlir or to explicitly set
    ONNX_MLIR_RUNTIME_DIR
- RtMemRef
  * add getDataSize for C (equivalent of size() for C++).
  * fix setStrides bug (setting sizes, not strides)
- TestConv
  * _main_graph-*.so were filling up /tmp. Change to use fixed shared library
    in build directory

* Fix clang-format-lint complaints

* - getRuntimeDir checks lib64
- install targets for javaruntime and jniruntime
- remove ONNX_MLIR_LD_PRELOAD_onnx-mlir and ONNX_MLIR_LD_PRELOAD_onnx-mlir-opt

* See what happens when `kExecPath` decl is dropped.

Co-authored-by: Tian Jin <tjingrant@gmail.com>
2020-07-11 13:23:13 +08:00
Tian Jin e0ae583da0
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
Tian Jin 4cdc0873ca
Call llc, ld from within onnx-mlir. (#127)
* Call llc, ld from within onnx-mlir.

* Rename EmitLLVMBC -> EmitLib., reorder header files

* Edit comment.

Co-authored-by: Gheorghe-Teodor Bercea <gt.bercea@gmail.com>
2020-05-19 10:15:48 +08:00