platform/upstream/tvm.git
4 years ago[FRONTEND][TFLITE] Add support for TFLite_Detection_PostProcess (#4543)
mbarrett97 [Thu, 13 Feb 2020 02:07:58 +0000 (02:07 +0000)]
[FRONTEND][TFLITE] Add support for TFLite_Detection_PostProcess (#4543)

* [FRONTEND][TFLITE] Add support for TFLite_Detection_PostProcess

This adds support for the custom operator
TFLite_Detection_PostProcess which is commonly used in
object detection networks such as SSD Mobilenet. It
only adds support for when use_regular_nms = False.

Change-Id: I819b253c0eb6f0fa55da65d2634e09359b888828

* Added a test for the tflite custom op

Change-Id: Ie5baa092deae9a8bcffd2ebd9f6d346b90e58afd

* Removed trailing comma

Change-Id: Ib08f02b5f1a59a883048bfb36e4321152cd2e7f2

* Added spaces between divide

Change-Id: If1171fc03d211a809cedeb800804394972af4060

* Formatted comment

Change-Id: I3ce7e69b8d2c73aec57369c1c64ea1eec07f087b

* Reduced line length in test

Change-Id: I49eaafc3369070f8f3e85fbb965ad20972096c68

* Set random seed for test

Change-Id: I542a787d11422ea83c52147b2cb1144fcef0dd77

* Fixes to style

Change-Id: I2971b8ecebe08c882b2481a99f67cfbe515e0b1f

* Assert for incorrect number of inputs

Change-Id: I393f3b3b62be73e427498d98456fb1d5a214e0af

* Change comparison to pass linting

The linter was updated, so I needed to fix
a small style issue as a result.

Change-Id: Ia3c954565a00de92e7fb1912eae9ed9875d60c7c

4 years ago[REFACTOR][PY][API-CHANGE] Establish tvm.target
tqchen [Wed, 12 Feb 2020 21:39:45 +0000 (13:39 -0800)]
[REFACTOR][PY][API-CHANGE] Establish tvm.target

Move the related target modules into tvm.target.

API change:
- tvm.target.current_target -> tvm.target.Target.current
- tvm.datatype -> tvm.target.datatype

4 years ago[JVM] Update the runtime PackedFunc for module
tqchen [Wed, 12 Feb 2020 19:20:23 +0000 (11:20 -0800)]
[JVM] Update the runtime PackedFunc for module

4 years agoFix optimize
tqchen [Wed, 12 Feb 2020 05:41:47 +0000 (21:41 -0800)]
Fix optimize

4 years ago[DOCS][PY] Sphinx docs about tvm.ir
tqchen [Wed, 12 Feb 2020 04:36:20 +0000 (20:36 -0800)]
[DOCS][PY] Sphinx docs about tvm.ir

4 years ago[REFACTOR][PY][API-CHANGE] establish tvm.ir, migrate corresponding files (#4862)
Tianqi Chen [Wed, 12 Feb 2020 04:01:36 +0000 (20:01 -0800)]
[REFACTOR][PY][API-CHANGE] establish tvm.ir, migrate corresponding files (#4862)

* [REFACTOR][PY][API-CHANGE] establish tvm.ir, migrate corresponding relay files.

This PR establishes tvm.ir and migrates the corresponding relay
files into the new folder.

API Change:
- relay.Module -> tvm.IRModule

* Update with ADT

* Migrate transform

* address comments

* Migrate module

* Migrate json_compact

* Migrate attrs

* Move LoweredFunc to stmt temporarily

* temp migrate container

* Finish migrate container

4 years ago[Topi] Missing header (#4865)
hlu1 [Tue, 11 Feb 2020 22:46:50 +0000 (14:46 -0800)]
[Topi] Missing header (#4865)

4 years agoFix onnx import bugs (#4750)
kice [Tue, 11 Feb 2020 21:44:48 +0000 (16:44 -0500)]
Fix onnx import bugs (#4750)

* Fix onnx import bugs

Fix onnx attributes of string type incorrect handling
Merge symmetric padding of Conv to symmetric form

* Only merge symmetric padding for conv2d

4 years ago[Refactor] move vm.py under runtime and adt to runtime.container.py (#4855)
Zhi [Tue, 11 Feb 2020 20:04:04 +0000 (12:04 -0800)]
[Refactor] move vm.py under runtime and adt to runtime.container.py (#4855)

4 years agoadd resize op converter (#4838)
masahi [Tue, 11 Feb 2020 17:56:14 +0000 (02:56 +0900)]
add resize op converter (#4838)

4 years ago[TVM] const auto p -> const auto &p (#4861)
hlu1 [Tue, 11 Feb 2020 16:52:25 +0000 (08:52 -0800)]
[TVM] const auto p -> const auto &p (#4861)

4 years ago[LLVM] Explicit llvm::StringRef to std::string conversion (#4859)
hlu1 [Tue, 11 Feb 2020 16:45:17 +0000 (08:45 -0800)]
[LLVM] Explicit llvm::StringRef to std::string conversion (#4859)

4 years ago[RUNTIME] Fix memory leakage of TVMByteArray (#4856)
Lianmin Zheng [Tue, 11 Feb 2020 09:58:36 +0000 (01:58 -0800)]
[RUNTIME] Fix memory leakage of TVMByteArray (#4856)

4 years ago[TFLite] Using real image for QNN testing. (#4816)
Animesh Jain [Tue, 11 Feb 2020 02:56:37 +0000 (18:56 -0800)]
[TFLite] Using real image for QNN testing. (#4816)

* [TFLite] Using real image for QNN testing.

* Setting seed for SSD mobilenet for fixed input.

* Support quantized Pad op.

* Remove unnnecessary line.

* Ina comments.

4 years agoreverse changes in pr #4849 (#4853)
Leyuan Wang [Mon, 10 Feb 2020 22:13:35 +0000 (14:13 -0800)]
reverse changes in pr #4849 (#4853)

4 years ago[Relay] Added Merge Composite pass (#4771)
mbarrett97 [Mon, 10 Feb 2020 19:39:20 +0000 (19:39 +0000)]
[Relay] Added Merge Composite pass (#4771)

* [Relay] Added MergeComposite pass

This pass allows for patterns to be wrapped
in a function marked with 'Composite' and a
composite function name. This is intended to be
used with the external codegen for the cases where
an external operator maps to multiple Relay
operators. In that case, the mapping can be expressed
as a pattern and assigned a name.

For more information on this pass and its motivation,
see the RFC:
https://discuss.tvm.ai/t/rfc-external-codegen-defining-composite-relay-operators/5470

Change-Id: Icb1b803a9f0ac57c529143200228f3bb5793afc0

* [Relay] Merge composite tests

Added tests for the merge_composite pass.

Change-Id: I1728b4a05b0c1c36140a40f1afe028fde62185dd

* Merge composite additional test

Change-Id: I9bc7d6053c575e9468ac5abc31214c6ad8507e46

* Support priority order in merge_composite

The order in which the patterns are matched
was currently random as an unordered_map was
used to store the pattern table. This uses
arrays instead so that a distinct priority
order of matching can be defined. Additional
tests have also been added to verify this
behaviour.

Change-Id: Ief347df4262639138d5d9d7c8cee7ef233af7b56

* Improved merge composite docs

Change-Id: Ie3a72045ecc3f13ad3c302fbdf192b7296a306a8

* Removed unused variable

Change-Id: I7814d5fde368ffaf1b3d6d806060c774c7720364

* Remove unnecessary op check

Change-Id: I38e78d2acd5b86cb8e837be72ff9d72cd10bcf33

* Improve styling on composite function creation

Change-Id: I37add1c3134e0b5d5085fe1eb9daf8e06890fa8c

* Comment reword

Change-Id: Ie05872dcbbe0c3e1190b0597083b9a64e6b66c66

* Stylistic changes to avoid std::move

Change-Id: I43a93995bbf10530399900c992aa99dd4ae4575f

* Relax a check in ExtractPattern

Change-Id: I0faef77a66c55f83f09e6e47c561ffaea63dedfa

* Remove new line

Change-Id: Ifdd02c12087a7e1a0a9b54825669bc0de8f13c3d

* Removed MatchPattern from MergeComposite

This is not necessary now that ExtractPattern
can fulfill the same purpose.

Change-Id: I14dc020afa8e50f2df4c0a2efb88a011987f8196

* Removed a new line

Change-Id: I8b50f0c9069aa1bcaccbe68eb421031f01a64842

* Improved docs for merge composite

Change-Id: Ib1959a35c856e7ea5639de2e4ef314a54f44caf5

* Fixed free vars in test

Change-Id: I2b7f273db275964ec0e9820560663f0808adee79

* Handle case where root arg might not be a call

Change-Id: I4eeea3ce723d3ba337d110dcc690377daebe8626

* Removed blank line

Change-Id: I07f5392c0e95cfe3cfa5c333703cc6f82d6034fb

* Change to CHECK_EQ

Change-Id: I5c5d62d3cd57f72508b30b926f72091ae6f0d1cc

* Revised a conditional

Change-Id: I23a7897ca15a7cd076db5039dc653a4b8c27e803

* Improved doc styling

Change-Id: I377f0a1c1ac70f3b8d7584b0c49bddc8c6c134ef

* Fail extraction if vars conflict

Change-Id: I78e36d805e8ed6b55e61d490212a967c857554a4

* Added further merge composite tests

Change-Id: Ib1d800409fca4c1834c7fe0cab5a26ab99a26820

Co-authored-by: lhutton1 <35535092+lhutton1@users.noreply.github.com>
4 years agoFixed bug in ExprOp that caused bitwise operators to fail when a basic python type...
pankratz [Mon, 10 Feb 2020 19:33:51 +0000 (12:33 -0700)]
Fixed bug in ExprOp that caused bitwise operators to fail when a basic python type was on the left hand side of the expression. Added regression test for crashing cases. (#4852)

4 years ago[Frontend][TFlite] use qnn helper function in softmax (#4840)
Wang Yucheng [Mon, 10 Feb 2020 17:54:58 +0000 (01:54 +0800)]
[Frontend][TFlite] use qnn helper function in softmax (#4840)

4 years ago[CI][DOCKER] Update ci-lint to pylint2.4.4 (#4851)
Tianqi Chen [Sun, 9 Feb 2020 17:12:19 +0000 (09:12 -0800)]
[CI][DOCKER] Update ci-lint to pylint2.4.4 (#4851)

4 years ago[CI] Update ci-lint to v0.60 (#4850)
Tianqi Chen [Sun, 9 Feb 2020 05:42:36 +0000 (21:42 -0800)]
[CI] Update ci-lint to v0.60 (#4850)

4 years ago[LINT][PY] Fixes for pylint==2.4.4 (#4849)
Tianqi Chen [Sun, 9 Feb 2020 03:45:17 +0000 (19:45 -0800)]
[LINT][PY] Fixes for pylint==2.4.4 (#4849)

4 years ago[TEST] test_cuddn flaky (#4846)
Tianqi Chen [Sat, 8 Feb 2020 22:05:21 +0000 (14:05 -0800)]
[TEST] test_cuddn flaky (#4846)

4 years agoFixed process termination routine in windows (#4844)
Seyyed Hossein Hasanpour [Sat, 8 Feb 2020 18:48:16 +0000 (22:18 +0330)]
Fixed process termination routine in windows (#4844)

* Fixed process termination routine in windows

addresses and Fixes AttributeError: module 'os' has no attribute 'killpg' error in #4821

* Update server.py

4 years ago[Doc][AutoTVM] Fix bugs that override n_trials (#4842)
Cody Yu [Fri, 7 Feb 2020 22:34:14 +0000 (14:34 -0800)]
[Doc][AutoTVM] Fix bugs that override n_trials (#4842)

4 years ago[COMMUNITY] comaniac -> reviewer (#4841)
ziheng [Fri, 7 Feb 2020 21:41:35 +0000 (13:41 -0800)]
[COMMUNITY] comaniac -> reviewer (#4841)

4 years ago[REFACTOR][PY][API-Change] Polish tvm.runtime, tvm.runtime.module API update (#4837)
Tianqi Chen [Fri, 7 Feb 2020 17:15:08 +0000 (09:15 -0800)]
[REFACTOR][PY][API-Change] Polish tvm.runtime, tvm.runtime.module API update (#4837)

* [REFACTOR][PY-API] Polish tvm.runtime, tvm.runtime.module API update

This PR updates the tvm.runtime to use the new FFI style.

- Remove top-level tvm.module to avoid confusion between runtime.Module and IRModule
- API changes wrt to runtime.Module
  - tvm.module.load -> tvm.runtime.load_module
  - tvm.module.enabled -> tvm.runtime.enabled
  - tvm.module.system_lib -> tvm.runtime.system_lib
- Remove dep on api_internal from runtime.

* Update module.load in the latest API

4 years ago[Frontend][TFLite] Add MIRROR_PAD operator (#4822)
Wang Yucheng [Fri, 7 Feb 2020 11:57:34 +0000 (19:57 +0800)]
[Frontend][TFLite] Add MIRROR_PAD operator (#4822)

4 years ago[Relay][Frontend][TFlite] Add support for quantized LOGISTIC (#4696)
Ina Dobreva [Fri, 7 Feb 2020 10:23:55 +0000 (10:23 +0000)]
[Relay][Frontend][TFlite] Add support for quantized LOGISTIC (#4696)

* [Relay][Frontend][TFlite] Add support for quantized LOGISTIC

 * add qnn implementation
 * add qnn test case for qnn logistic

* Helper functions for quantize and dequantize.

4 years ago[Doc] ConvertLayout - Call RemoveUnunsedFunctions.
Animesh Jain [Thu, 6 Feb 2020 22:13:08 +0000 (22:13 +0000)]
[Doc] ConvertLayout - Call RemoveUnunsedFunctions.

4 years agoImprove tol to resolve flaky case (#4836)
Tianqi Chen [Fri, 7 Feb 2020 02:12:13 +0000 (18:12 -0800)]
Improve tol to resolve flaky case (#4836)

4 years ago[Frontend][ONNX] LSTM Support (#4825)
Josh Fromm [Fri, 7 Feb 2020 02:09:10 +0000 (18:09 -0800)]
[Frontend][ONNX] LSTM Support (#4825)

* Initial version working and passing tests.

* WIP on supporting other activations.

* add support for multiple activation functions in lstm

* All tests working and code cleaned up.

* Undo import swap to avoid conflict with masahi.

* Added new tests and related bug fixes.

Co-authored-by: Matthew Brookhart <mbrookhart@octoml.ai>
4 years ago[Doc] Introduction to module serialization (#4564)
Zhao Wu [Fri, 7 Feb 2020 02:03:20 +0000 (10:03 +0800)]
[Doc] Introduction to module serialization (#4564)

4 years agoFix doc after moving to unified IR (#4835)
Zhi [Fri, 7 Feb 2020 01:38:48 +0000 (17:38 -0800)]
Fix doc after moving to unified IR (#4835)

4 years ago[CI][DOCKER] Update ci-gpu torch1.4 and onnx1.6 (#4826)
Tianqi Chen [Thu, 6 Feb 2020 19:58:22 +0000 (11:58 -0800)]
[CI][DOCKER] Update ci-gpu torch1.4 and onnx1.6 (#4826)

4 years ago[CI][DOCKER] Update ci-gpu to v0.60 (#4827)
Tianqi Chen [Thu, 6 Feb 2020 19:58:11 +0000 (11:58 -0800)]
[CI][DOCKER] Update ci-gpu to v0.60 (#4827)

4 years agoIt's gpu not cpu. (#4832)
Just do it [Thu, 6 Feb 2020 17:25:06 +0000 (01:25 +0800)]
It's gpu not cpu. (#4832)

4 years ago[TOPI][Relay] Add bitwise ops (#4815)
abergeron [Thu, 6 Feb 2020 03:24:42 +0000 (22:24 -0500)]
[TOPI][Relay] Add bitwise ops (#4815)

* Add bitwise ops to topi

* Add the bitwise ops to relay.

4 years ago[CONTRIB][CC] Enhance cc.cross_compiler (#4817)
Tianqi Chen [Thu, 6 Feb 2020 02:49:24 +0000 (18:49 -0800)]
[CONTRIB][CC] Enhance cc.cross_compiler (#4817)

* [CONTRIB][CC] Enhance cc.cross_compiler

- Enhance cc.cross_compiler to take str argument.
- Remove cc.build_create_shared_func as it is dupilicated with cross_compiler
- Add examples to cc.cross_compiler

* address review comments

4 years ago[Relay] Conv2D padding representation (#4787)
Xingyu Zhou [Wed, 5 Feb 2020 23:33:45 +0000 (07:33 +0800)]
[Relay] Conv2D padding representation (#4787)

* enforce 4-way padding

* add util with get_pad_tuple

* delete unnecessary arguments

* fix lint

* add container.Array case

* fix cudnn conv2d asymmetric padding logic

* rename get_pad_tuple to get_pad_tuple2d

* revert change for topi/python/topi/nn/conv2d.py

* add get_pad_tuple2d for several contrib conv2d ops

* add get_pad_tuple2d for all conv2d ops

4 years ago[Relay][Frontend][TFLite] Add parser support for logical operators (#4642)
Ina Dobreva [Wed, 5 Feb 2020 20:12:44 +0000 (20:12 +0000)]
[Relay][Frontend][TFLite] Add parser support for logical operators (#4642)

* [Relay][Frontend][TFLite] Add parser support for logical operators

* Add parser support for logical_and, logical_or
* Add boolean dtype as a valid tensor type
* BOOLEAN dtype is supported only from tf 1.15
  so logical ops work only in that and newer versions
* Logical_not is ommited since tflite can't convert it -->
  throws errors for addv2

* Add TFLite vesion check in tests for logical ops

* Check is added because of boolean dtype lack of support

4 years ago[QNN] Optimize lowering for requantize and FixedPointMultiply. (#4798)
Animesh Jain [Wed, 5 Feb 2020 19:52:18 +0000 (11:52 -0800)]
[QNN] Optimize lowering for requantize and FixedPointMultiply. (#4798)

* [QNN] Optimize lowering for requantize and FixedPointMultiply.

* Add check for requantize scale gt 1.

* Added test case.

4 years ago[Frontend][TFLite] Dynamically calculate input_stats of any fake_quant range (#4789)
Ina Dobreva [Wed, 5 Feb 2020 19:51:59 +0000 (19:51 +0000)]
[Frontend][TFLite] Dynamically calculate input_stats of any fake_quant range (#4789)

* [TFLite] Dynamically calculate input_stats of any fake_quant range

* pass the input range to the convertor and caclulate (mean, scale) there
* change the range of the second tensor in elemwise operations
  so that we test inputs with different quant params
* change the possible output range for elemwise ops wrt the updated ranges
* update the comments for (m, s) calculations
* add input range dict to reduce_mean op

* Apply requested changes

* add exception handling for zero division in input_stats
* fix range of the input tensor in elemwsie

4 years agoFixed subprocess creation under windows (#4820)
Seyyed Hossein Hasanpour [Wed, 5 Feb 2020 18:07:29 +0000 (21:37 +0330)]
Fixed subprocess creation under windows (#4820)

* fixed subprocess creation under windows

this addresses  the issue #4819

* Update server.py

4 years ago[REFACTOR][PY] Establish tvm.runtime (#4818)
Tianqi Chen [Wed, 5 Feb 2020 17:00:03 +0000 (09:00 -0800)]
[REFACTOR][PY] Establish tvm.runtime (#4818)

* [REFACTOR][PY] Establish tvm.runtime

This PR establishes the tvm.runtime namespace that contains the core runtime data structures.
The top-level API are kept inact for now via re-exporting.

We will followup later to cleanup some of the top-level APIs.

* Fix ndarray name

4 years agoMxnet parser for Qnn dialect (#4714)
shoubhik [Wed, 5 Feb 2020 13:27:52 +0000 (05:27 -0800)]
Mxnet parser for Qnn dialect (#4714)

* - Additional util methods needed for mxnet frontend for qnn dialect.

* - Fixing call to quantize.

* [QNN] MxNet-MKLDNN parser support for QNN

* [QNN] Relax conv check.

* - Merge from origin

* [QNN] Channel wise changes

* [QNN] Dense changes

* Dense fix for QNN ops.

* - Removed non-mkl code from utils.

- Small refactoring

- Remove "with_sum" from conv

- Simplified code

* - Fixing ring buffer name.

* - Fixing pylint issues.

* - Fixing lint
- Removing redundant commented code.

* - Adding test cases
- Removing unused methods.

* [WIP] end to end test case for mxnet qnn parser

* Changes to parse large CV models.

* Pylint issues.

* Fix Conv2D with sum and quantized pooling.

* Reverting the changes made for mxnet-mkldnn test cases. Because of #4753, mxnet could not be updated to mxnet-mkldnn.

Co-authored-by: Animesh Jain <anijain@umich.edu>
4 years agoallow customize mkldnn library location (#4814)
Haichen Shen [Wed, 5 Feb 2020 06:04:41 +0000 (22:04 -0800)]
allow customize mkldnn library location (#4814)

4 years ago[REFACTOR][PY] tvm._ffi (#4813)
Tianqi Chen [Wed, 5 Feb 2020 01:01:01 +0000 (17:01 -0800)]
[REFACTOR][PY] tvm._ffi (#4813)

* [REFACTOR][PY] tvm._ffi

- Remove from __future__ import absolute_import in the related files as they are no longer needed if the code only runs in python3
- Remove reverse dependency of _ctypes _cython to object_generic.
- function.py -> packed_func.py
- Function -> PackedFunc
- all registry related logics goes to tvm._ffi.registry
- Use absolute references for FFI related calls.
  - tvm._ffi.register_object
  - tvm._ffi.register_func
  - tvm._ffi.get_global_func

* Move get global func to the ffi side

4 years ago[TOPI][x86] Injective schedule improvement (#4786)
Animesh Jain [Tue, 4 Feb 2020 23:25:46 +0000 (15:25 -0800)]
[TOPI][x86] Injective schedule improvement (#4786)

* [TOPI][x86] Injective Schedule Improvement.

* Add tiling.

* Vectorize when there is an axis.

4 years agofix memory leak (#4811)
Haichen Shen [Tue, 4 Feb 2020 21:14:15 +0000 (13:14 -0800)]
fix memory leak (#4811)

4 years ago[AutoTVM] Minor bug fixes in AutoTVM for QNN graphs (#4797)
Animesh Jain [Tue, 4 Feb 2020 17:32:45 +0000 (09:32 -0800)]
[AutoTVM] Minor bug fixes in AutoTVM for QNN graphs (#4797)

* [AutoTVM] Minor bug fixes in AutoTVM for QNN graphs.

* Bring back strided_slice.

* Replace tvm.nd change.

4 years ago[DOCS] Fix vta tutorial (#4809)
Tianqi Chen [Tue, 4 Feb 2020 17:21:51 +0000 (09:21 -0800)]
[DOCS] Fix vta tutorial (#4809)

4 years ago[LINT] Fix -Wextra (#4804)
Tianqi Chen [Tue, 4 Feb 2020 04:47:51 +0000 (20:47 -0800)]
[LINT] Fix -Wextra (#4804)

* [LINT] Fix -Wextra

* Fix virtual-dtor

4 years ago[TOPI] upsample operator 'NCHWinic' format support. (#4791)
Hua Jiang [Mon, 3 Feb 2020 19:36:53 +0000 (11:36 -0800)]
[TOPI] upsample operator 'NCHWinic' format support. (#4791)

* [TOPI] upsample operator 'NCHWinic' format support.

some hardware accelerator ask packed format data like NCHWinic to fit the
hardware resource, here add upsample NCHWinic format support to help
such requirement.

* address review comments, add assert for 'else must be NCHWxc' logic.

4 years ago[TIR] Create a StringImm reference type (#4806)
mbarrett97 [Mon, 3 Feb 2020 17:55:43 +0000 (17:55 +0000)]
[TIR] Create a StringImm reference type (#4806)

This is motivated by the want to send an
array of strings across the python/C++
boundary. Arrays only support ObjectRef types
and so can't carry StringImmNodes. This creates
a string reference type, StringImm, which can
be used with tvm::Arrays.

Change-Id: I598a44536c156b97dbfe3e9518e0a1f705da850c

4 years ago[ThreadPool] Solve ARM BIG.LITTLE heterogeneous multicores (#4747)
Zhao Wu [Mon, 3 Feb 2020 17:53:13 +0000 (01:53 +0800)]
[ThreadPool] Solve ARM BIG.LITTLE heterogeneous multicores (#4747)

4 years agoChange color channel from BGR to RGB for darknet preprocessing (#4794)
vizero1 [Mon, 3 Feb 2020 04:03:57 +0000 (05:03 +0100)]
Change color channel from BGR to RGB for darknet preprocessing (#4794)

4 years ago[QNN] Conv2D with dilation support. (#4796)
Animesh Jain [Mon, 3 Feb 2020 02:56:45 +0000 (18:56 -0800)]
[QNN] Conv2D with dilation support. (#4796)

4 years ago[QNN] Doc fix on convolution and dequantize (#4799)
masahi [Mon, 3 Feb 2020 02:53:41 +0000 (11:53 +0900)]
[QNN] Doc fix on convolution and dequantize (#4799)

* QNN doc fix on conv and dequantize

* fix param name in tflite frontend

* make different fix

4 years agofix #4670: add bias for fc layer (#4801)
kshitij12345 [Sun, 2 Feb 2020 18:57:12 +0000 (00:27 +0530)]
fix #4670: add bias for fc layer (#4801)

4 years ago[Relay] Expose vm OptimizeModule to Python (#4800)
masahi [Sun, 2 Feb 2020 02:04:44 +0000 (11:04 +0900)]
[Relay] Expose vm OptimizeModule to Python (#4800)

* Expose VM OptimizeModule to python

* added missing imports

* fix import

4 years agoAdd schedule for conv3d NDHWC layout (#4775)
Alex Gladkov [Sat, 1 Feb 2020 01:43:27 +0000 (17:43 -0800)]
Add schedule for conv3d NDHWC layout (#4775)

4 years ago[Relay][Topi] Use SimplifyInference for L2 Normazlization. (#4795)
Animesh Jain [Fri, 31 Jan 2020 22:29:08 +0000 (14:29 -0800)]
[Relay][Topi] Use SimplifyInference for L2 Normazlization. (#4795)

4 years agoDedup BindParamByName function in VM compiler (#4793)
masahi [Thu, 30 Jan 2020 19:09:48 +0000 (04:09 +0900)]
Dedup BindParamByName function in VM compiler (#4793)

4 years agoFix parsing of different exception string formats (#4785)
jmorrill [Thu, 30 Jan 2020 16:43:16 +0000 (08:43 -0800)]
Fix parsing of different exception string formats (#4785)

4 years ago[Relay][Frontend][TFlite] Add add parser support for relational ops (#4695)
Ina Dobreva [Thu, 30 Jan 2020 14:10:52 +0000 (14:10 +0000)]
[Relay][Frontend][TFlite] Add add parser support for relational ops (#4695)

Add support for: greater_equal, less, less_equal, equal, not_equal
Add tests for the elemwise relational ops

4 years agoMake sure to visit the arguments of inlined functions (#4783)
abergeron [Thu, 30 Jan 2020 02:33:39 +0000 (21:33 -0500)]
Make sure to visit the arguments of inlined functions (#4783)

4 years ago[AUTOTVM] Fix a bug in generating the search space (#4779)
wpan11nv [Wed, 29 Jan 2020 03:40:39 +0000 (19:40 -0800)]
[AUTOTVM] Fix a bug in generating the search space (#4779)

- Do not use numpy.prod which ignores integer (64 bits) overflows.
  This leads to an incorrect number of points in the search space.

4 years ago[Python] Replace os.path.exists with try...except...else (#4784)
hlu1 [Wed, 29 Jan 2020 01:58:36 +0000 (17:58 -0800)]
[Python] Replace os.path.exists with try...except...else (#4784)

4 years ago[PassManager] Implement pass manager tracing API (#4782)
Jared Roesch [Tue, 28 Jan 2020 11:25:52 +0000 (03:25 -0800)]
[PassManager] Implement pass manager tracing API (#4782)

* Implement pass tracing API

* Set is_before correctly

* Add docs for trace function

* Fix lint

* Remove PDB

* Ensure trace_func is set before calling

* Fix conditional

4 years agoSafe remove tmpdir (#4781)
Cody Yu [Tue, 28 Jan 2020 00:10:35 +0000 (16:10 -0800)]
Safe remove tmpdir (#4781)

4 years ago[Relay][Frontend][ONNX] Broadcast condition, x, and y for Where op (#4774)
Jon Soifer [Mon, 27 Jan 2020 23:40:25 +0000 (17:40 -0600)]
[Relay][Frontend][ONNX] Broadcast condition, x, and y for Where op (#4774)

* ONNX frontend broadcast condition

* fix

* fix style

Co-authored-by: Jon Soifer <jonso@microsoft.com>
4 years agoproperly extract error type from windows error message (#4780)
Jon Soifer [Mon, 27 Jan 2020 22:58:11 +0000 (16:58 -0600)]
properly extract error type from windows error message (#4780)

Co-authored-by: Jon Soifer <jonso@microsoft.com>
4 years ago[Build] Explicitly link to cublasLt if it exists (#4776)
Jon Soifer [Mon, 27 Jan 2020 22:27:55 +0000 (16:27 -0600)]
[Build] Explicitly link to cublasLt if it exists (#4776)

* Explicitly link to cublasLt

* Only link cublasLt if it's found

Co-authored-by: Jon Soifer <jonso@microsoft.com>
4 years agoUpdate tune_simple_template.py (#4778)
Kaiyan Chang [Mon, 27 Jan 2020 00:41:46 +0000 (08:41 +0800)]
Update tune_simple_template.py (#4778)

fixed a spelling mistake.

4 years agoBump prebuilt-image version in demo dockerfile (#4770)
HUAN-PING SU [Sat, 25 Jan 2020 22:55:55 +0000 (06:55 +0800)]
Bump prebuilt-image version in demo dockerfile (#4770)

4 years ago[Bugfix][Frontend][TF] Fix incorrect calculations in tf SLICE (#4518)
Ina Dobreva [Fri, 24 Jan 2020 06:41:56 +0000 (06:41 +0000)]
[Bugfix][Frontend][TF] Fix incorrect calculations in tf SLICE (#4518)

* fix formula for calculating end indices when size[i] == -1
* add a test case for size[i] == -1
* discard expanding dimension of begin_value & end_value since
  it is needed only if you pass them as scalars not as tensors.
* discard 'slice_tensor' variable so that implementation matches
  the tf parser pattern

4 years agoadd missing nullptr check (#4773)
masahi [Fri, 24 Jan 2020 05:01:47 +0000 (14:01 +0900)]
add missing nullptr check (#4773)

4 years ago[TOPI] Remove cpp upsampling and resize op (#4769)
masahi [Fri, 24 Jan 2020 03:19:48 +0000 (12:19 +0900)]
[TOPI] Remove cpp upsampling and resize op (#4769)

* remove cpp upsampling

* remove cpp resize

4 years agoFix Tensorflow conv3d pad bug, add non-cubic data and kernel tests (#4772)
Alex Gladkov [Fri, 24 Jan 2020 03:17:45 +0000 (19:17 -0800)]
Fix Tensorflow conv3d pad bug, add non-cubic data and kernel tests (#4772)

4 years ago[Doc] TVM_REGISTER_API -> TVM_REGISTER_GLOBAL (#4768)
hlu1 [Fri, 24 Jan 2020 00:48:25 +0000 (16:48 -0800)]
[Doc] TVM_REGISTER_API -> TVM_REGISTER_GLOBAL (#4768)

4 years ago[VTA] Support network which have no unique operator as start/stop name for graph...
Hua Jiang [Thu, 23 Jan 2020 22:05:07 +0000 (14:05 -0800)]
[VTA] Support network which have no unique operator as start/stop name for graph pack. (#4703)

* [VTA] Support network which have no unique operator as start/stop name
for graph pack.

[Issue]
  Current vta use 'start' and 'stop' name to define the pack start point
  and end point, but this method not work for these network which have
  no 2 unique operator as  start point and stop point.

[Solution]
  In this solution we give 2 addtional parameters start_name_indx and
  stop_name_indx to make vta pack logic work with the said network,
  for exampl for following networks which have no unique operator,

  %0 = nn.add
  %1 = nn.conv2d
  %2 = nn.batch_norm
  %3 = nn.leaky_relu
  %4 = nn.add
  %5 = nn.conv2d
  %6 = nn.batch_norm
  %7 = nn.leaky_relu
  %8 = nn.add

  with this solution we can use following parameter format to make
  vta work on it.

  relay_prog = graph_pack(
                //....
                start_name="nn.add",
                stop_name="nn.add",
                start_name_idx=0,
                stop_name_idx=4)

  to apply on new network, by printing the network we can get index information like following.

  print(mod.astext(show_meta_data=False))
  relay_prog = graph_pack(mod
                          ...
                          start_name="nn.add",
                          stop_name="nn.add",
                          start_name_idx=0,
                          stop_name_idx=4)

* address review comments and fix index count bug

issue:
when do print(mod), the output not only the Call is also have other type
like Var, need add logic to count all except meta.

solution:
add related logic

* address review comments.

* address review comments

* add more detail comments.

4 years agopooling.cc improvements (#4767)
Alexander Pivovarov [Thu, 23 Jan 2020 00:47:15 +0000 (16:47 -0800)]
pooling.cc improvements (#4767)

4 years agoImprove CUDA conv2d_transpose_nchw (#4762)
Alex Gladkov [Wed, 22 Jan 2020 13:41:46 +0000 (05:41 -0800)]
Improve CUDA conv2d_transpose_nchw (#4762)

- combine pad and dilate;
- fix for the issue https://discuss.tvm.ai/t/compile-error-for-cuda-target/4164
- fix for the issue https://github.com/apache/incubator-tvm/pull/4472

4 years agoRemove run_infer_type duplicates (#4766)
Alexander Pivovarov [Wed, 22 Jan 2020 06:30:02 +0000 (22:30 -0800)]
Remove run_infer_type duplicates (#4766)

4 years agoFix padding in pooling op (#4738)
Alexander Pivovarov [Wed, 22 Jan 2020 02:21:10 +0000 (18:21 -0800)]
Fix padding in pooling op (#4738)

4 years ago[REFACTOR] driver.h -> driver_api.h (#4760)
Tianqi Chen [Wed, 22 Jan 2020 00:51:07 +0000 (16:51 -0800)]
[REFACTOR] driver.h -> driver_api.h (#4760)

"driver" normally refers to the "main" function.
Rationale: the header exposes set of APIs to drive compilation
and should be named as driver api to best reflect its usage.

4 years ago[Docs] Bring Your Own Codegen Guide -- Part 2 (#4718)
Cody Yu [Tue, 21 Jan 2020 21:50:20 +0000 (13:50 -0800)]
[Docs] Bring Your Own Codegen Guide -- Part 2 (#4718)

* BYOC Tutorial -- part 2

* Fix comments

* Address comments

4 years ago[INFO] Add .asf.yaml for github info (#4761)
Tianqi Chen [Tue, 21 Jan 2020 21:44:50 +0000 (13:44 -0800)]
[INFO] Add .asf.yaml for github info (#4761)

4 years ago[REFACTOR] top->te (#4759)
Tianqi Chen [Tue, 21 Jan 2020 19:58:21 +0000 (11:58 -0800)]
[REFACTOR] top->te (#4759)

Bring up namespace te -- Tensor expression language DSL.

4 years ago[REFACTOR] Establish printer in the source folder (#4752)
Tianqi Chen [Tue, 21 Jan 2020 04:06:17 +0000 (20:06 -0800)]
[REFACTOR] Establish printer in the source folder (#4752)

* [REFACTOR] Establish printer in the source folder.

As we move towards the unified IR, we will eventually want to build a unified
printers for both relay and TIR.

This PR isolate the printer component into a separate folder in src as a first step.

- Refactored the Doc DSL using Object, clean up APIs.
- Isolate out the meta data into a header.
- move printer into relay_text_printer, add comments about further TODos.

* Rename NodePrinter -> ReprPrinter to distinguish it from other printers

4 years agoExpose relay BindParamsByName to Python (#4751)
masahi [Mon, 20 Jan 2020 22:32:22 +0000 (07:32 +0900)]
Expose relay BindParamsByName to Python (#4751)

* expose BindParamByName to python

* fixed alpha equal test

4 years ago[REFACTOR][TYPE] Finish move all types to IR. (#4746)
Tianqi Chen [Mon, 20 Jan 2020 22:01:31 +0000 (14:01 -0800)]
[REFACTOR][TYPE] Finish move all types to IR. (#4746)

* [REFACTOR][TYPE] Finish move all types to IR.

- Move definition of Ref and TensorType to ir
- Move type_functor.h to public header.
- Rename RefType -> RelayRefType for clarity.

* Add atol

4 years agoAdd CUDA conv2d for NHWC layout (#4737)
Alex Gladkov [Mon, 20 Jan 2020 01:18:51 +0000 (17:18 -0800)]
Add CUDA conv2d for NHWC layout (#4737)

4 years ago[REFACTOR][CODEGEN] codegen->target, build_module->driver (#4742)
Tianqi Chen [Sun, 19 Jan 2020 17:53:22 +0000 (09:53 -0800)]
[REFACTOR][CODEGEN] codegen->target, build_module->driver (#4742)

This PR moves the codegen related code into the target folder,
as they are target specific functionalities.

We also adopt the term "compiler driver" in common compiler infra
such as rust, GHC and clang.
As a result, build_module is moved into the driver folder.

4 years agoFix demo dockerfile build failed (#4744)
HUAN-PING SU [Sun, 19 Jan 2020 06:47:08 +0000 (14:47 +0800)]
Fix demo dockerfile build failed (#4744)

4 years ago[REFACTOR] Establish tir (#4740)
Tianqi Chen [Sun, 19 Jan 2020 06:44:50 +0000 (22:44 -0800)]
[REFACTOR] Establish tir (#4740)

TIR is the new namespace for low-level IR
for tensor-level optimizations and loop transformations.

This PR establishes the namespace and files.

- lowered_func.h,buffer.h,data_layout.h -> tir/buffer.h,tir/data_layout.h,tir/lowered_func.h
- ir.h -> tir/expr.h, tir/stmt.h
- ir_functor_ext.h -> tir/expr_functor.h, tir/stmt_functor.h

4 years agoFix dense (#4728)
Haichen Shen [Sat, 18 Jan 2020 17:05:46 +0000 (09:05 -0800)]
Fix dense (#4728)

4 years ago[runtime][refactor] Unify vm and interpreter objects (#4693)
Zhi [Sat, 18 Jan 2020 17:04:47 +0000 (09:04 -0800)]
[runtime][refactor] Unify vm and interpreter objects (#4693)

* unify vm and interpreter objects

* move closure back vm

* adt/closure back to vm.adt/vm.closure

* closure base

4 years ago[CodeGen][CUDA] Improve CUDA vectorizer (#4736)
wpan11nv [Sat, 18 Jan 2020 02:58:11 +0000 (18:58 -0800)]
[CodeGen][CUDA] Improve CUDA vectorizer (#4736)

- Fixes issues to enable fp16 vectorizer. Now correct packing and
  unpacking CUDA code will be emitted. Enabled more unit tests.

- Do not emit code to read the first lane from an undef variable

  int _3;
  _3 = _3 & ~(0x000000ff << 0) | ...

  and emit the following code instead:

  _3 = (((0x000000ff & (_1 >> 0))+(0x000000ff & (_2 >> 0))) << 0);

  Note that nvcc 10.2 is forgiving and emits the same code for both cases.
  A warning appears in test_codegen_cuda.py.

Signed-off-by: Wei Pan <weip@nvidia.com>
4 years ago[VTA][TSIM] Enable TSIM CI Testing (#4407)
Liangfu Chen [Fri, 17 Jan 2020 23:23:49 +0000 (07:23 +0800)]
[VTA][TSIM] Enable TSIM CI Testing (#4407)

* Update task_python_vta.sh

* install sbt=1.1.1 with apt-get

* update verilator_opt

* install verilator with major version 4.0

* disable multi-threading for now

* bug fix for correcting uop fetch address in LoadUop module

* bug fix for correcting uop fetch address in LoadUop module

* adjustment to read from dram_offset

* enable USE_THREADS with verilator 4.x

* DEBUG: try avoid core dump with verilator 4.x

* bug fix in LoadUop module

* log mega cycles in tsim

* download cat.png to avoid fetching in each run

* bug fix in LoadUop module

* solve dram_even/sram_even issue

* bug fix

* introduce scalalint in ci

* speedup tsim in ci

* bug fix

* lint scala code before building

* disable multi-threading

* split fsim/tsim script

* update Jenkins settings

* duplicate task_python_vta_fsim.sh as task_python_vta.sh for now

Co-authored-by: Thierry Moreau <tmoreau@octoml.ai>