Commit Graph

405 Commits

Author SHA1 Message Date
Tung D. Le 2c8f5701bd
Lower SqueezeOp to Krnl dialect (#164)
* 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>
2020-07-03 16:26:41 +08:00
Haruki Imai 4d96247327
Set alignment attribute to AllocOp of insertAllocAndDealloc() (#195)
* Added alignment in AllocOp of insertAllocAndDealloc()

* Added comments

Co-authored-by: Tian Jin <tjingrant@gmail.com>
2020-07-02 15:21:01 +08:00
Kevin O'Brien 5c6d85e6f3
README change to add info on using prebuilt Docker images (#201)
* 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>
2020-07-02 13:54:38 +08:00
gongsu832 cf96d635cc
Compile cruntime with fpic (#188)
* 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>
2020-07-01 15:06:55 +08:00
Tian Jin e902506ee5
Support encoding data type infomration as part of the DMR struct. (#178)
* Support encoding data type infomration as part of the DMR struct.

* Support full range of np types.

* Report error when encountering unsupported type.

* Add gerRank method API.

* Add missing API declarations.

* DynMemRef -> RtMemRef

* Format code.

* Missed DynMemRef -> RtMemRef conversion.

* More comments for RMR, and rename variable names from dmr -> rmr.

* DynMemRef -> RtMemRef.

* Format code.
2020-06-30 10:58:21 +08:00
Tian Jin f9cb113a84
Krnl block (#170)
* Support krnl.block printing/parsing.

* Checkpoing, PoC working.

* Implement krnl.block operation.

* Make tuple -> make pair.

* Bug fix, white list krnl.iterate op while lowering.

* Add return loop op lowering.

* Bug fix.

* Allow using loop refs more than once if they are used by krnl.iterate op.

* More comments and include lit test.

* Make krnl.block definition more restrictive.

* Splitting tests creates modules, making affine_map matching more verbose, prefer not splitting since test cases are small.

* Use verbose mode for LIT test on Z.

* Use verbose build to diagnose.

* Missing libraries linking when building in shared mode.

* Fix whole-archive linkage.

* Try preloading affinetransforms.

* Try put AffineTransforms into LD_LIBRARY_PATH.

* Fix python syntax error.

* No need to link with whole-archive libs, as they are pre-loaded.

* Do not preload any library.

* Link with whole-archive libs.

* Explicitly shared linkage in CMake.

* Fix CMake syntax error.

* Restore test.py

* Update z13.sh

* Update z13.sh

* Provide krnl.block operation description.
2020-06-27 22:35:01 +08:00
Kevin O'Brien fd3ee81bcf
fix wrong tag on docker image (#193)
Was tagging the image with "latest", should be the CPU type
2020-06-26 11:43:32 -04:00
chentong319 2e08b2112c
String type (Ready for Review) (#182)
* string type from tensorflow

* simplify type

* parser and print

* gen StringType for tablegen

* onnx to onnx-mlir type

* add namespace

* allow all integer type

* dialect document

* add test case

* format

* more precise type for ONNXOp

* format

* enable the failed test

* update comment

* update onnx.md

Co-authored-by: Gheorghe-Teodor Bercea <gt.bercea@gmail.com>
2020-06-25 16:34:37 -04:00
Gheorghe-Teodor Bercea f811718144
Add new passes related to Linalg and Affine dialects (#181)
* Reorganize main function.

* Follow review comments.

* Emit constants are globals in Krnl and LLVM dialects.

* Add more passes to onnx-mlir-opt.

* Clean-up.
2020-06-25 13:36:39 -04:00
chentong319 cc68f77d8d
Merge onnx ml into onnx (#176)
* merge onnx-ml into onnx

* delete onnx ml
2020-06-22 20:01:56 -04:00
Tian Jin f81f44662b
Remove whole archive linkage (#173)
* Explicit pass registration.

* Remove whole-archive linking, replace with regular linking.

* Remove whole-archive linkage related scripts.

* No need to preload library, simply expose them through LD_LIBRARY_PATH.

* Use OMLibs to record all onnx-mlir libs.

* Add OMResultTypeInferenceOpInterface lib to OMLibs.

* nit.

* No need to expose libs through LD_LIBRARY_PATH.

* Fix missing onnx header file issue.

* Define OMLibs before Tool subdirectory is imported.

* Define OMLibs at parent scope.

* Specify dependency of MainUtils on OMLibs early.

* Set OMLibs both at current & parent scope.

* Add comment about what future pass implementation should do.
2020-06-19 00:21:27 +08:00
chentong319 1fc43fa181
support map and seq in tablegen (#159)
* support map and seq in tablegen

* register MLONNX for testing

* format

* remove the unwanted test

* add a test

Co-authored-by: Tian Jin <tjingrant@gmail.com>
2020-06-18 21:49:40 +08:00
Tian Jin b28fcbc745
Do not push empty string as a command argument, it breaks on Linux. (#174) 2020-06-18 21:04:55 +08:00
Alexandre Eichenberger 82d2caa542
constant folding for transpose of constant tensors (#171)
* added constant folding for transpose of constant tensors

* format

* responding to reviews
2020-06-17 10:42:06 -04:00
Alexandre Eichenberger 742e817722
Constprop2 (#167)
* initial const prop attempt

* added support for broadcast ops

* adde all binary broadcast ops into custom builders with precise type

* added test example

* working

* format

* fixed suggestion by Tung, start woring on unary

* added subtraction and neg the right way, and added elementwise mul too

* formatting changes

* format

* format

* added instructions to add new optimizations

* added propagation rules that always migrate constants toward the root of the expression, using assoc and commutativity

* format comment
2020-06-15 14:56:15 -04:00
Tian Jin a7781791e9
[NFC] Fix comment style, shorten file names. (#169)
* Fix comment style, shorten file names.

* Update CMakeLists.txt

* Rename ONNXRewrite.td to Rewrite.td
2020-06-15 11:49:09 +08:00
Tung D. Le 60c648ae39
Avoid hardcoding ops with shape inference in ShapeInferencePass (#165)
* Avoid hardcoding ops with shape inference in ShapeInferencePass

* Minimize the changes

* Clang-format

Co-authored-by: Tian Jin <tjingrant@gmail.com>
2020-06-12 15:42:05 +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
Tung D. Le 8c4d527eea
Lower SplitOp to Krnl dialect (#155)
* Fix importing variadic output

* Lower splitop

* Support unknown dimension and add lit tests

Co-authored-by: Tian Jin <tjingrant@gmail.com>
2020-06-11 10:57:20 +08:00
Gheorghe-Teodor Bercea 4ab96fbc6c
Add basic support for memory pool (#161)
* Reorganize main function.

* Follow review comments.

* Emit constants are globals in Krnl and LLVM dialects.

* Replace internal malloc with memory pool and getref instruction.

* Lower krnl.getref to LLVM.

* Fix formatting issues.

* Add tests.

* Add missing dependency.

* Improve LLVM lowering.

* Add test to show getref is generic.
2020-06-09 16:48:33 -04:00
Aman LaChapelle ca185002f2
Add shape inference for several ops (#163)
* 1. Add shape inference for the following ops:
 - Atan
 - Tan
 - Sin
 - Cast
 - ConvTranspose
 - Flatten
 - DynamicQuantizeLinear
 - QuantizeLinear
 - DequantizeLinear
 - ConvInteger

2. Import attributes for generic nodes
3. Fixes for cases where .cast<> should be .isa<> (ONNXConcat::inferShapes)

* Fix foormatting issues

* Address comments:
 - SmallVector<> * -> SmallVectorImpl<> &
 - switch-case -> helper function
   - Inside helper function, preserve signed-ness
 - add TODOs

* Can't use signed integers yet in convertONNXTypeToMLIRType, add TODO

Co-authored-by: Tian Jin <tjingrant@gmail.com>
2020-06-09 14:55:49 +08:00
gongsu832 43dc1a1e01
Fix header dep (#150)
* Detect llvm-project commit change in utils/clone-mlir.sh and rebuild llvm-project
for zLinux Jenkins build bot

* Since many headers are generated and included indirectly through
other headers, there are often missing dependencies that break
parallel build. So we add header targets for KrnlOps, ONNXOps, and
MLONNXOps, and add explicit dependencies for all the relevant headers.

* fix copy-and-paste bug

Co-authored-by: Tian Jin <tjingrant@gmail.com>
2020-06-09 10:38:32 +08:00
Alexandre Eichenberger e2af505746
Constprop (#162)
* initial const prop attempt

* added support for broadcast ops

* adde all binary broadcast ops into custom builders with precise type

* added test example

* working

* format

* fixed suggestion by Tung, start woring on unary

* added subtraction and neg the right way, and added elementwise mul too

* formatting changes

* format

* format

* added instructions to add new optimizations
2020-06-08 15:45:32 -04:00
Tian Jin dedd5f4a12
Minor bugfix. (#166) 2020-06-08 14:03:35 -04:00
Tung D. Le bb17fa965f
Add AffineScope trait to KrnlIterateOp and enable affine-loop-fusion pass (#140)
* Make KrnlIterate's IVs valid to AffineLoad/AffineStore

* [Unary elementwise op] Load/Store -> AffineLoad/AffineStore

* [Conv] Load/Store -> AffineLoad/AffineStore

* Add affine-loop-fusion pass

* typos

* Mistake when merging branch master

Co-authored-by: Tian Jin <tjingrant@gmail.com>
2020-06-08 15:36:27 +08:00
Tian Jin cde1157d62
Rapid check test (#141)
* Call llc, ld from within onnx-mlir.

* Rename EmitLLVMBC -> EmitLib., reorder header files

* Edit comment.

* Checkpoint, debug.py works.

* Automatically generate inputs in debug.py.

* Use float.

* initial support for rapidcheck tests.

* Convolution test case works.

* Format code.

* Link library with MainUtils.

* Fix CMake script error.

* Fast implementation of array assertion, more detailed error analysis.

* More utility for DynMemRef.

* Fix linking issue.

* Uncomment unit test.

* Refactor to separate C++/Python ExecutionSession, enable unit test.

* format code.

* Verbose build.

* Enable PIC option for ExecusionSession.

* Fix cmake error.

* Build all targets.

* Fix doc to build all targets.

* Clean up.

* Clean up, debug.

* Use type alias consistently.

* Move definitions to DynMemRef.cpp.

* include algorithm.

* pyruntime -> PyRuntime

* Format code.

* Free memory.

* Add comments.

* Copyright notice.

* Improve stylistic consistency.

* Add comment.

* Revert irrelevant changes.

* Disambiguate.

* Refator test case generator out from test case implementation, implement example exhaustive test driver.

* Add documentation for testing.
2020-06-08 10:18:55 +08:00
Tung D. Le e2e1fbfd3b
Add type inference for CastOp (#156)
* Add type inference for CastOp

* Share type translation between op builder and onnx importer

* clang-format

* Format emitted code

* Remove unnecessary dependencies
2020-06-04 09:05:04 -04:00
Alexandre Eichenberger 2a1fe9e1e7
Believe all errors now results in meaningful actions (#153)
* removed warning missing return, dangling else

* fixed errors, made sure to return false in all shape inference failures

* shape inference use LogicalResults as return value

* format fixed

* format error

* additional error correction

* handle errors properly for all former emitError site, using either emitError, assert, or llvm_unreachable

* help added

* fixes

* edit of doc

* doc edit
2020-06-01 13:55:19 -04:00
Kevin O'Brien 536a20695f
Multi build - add build for IBM Systems Z and P (#157)
* Update .travis.yml

* add Z and Power builds

* Build (#1)

* prereq build for Z and Power

* prereq build for Z and Power

* prereq build for Z and Power

* Update MLIR version

* Update MLIR version

* Update MLIR version

* Update MLIR version

* Update MLIR version

* Update MLIR version

* Update MLIR version

* Update MLIR version

* Update MLIR version

* Update MLIR version

* Update MLIR version

* Update MLIR version

* Update MLIR version

* Update MLIR version

* Update MLIR version

* Update MLIR version

* Update MLIR version

* test build

* test build

* Update MLIR version

* test build

* test build

* test build

* test build

* test build

* test build

* test build

* test build

* test build

* test build

* test build

* test build

* test build

* test build
2020-05-29 17:22:13 -04:00
Alexandre Eichenberger 20dd6544aa
conv bug fix (#154) 2020-05-28 07:34:58 +08:00
Tung D. Le 2b6befce87
Fix importing variadic output (#152)
* Fix importing variadic output

* clang-format
2020-05-27 09:33:53 -04:00
Alexandre Eichenberger 4f8fd9d1bf
Error fix3 (#145)
* removed warning missing return, dangling else

* fixed errors, made sure to return false in all shape inference failures

* shape inference use LogicalResults as return value

* format fixed

* format error

Co-authored-by: Tian Jin <tjingrant@gmail.com>
2020-05-27 10:09:28 +08:00
Tian Jin c20aa6980e
Include link to project website. (#123) 2020-05-27 08:12:34 +08:00
Tung D. Le 028276ac0e
Fix cruntime not existed (#149)
Co-authored-by: Tung D. Le <tung@jp.ibm.com>
Co-authored-by: Tian Jin <tjingrant@gmail.com>

Co-authored-by: Tian Jin <tjingrant@gmail.com>
2020-05-26 16:05:00 +08:00
chentong319 5a542e78a0
fix type inference (#144)
* fix type inference for ConstantOp and MaxPoolSingleOut

* modify interface

* use OpInterface

* change name to OpInterface

* Builder dependence

* Update CMakeLists.txt

* Update CMakeLists.txt

Co-authored-by: Tian Jin <tjingrant@gmail.com>
2020-05-26 09:54:19 +08:00
chentong319 6099efd91b
Express some basic features of an Operation in TableGen file (#103)
* change operation definition

* change importer

* default type inference

* file format

* generate types for input/output

* generate the mapping for operation output type

* remove debug message for gen_doc.py

* update the dialect doc

* add support Complex

* format

* update document

Co-authored-by: Gheorghe-Teodor Bercea <gt.bercea@gmail.com>
2020-05-21 22:03:16 -04:00
Kevin O'Brien df18efcb48
Fix travis build (#142)
* mount clone in container

Mount the clone that travis created inside the docker container so we get the correct set of commits for this build

* Update Dockerfile

* start with docker file

* change docker run to exec

used wrong docker command in a bunch of places

* fix docker commands

* Update compile-onnx-mlir.sh

* Update .travis.yml

* save build result

* commit the built container

* copy clone rather than mount

Copy the files that travis cloned since using -v $(pwd):/onnx-mlir to mount them as a volume doesn't persist when we push the image to docker hub.

* move 'cd docker' later

* fix location for Dockerfile

* Update .travis.yml

* Update compile-onnx-mlir.sh

* fix mount directory

* conditional push of build

* remove old docker push

forgot to do this previously

Co-authored-by: Gheorghe-Teodor Bercea <gt.bercea@gmail.com>
2020-05-21 10:41:00 -04:00
Tian Jin a270af5ce0
Support model debugging (#138)
* Call llc, ld from within onnx-mlir.

* Rename EmitLLVMBC -> EmitLib., reorder header files

* Checkpoint, debug.py works.

* Automatically generate inputs in debug.py.

* Use float.

* Fix merge conflict, remove RapidCheck from this patch.

* Remove submodule rapidcheck properly.

* Reformat code.

* More comments.

* Add documentation.

* Add documentation to navigation.

* Account for the fact that some initializers may also appear as input.
2020-05-21 13:02:48 +08:00
Tian Jin be62d85a32
Support onnx-mlir installation. (#139) 2020-05-21 11:03:06 +08:00
chentong319 a98c723b11
save and check the version of ONNX operation (#125)
* add version control

* fix the comments

* response to review and add onnx_ml

* update document

* add target and rename gen_doc.py

* small fix
2020-05-20 13:48:45 -04:00
Tung D. Le ad61eee908
Move to more recent LLVM commit ID (#131)
* 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

Co-authored-by: Tian Jin <tjingrant@gmail.com>
2020-05-20 15:45:42 +08:00
gongsu832 5d85843be4
Detect llvm-project commit change in utils/clone-mlir.sh and rebuild llvm-project (#132)
for zLinux Jenkins build bot

Co-authored-by: Tian Jin <tjingrant@gmail.com>
2020-05-20 11:39:37 +08:00
Kevin O'Brien 661fa601ee
add Github workflow to build the prereq Docker image for TravisCI build (#137)
* Create build-docker-prereq.ym

* Rename build-docker-prereq.ym to build-docker-prereq.yml

* Create prereq.Dockerfile

* Update build-docker-prereq.yml

* Update clone-mlir.sh

* Update build-docker-prereq.yml

* Update clone-mlir.sh

* Update build-docker-prereq.yml

* Update clone-mlir.sh

* Update prereq.Dockerfile

* Update clone-mlir.sh

* Update prereq.Dockerfile

* Update clone-mlir.sh

* Update build-docker-prereq.yml

* Update prereq.Dockerfile

* Update clone-mlir.sh

* Update build-docker-prereq.yml

* Update clone-mlir.sh

* Update Dockerfile

* Update .travis.yml

* Update .travis.yml

* Update Dockerfile

* Update Dockerfile

* Update build-docker-prereq.yml

* Update Dockerfile

* Update prereq.Dockerfile

* Update clone-mlir.sh

* Update build-docker-prereq.yml

* Update .travis.yml

Co-authored-by: Gheorghe-Teodor Bercea <gt.bercea@gmail.com>
2020-05-19 15:48:47 -04:00
Gheorghe-Teodor Bercea c476f05a45
Fix comment [NFC] (#134)
* Reorganize main function.

* Follow review comments.

* Emit constants are globals in Krnl and LLVM dialects.

* Fix comment.
2020-05-19 14:21:59 -04:00
Gheorghe-Teodor Bercea 463efb736d
Fix name of intermediate file (#133)
* Reorganize main function.

* Follow review comments.

* Emit constants are globals in Krnl and LLVM dialects.

* Change extensions of intermediate file.
2020-05-19 12:28:09 -04: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
Kevin O'Brien 30a9070c8d
Add TravisCI build using docker (#130)
* Create befor_install.sh

* Create install_deps.sh

* Create build_onnx_mlir.sh

* Create .travis.yml

* Update .travis.yml

* Delete befor_install.sh

* Create before_install.sh

* Create .travis.yml

* Update before_install.sh

* Delete .travis.yml

* Update install_deps.sh

* Update build_onnx_mlir.sh

* Update build_onnx_mlir.sh

* Update .travis.yml

* Update before_install.sh

* Update .travis.yml

* Create install_LLVM.sh

* Create compile_LLVM.sh

* Create compile_ONNX-MLIR.sh

* Create test_ONNX-MLIR.sh

* try to start travis

* fix indentation in .travis.yml

* add debug code to second job

* Update .travis.yml

* Update .travis.yml

* add workspaces to travis script

* Update .travis.yml

* Update .travis.yml

* Update .travis.yml

* Update .travis.yml

* Update .travis.yml

* Update compile_LLVM.sh

* Update compile_LLVM.sh

* Update .travis.yml

* Update install_LLVM.sh

* Update compile_LLVM.sh

* Update .travis.yml

* Create Dockerfile

* Create compile-onnx-mlir.sh

* Update .travis.yml

* Delete before_install.sh

* Delete build_onnx_mlir.sh

* Delete compile_LLVM.sh

* Delete install_LLVM.sh

* Delete install_deps.sh

* Delete test_ONNX-MLIR.sh

* Delete compile_ONNX-MLIR.sh

Co-authored-by: Gheorghe-Teodor Bercea <gt.bercea@gmail.com>
2020-05-18 10:24:05 -04:00
Tian Jin 1d5adc555d
Do not leave temporary files when invoking gen_doc.py. (#129) 2020-05-18 09:44:31 -04:00
Tian Jin ade694a1e9
Tabulate Build Status. (#122) 2020-05-15 19:51:14 +08:00
chentong319 23bea50404
Implement PadOp based on attribute promotion (#71)
* enable promote attr for pad

* use optional arguments for pad

* shape infereance for pad

* Lowering Pad

* format file

* use DenseTensor for the attribute

* use Pad in ONNXRewrite

* fix the merge conflict

* fix the attr given to constantOp

* handle ONNXConstantOp in attribute promotion

* Fix bug when AttributePromotion is called more than once

* update ONNXOps.td.inc with correct version of onnx

* update onnx.md

* responses to review

* fix the build error

* change the implementation of Pad

* delete commented out code

* clang format

Co-authored-by: Tian Jin <tjingrant@gmail.com>
2020-05-15 13:19:28 +08:00