Commit Graph

22 Commits

Author SHA1 Message Date
Tian Jin da4527c961 flatten src directory structure 2019-12-23 00:13:52 -05:00
Tian Jin 82d513096e a commandline interface for onnf 2019-12-22 23:52:49 -05:00
Tian Jin 685bf23b40 Enable ONNX Backend Test (#1)
* wip, commit before merging with upstream

* organize API, return wrapped output

* enable onnx backend test

* undo unintentional commit

* fix krnl ops tablegen

* format krnl ops

* reorder fillDynMemRefWithMemRef to be after fillPtrToMemRefWithDynMemRef, better comments

* more onnx backend tests

* ensure that test names refer to existing tests

* improve code readability by shortening type names

* nit

* restore unintentional changes

* more nits

* fix ; -> :

* split runtime implementation into header and body file, add support for data types

* comment on the onnx backend test

* make the comments read better

* do not dump when lowering
2019-12-22 23:14:57 -05:00
Tian Jin a6a40cf989 Format Key Files using LLVM Style (#403)
* format using llvm style

* merge and format
2019-12-21 02:11:49 -05:00
TONG CHEN c8d591fb28 [MLIR] import attribute of onnx node (#383)
* add attributes as NamedAttribute

* support list value for attribute

* use std::tie to avoid c++17 feature
2019-12-21 02:00:58 -05:00
GHEORGHE-TEOD BERCEA b02652dd76 [MLIR] Lowering of frontend dialect to KRNL dialect (#382)
* Partial support for lowering operations to KRNL dialect.

* Attempt to lower to KRNL IR.

* Update file.

* Add lowering.

* Address comments. Fix alloc dynamic dimensions. Correctly link StandardOps.

* Temporarily remove deallocation of locally allocated tensors.
2019-12-21 01:11:14 -05:00
TONG CHEN 3f68c5420d [MLIR] generate op from onnx document (#366)
* generate op from onnx document

* Restore FullGemm

* update the op attribute for shape inference and canonicalizer

* Update onnx_canonicalization.mlir
2019-12-21 00:40:40 -05:00
Tian Jin d01ac7732f [MLIR] compartmentalize build script (#369)
* 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
2019-12-21 00:34:51 -05:00
TUNG LEDUC 0d644fab92 [MLIR] Legalize output tensors' names (#368)
* [MLIR] legalize output tensor's name

* Update frontend_dialect_transformer.cpp
2019-12-21 00:08:02 -05:00
GHEORGHE-TEOD BERCEA 63596e723f [MLIR] Add optimization based on TableGen pattern (#363)
* Define pattern.

* Fix file names.

* Add canonicalizer optimization based on TableGen pattern.

* Remove custom builders.

* Enable canonicalization in ONNF and ONNF-OPT.
2019-12-21 00:04:51 -05:00
GHEORGHE-TEOD BERCEA 03be41f7df [MLIR] Add shape inference pass (#361)
* Add shape inference pass.

* Format code.

* Enable shape inference pass.

* Rename new files to use ONNF convention.

* Use include path from src folder.

* Replace guards with pragma once.

* Format variable names. Shuffle headers.

* Fix comment.

* Fix comments.
2019-12-19 20:14:07 -05:00
Doru Bercea a6cca3cbb7 Code clean-up. 2019-12-19 19:51:01 -05:00
GHEORGHE-TEOD BERCEA a9960f6e44 [MLIR] Add conversion to MLIR types. (#360)
* Add conversion of tensor proto types to MLIR types.

* Fix integer type conversion. Use new type conversion for ouput type.
2019-12-19 19:48:31 -05:00
GHEORGHE-TEOD BERCEA 958a2fbffc ONNX Dialect creation and registration with MLIR (#358)
* Create and register ONNX Dialect with one Add operation.

* Fix file formatting.

* Change name from ONNX to SGIR.

* Use ONNX dialect. Change SGIR to frontend placeholder dialect.

* Add comments.

* Type clean-up.
2019-12-19 16:56:30 -05:00
GHEORGHE-TEOD BERCEA 45a5a8499c Fix MLIR-enabled build. (#354)
* Add new build paths. Add Ranker or Unracked tensor types.

* Remove path to LLVM root folder, it is not needed anymore.

* Code clean-up.

* Clean-up code.

* update LLVM_PROJECT_SRC

* Update p9.sh

* Update MLIR.cmake
2019-12-19 16:16:06 -05:00
Tian Jin 00aee2e0b6 Use TableGen (#347)
* use table gen

* fix name of the dialect

* add old compilation path

* add some doc

* fix bug, sgir importer imports every op twice

* knl.visit -> knl.iterate
2019-12-19 15:18:35 -05:00
Tian Jin cc39a92802 fix code format (#348) 2019-12-19 14:53:18 -05:00
Doru Bercea e1f6ae1336 Fix name legalization. 2019-12-19 14:46:18 -05:00
TONG CHEN 50ac6e7bce emit SGIR based on onnx model, following the toy/Ch2 example (#345)
* emit SGIR based on onnx model, following the toy/Ch2 example

* fix 1) code style 2) multiple output of a node

* Update sgir.cpp
2019-12-19 14:37:20 -05:00
Doru Bercea 63427030ca Enable building of first commit. 2019-12-19 14:24:37 -05:00
Doru Bercea b6a2a50dd8 Add header. Clean-up file. Add CMake file. 2019-12-18 16:45:05 -05:00
TONG CHEN f3207be963 add MLIR: compile/link/run (#342)
* add MLIR: compile/link/run

* change LLVMPROJECT to LLVM_PROJECT and do not allow linking with system LLVM libraries
2019-12-18 15:43:35 -05:00