* Rewriting rule
* Fix formulas
* Reuse op results
* Const propagation for Div and Sqrt
* Explicitly use ONNXConstantOp
* Minor revise
* Const propagation for unsqueeze
* Do const propagationnce all tensors have inferred shapes
* LIT tests for fusion
* Add LIT tests for constant propagation on Div, Sqrt, and Unsqueeze
* Missing dash
Co-authored-by: Tian Jin <tjingrant@gmail.com>
* move scalerop to decompose
* change clang format
* change clang format
* add shape inference for scaler op
* fixing generated onnxop
* generate onnx.md
* redo get onnx.md and onnxop.td.inc using onnx 1.6
* Add shape inference for scaler op
* add benefit for scaler decompose and simplify scaler shape inference
* add scaler decompose benefit num and simplify shape inference
* add cast builder
* cast rewrite only for float
* add cast op same type rewrite rule
* working on cast lowering
* cast lowering working
* add cast lowering
* fix format
* Delete OpBuildTable.inc
* complete requested changes
Co-authored-by: chentong319 <chentong@us.ibm.com>
* Update LLVM commit ID to include to the new modeling of LLVM type in MLIR
* Fix commit id discrepancy
* Update README.md
* Update MLIR version
* Force rebuild prereq dockers and see what happens.
* Use LLVM commit ID that corresponds to MLIR News, 13th edition (8/7/2020)
Co-authored-by: Tian Jin <tjingrant@gmail.com>
* Reorganize main function.
* Follow review comments.
* Emit constants are globals in Krnl and LLVM dialects.
* Make mempooling more robust.
* Fix.
* Update MainUtils.cpp
Additional canonicalization not required anymore.
* move scalerop to decompose
* change clang format
* change clang format
* add shape inference for scaler op
* fixing generated onnxop
* generate onnx.md
* add benefit for scaler decompose and simplify scaler shape inference
* cast rewrite only for float
* add cast op same type rewrite rule
* working on cast lowering
* cast lowering working
* correct onnx version
* update onnx md
* add test for tensor<10xf64>
* Add shape inference for Ops used by BERT
* Erf
* Pow
* ReduceMean
* Dropout
* Expand
https://github.com/onnx/onnx/blob/master/docs/Operators.md#expand
Deduce the value of the shape operand by looking at the producer
of the operand.
Currently supported producers are: onnx.Constant and onnx.Shape.
* Add corresponding tests for each op.
* Sort the list of ops with shape inference in gen_onnx_mlir.py
in alphabetic order for clarity.
* Restart CI
Co-authored-by: Tian Jin <tjingrant@gmail.com>
* catch errors after build command
* remove spaces
* use %ERRORLEVEL% instead
* move modification to CI command only
* add extra nextline to prevent modification
* base implementation
* add example
* change table gen
* docs
* small change for review
Co-authored-by: Alexandre Eichenberger <alexe@us.ibm.com>
Co-authored-by: Tian Jin <tjingrant@gmail.com>
* Detect llvm-project commit change in utils/clone-mlir.sh and rebuild llvm-project
for zLinux Jenkins build bot
* Fix MainUtils.cpp compilation on Windows
* Fix clang-format
* Update comments on Windows not to delete the constant pack object file
* move scalerop to decompose
* change clang format
* change clang format
* add shape inference for scaler op
* fixing generated onnxop
* generate onnx.md
* add benefit for scaler decompose and simplify scaler shape inference
* cast rewrite only for float
* add cast op same type rewrite rule
* fix format
Co-authored-by: chentong319 <chentong@us.ibm.com>
* 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
* Using a non-trivial example.
* Add more complex example/test case.
* move scalerop to decompose
* change clang format
* change clang format
* add shape inference for scaler op
* fixing generated onnxop
* generate onnx.md
* Add shape inference for scaler op
* add benefit for scaler decompose and simplify scaler shape inference
* Reorganize main function.
* Follow review comments.
* Emit constants are globals in Krnl and LLVM dialects.
* Add support for moving dynamic alloca instructions to top of functions.
* Fix memory pooling tests.
* Various fixes.
* Fix lit tests.
* More test fixes.
* Reformat.
* Reformat some more.
* Fix issue with TestConv and split-input-file.
* Use smart pointers.
* Remove redundant pointer.
* Reformat.
* Add initMap description.
* Clean up tests.
* 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>
* changes for mypipeline.onnx
* format
* rm MLOpBuildTable.inc
* copy string without free
* fix the memory issue
* restore change for STRING
* format
Co-authored-by: Tian Jin <tjingrant@gmail.com>
* Remove optimize_loops/return_loops op in elementwise ops lowering and fix tests in onnx_lowering.mlir.
* Fix all tests.
* Remove all occurences of def_loops/return_loops.
* Fix test.
* Fix comments for defineLoops & emitKrnlLoopsAndIterationForOperand function.
* Remove emitOptimizedLoops.
* Allow not specifying optimizedLoops when creating KrnlIterateOperandPack.
* Fix style.
* Make BuildKernelLoop helper not emit optimize/return_loop operations & retire emitKrnlLoopsAndIterationForOperand by replacing it with BuildKernelLoop.
* DefineLoops -> DefineLoopsEx, remove redundant emitKrnlLoopsAndIterationForOperand function.
* BuildKrnlLoop API name update.
* Tweak comments.
* Remove unused withEmptyOptimization flag.
* Better comment for BuildKrnlLoop.
* Fully remove krnl.return_loops/optimize_loops op.
* Trigger Windows Build
* Bump windows ci python version.
* Move to more recent LLVM ID (May 15)
* clang-format
* Bump cache version up
* Update readme
* Fix doc check
* Move to a newer commit id
* Update LoopToStandard -> SCFToStandard
* Change MLIRSideEffects to MLIRSideEffectInterfaces
* Add AffineScope trait to KrnlIterateOp
* [ElementWise] Load/Store op to AffineLoad/AffineStore op
* [Gemm, MatMul, Reduction, Softmax] Load/Store op to AffineLoad/AffineStore op
* [Concat] Load/Store op to AffineLoad/AffineStore op
* [Pad, PadConstantValuePad, Reshape, Transpose] Load/Store op to AffineLoad/AffineStore op
* [LSTM] Load/Store op to AffineLoad/AffineStore op
* [Conv, Norm, Pooling] Load/Store op to AffineLoad/AffineStore op
* Add affine-loop-fusion pass
* Use Load/Store for scalar
* Use Load/Store for scalar
* Fix lit tests
* Unknown dimensions for broadcasting ops
* Affine Load/Store for scalar memref
* clang-format
Co-authored-by: Gheorghe-Teodor Bercea <gt.bercea@gmail.com>
Co-authored-by: Tian Jin <tjingrant@gmail.com>
* Lower Squeeze op to Krnl dialect
* Emit tensor size as a single constant; add a lit test for unknown dimensions
* Code style
* Speical case where the input is only used by this squeeze op
* Remove squeeze-in-place optimization
* Update ConvertONNXToKrnl.cpp
Twek to re-run tests.
* Trigger buildbot re-run.
* Re-run CI
Co-authored-by: Tian Jin <tjingrant@gmail.com>
* Add description of prebuilt docker images
* example Dockerfile using prebuilt container
* vscode config files for Docker example
* vscode files for Docker example
* vscode files for Docker example
* add Dockerfile info
* typo
* fix bad name for example file
doc check failed because file name was incorrect
Co-authored-by: Tian Jin <tjingrant@gmail.com>
* Detect llvm-project commit change in utils/clone-mlir.sh and rebuild llvm-project
for zLinux Jenkins build bot
* Compile libcruntime.a object with -fPIC to avoid segfault when embedded into model.so
* Enable unit tests on zLinux
Co-authored-by: Alexandre Eichenberger <alexe@us.ibm.com>
Co-authored-by: Tian Jin <tjingrant@gmail.com>