* NFC: Attribute cleanup (remove references of attributes) (#286)
* Define krnl.permute op.
* Support krnl.permute operation.
* Properly remove loop references.
* Re-push, Github was down.
* Need to debug interpretOp error.
* Fix lowering bug by erasing ops after full krnl IR interpretation is done, and clean up & comment code.
* Introduce permute, unroll operations.
* More debug.
* Remove std::set.
* krnl.terminate fails to be converted.
* Pass all tests, need to add legal ops as well as part of the conversion target.
* Change test format to new permute spec.
* Bug fix for nested iterate op lowering.
* Simplify error reporting.
* Fix compilation error.
* Increase comments coverage.
* Remove unnecessary imports.
* Re-trigger Jenkins
* Add permute/unroll tests.
* Retrigger Jenkins
* remove & (ref) for Attributes
Co-authored-by: Tian Jin <tjingrant@gmail.com>
Signed-off-by: Kevin O'Brien <caomhin@us.ibm.com>
* Syntax highlighting for mlir code in README (#276)
* Syntax highlighting for mlir code in README
* Restart Jenkins
Co-authored-by: Gheorghe-Teodor Bercea <gt.bercea@gmail.com>
Co-authored-by: Alexandre Eichenberger <alexe@us.ibm.com>
Co-authored-by: Tian Jin <tjingrant@gmail.com>
Signed-off-by: Kevin O'Brien <caomhin@us.ibm.com>
* use print not dump
Signed-off-by: Kevin O'Brien <caomhin@us.ibm.com>
* add semicolon
Signed-off-by: Kevin O'Brien <caomhin@us.ibm.com>
* syntax
Signed-off-by: Kevin O'Brien <caomhin@us.ibm.com>
* add code to preserve locations
Signed-off-by: Kevin O'Brien <caomhin@us.ibm.com>
* format
Signed-off-by: Kevin O'Brien <caomhin@us.ibm.com>
* Emit the dynamic memory pool (#290)
* Reorganize main function.
* Follow review comments.
* Emit constants are globals in Krnl and LLVM dialects.
* Add support for bundling dynamic memory pools.
* Add dynamic bundling.
* Clean-up code.
* Clean-up file.
* Add test for bundling dynamic memory pool.
* Fixes. Simplify data structure. Add mixed test.
* Remove unused import.
Signed-off-by: Kevin O'Brien <caomhin@us.ibm.com>
* Fix wrong type for llvm::loadop (#293)
Signed-off-by: Kevin O'Brien <caomhin@us.ibm.com>
* Update llvm commit ID to 1d01fc1 (#292)
* Fix for LLVM revision D85495
* Fix for LLVM revision DD86121
* Fix for LLVM revision D85622 (f9dc2b7)
TODO: Change preloadDialectsInContext to false
Memo for previous fixes: D86121 (250f43d), D85495 (575b22b)
* clang-format
* Update llvm commit ID of README and clone-mlir.sh
* Updated llvm commit ID of README.md
* Fix for passing backend tests
* Removed the commented code
* Empty commit for triggering rebuild
* Test multi-stage travis build
* Specify stage order.
* Empty commit for triggering rebuild
* Update prereq.s390x.Dockerfile
Make it possible to execute s390x prereq docker multiple times.
* Build prereq for each arch
* Fix multi-arch prereq build.
* timeout at 40m
* Update .travis.yml
* add ppc64le prereq builder
* Run ppc docker prereq build multiple times
* Do not test branch update unless it's mater.
* Fix dockerfile.
* Fix typo in travis.yml.
* Fix ppc64 docker file
* Update .travis.yml
* turn off metacopy on ppc64le
* Update .travis.yml
* Turn off metacopy.
* Turn off metacopy inside Dockerfile in ppc64.
* No sudo in Docker.
* Remove metacopy config from Dockerfile.
* Change base image to be bionic.
* Using newer linux distro for ppc64.
* Turn off metacopy in before_install.
* Fix sudo permission issue.
* Run docker info.
* Allow amd64 docker file to be built multiple times
* Support building amd64 prereq.
* Fix amd64 docker file typo.
* fix ppc64le dockerfile typo.
* timeout from 40m -> 30m
* 40m->30m
* 40m->30m
* fix bug preventing incremental build.
* fix bug preventing incremental build.
* Bump CircleCI cache version.
* Push to production prereq container repository and condition prereq docker rebuild on commit message.
* Rebuild prereq docker.
* Move default script to top-level.
* Python not properly installed.
* amd64 -> x86
* Rebuild prereq docker.
* Rebuild prereq docker.
* Rebuild prereq docker.
* Restart all CI.
* Disallow cache on Jenkins docker build.
* Restart zJenkins.
* Restart zJenkins.
Co-authored-by: Haruki Imai <imaihal@jp.ibm.com>
Co-authored-by: Alexandre Eichenberger <alexe@us.ibm.com>
Signed-off-by: Kevin O'Brien <caomhin@us.ibm.com>
* Using onnx-mlir through incremental stages (#257)
* Add lowering of Vector dialect for lower-all-llvm pass
* Fix generating CallOp instructions when return type is void
* Fix lowering of memref
* Reformat using clang-format
* Record more context.
* Reflow comments.
Co-authored-by: Tian Jin <tjingrant@gmail.com>
Signed-off-by: Kevin O'Brien <caomhin@us.ibm.com>
* Dropout elimination & Conv Bugfix (#297)
* Dropout elimination.
* Test VGG19.
* Add shufflenet.
* Fix grouped convolution bug.
* Fix lit test failure.
Signed-off-by: Kevin O'Brien <caomhin@us.ibm.com>
* Rewrite shape and size OP (#285)
* add shape inference
* Revert "add shape inference"
This reverts commit f9d42f39e68e14b5648abccfc8617fff00244d16.
* add rewrite rules
* test cases
* format
* add constraint
* response to review
* response to review
Signed-off-by: Kevin O'Brien <caomhin@us.ibm.com>
* initial code for handling custom ops (#288)
* initial code for handling custom ops
* format
Signed-off-by: Kevin O'Brien <caomhin@us.ibm.com>
* ShapeInference for SizeOp (#299)
* add shape inference
* Revert "add shape inference"
This reverts commit f9d42f39e68e14b5648abccfc8617fff00244d16.
* shape inference
* test case
* format
Signed-off-by: Kevin O'Brien <caomhin@us.ibm.com>
* Gather ONNX to Kernel Lowering (#294)
* Define krnl.permute op.
* Support krnl.permute operation.
* Properly remove loop references.
* Re-push, Github was down.
* Need to debug interpretOp error.
* Fix lowering bug by erasing ops after full krnl IR interpretation is done, and clean up & comment code.
* Introduce permute, unroll operations.
* More debug.
* Remove std::set.
* krnl.terminate fails to be converted.
* Pass all tests, need to add legal ops as well as part of the conversion target.
* Change test format to new permute spec.
* Bug fix for nested iterate op lowering.
* Simplify error reporting.
* Fix compilation error.
* Increase comments coverage.
* Remove unnecessary imports.
* Re-trigger Jenkins
* Add permute/unroll tests.
* Retrigger Jenkins
* initial implementation of gather
* added tests
* format
* remove affine load for second load, as it uses an indirection
* changes suggested by reviewers
* remove backend tests until I can verify them locally
Co-authored-by: Tian Jin <tjingrant@gmail.com>
Signed-off-by: Kevin O'Brien <caomhin@us.ibm.com>
* add lit test
Signed-off-by: Kevin O'Brien <caomhin@us.ibm.com>
* fix option spelling
Signed-off-by: Kevin O'Brien <caomhin@us.ibm.com>
* braces in wrong place
Signed-off-by: Kevin O'Brien <caomhin@us.ibm.com>
* add lit test
Signed-off-by: Kevin O'Brien <caomhin@us.ibm.com>
* remove duplicate code from lit test Signed-off-by: Kevin O'Brien <caomhin@us.ibm.com>
* Simplify lit test Signed-off-by: Kevin O'Brien <caomhin@us.ibm.com>
* remove attributes from lit test Signed-off-by: Kevin O'Brien <caomhin@us.ibm.com>
* add onnx-mlir-opt to tool names
Signed-off-by: Kevin O'Brien <caomhin@us.ibm.com>
* add printIR to second RUN
Signed-off-by: Kevin O'Brien <caomhin@us.ibm.com>
* redo adding printIR
Signed-off-by: Kevin O'Brien <caomhin@us.ibm.com>
* fix bug
Signed-off-by: Kevin O'Brien <caomhin@us.ibm.com>
* format
Signed-off-by: Kevin O'Brien <caomhin@us.ibm.com>
* fix typo in test
Signed-off-by: Kevin O'Brien <caomhin@us.ibm.com>
Co-authored-by: Alexandre Eichenberger <alexe@us.ibm.com>
Co-authored-by: Tian Jin <tjingrant@gmail.com>
Co-authored-by: Tung D. Le <tung@jp.ibm.com>
Co-authored-by: Gheorghe-Teodor Bercea <gt.bercea@gmail.com>
Co-authored-by: Haruki Imai <imaihal@jp.ibm.com>
Co-authored-by: Kevin Wu <6334443+kwu91@users.noreply.github.com>
Co-authored-by: chentong319 <chentong@us.ibm.com>
* 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.
* compartmentalize build script, temporarily remove dependency of onnf_opt on helper.cpp
* fix test includes
* fix op directory include
* compiler -> op
* compiler test depends on boost system
* fix function name
* specify libcompiler dependencies
* let cmake take care of transitive dependencies
* remove unnecessary includes
* use ONNF_SRC_ROOT and ONNF_BIN_ROOT
* allow whole-archive linked libraries to be appended
* [MLIR] Support filecheck (#371)
* support lit+FileCheck
* add lit into build script
* format MLIR.cmake
* format cmake
* [MLIR] Remove input/output ops (#372)
* remove input/output ops
* get output tensor type from symbol table