Commit Graph

1149 Commits

Author SHA1 Message Date
Neo Chien 2ed39e9183 [SETUP] Add optional dependencies to extras_require (#4428) 2019-11-26 09:48:24 -08:00
Haichen Shen 3d434e8450 [Fix][Relay] Remove schedule register for nonexisting log1p op (#4425) 2019-11-25 17:11:15 -08:00
Siyuan Feng dabde40f15 [Perf] Enhance cudnn and cublas backend and enable TensorCore (#4353)
* add half and mix precision support to cublas backend

* add TensorCore support in CuDNN

* enhance CuDNN support

* address comments and fix lint

* fix

* add fp16 test
2019-11-24 22:01:55 -08:00
Tianqi Chen 2f1685fe5f [LICENSE] clarify the blockingqueue license, update version to 0.6.0 (#4414) 2019-11-24 11:43:21 -08:00
Alexander Pivovarov 9049d669be [Relay][Legalize] Legalize conv2d_transpose for NHWC (#4399) 2019-11-22 21:59:15 -08:00
Zhi e0810512ad [TVM][RUNTIME] A minimum example to generate external library wrappers for DSOModule (#4280) 2019-11-22 15:31:50 -08:00
tristan-arm 0f4b32f9fb Added tflite frontend support for quantized mean. (#4339) 2019-11-22 13:34:40 -08:00
Haichen Shen 122a4930f2 [Relay][VM] Clean up the VM and VM profiler code (#4391)
* [VM] add a few more API to vm

* [VM][Fix] fix vm convert args

* [VM] a few fixes

* rename fields

* update

* update vm profiler

* x

* add doc

* lint

* fix test

* address comments
2019-11-21 16:01:01 -08:00
Huang, Guangtai 1bd5d7179c Update compile_engine.py (#4393) 2019-11-21 12:46:00 -08:00
Siyuan Li 0bbdad4bc5 [Relay][Frontend][TF] Fix slice when begin or size is not Const (#4372)
* fix slice bug when input is param

* use _infer_value rather than _infer_value_simulated
2019-11-21 10:53:37 -08:00
Thomas Viehmann 786d7998e1 add GPU checking before compilation for rocm (#4394)
Previously, we would rely on the later phases to error out
(often for using too much shared memory). This enables the
checks on the IR that already exist for CUDA and OpenCL also
for ROCm.
2019-11-21 23:40:29 +09:00
Liang ZOU eca26032af [doc] fix typo, codege to codegen (#4383) 2019-11-20 22:05:01 +09:00
Tianqi Chen d745d93551 [CI] Avoid content-length request in test data download (#4375) 2019-11-19 22:04:42 -08:00
Yizhi Liu f8f4ceb253 [nvcc] enable multiple arch in one fatbin (#4377) 2019-11-19 15:07:29 -08:00
Wuwei Lin 500ff05193 [Relay][Quantize] Integrate data-aware calibration into quantization (#4295)
* [Relay][Quantize] Integrate data-aware calibration into quantization

* Update _calibrate.py

* trigger ci

* Address comments

* address comments
2019-11-19 17:54:57 -05:00
Alexander Pivovarov 331f6fd012 Fix TFLite RESHAPE assert (#4320) 2019-11-19 09:15:08 -08:00
Animesh Jain 26eb405307 [Relay tests] AlterOpLayout - Temporary attr update (#4357) 2019-11-18 20:18:58 -08:00
Tianqi Chen 00521fab26 [SOURCE] Add ASF header to __init__.py files (#4359) 2019-11-18 10:22:25 -08:00
Yao Wang a226973ba7 [Frontend]Add TensorFlow FloorMod (#4308)
* Add tf FloorMod

* Add floor_div/mod into topi and relay

* Add to rst

* Fix test
2019-11-18 09:24:34 +05:30
optima2005 2baf310e98 [Relay][Frontend][Tensorflow]Add conv2d_transpose (#4300)
* [Relay][Frontend][Tensorflow]Add conv2d_transpose

* add transformation from NHWC to NCHW to compatible with TVM conv2d_transpose implementation

* remove 'dilations' paramater to compitable with TF1.3
2019-11-17 17:24:44 -08:00
Philip Hyunsu Cho 0d891bf343 Fix docstring in topi.nn.fifo_buffer (#4349) 2019-11-16 08:40:38 -08:00
Ramana Radhakrishnan 3ba9dd0920 Retain qnn input kernel scales (#4292)
* Add qnn conv2d attributes for input_tensor_scale and
kernel_tensor_scale.

The lowering in the tflite frontend loses the input_tensor_scale
and the kernel_tensor_scale by multiplying it and putting it into
the Requantize operation. This means that any graph partitioning
passes or other passes that need to access this information no longer
have it available in the qnn dialect.

regards
Ramana

* Store input tensor scale and Weight tensor scale for Dense as well

As for conv2d, the tflite frontend drops the input tensor
scale and the weight tensor scale from the relay op. Store
it as separate fields in there.

* Fix unintentional tab

* Rename input_tensor_scale to input_scale and kernel_tensor_scale
to kernel_scale for conv2d.

* input_tensor_scale -> input_scale weight_tensor_scale->weight_scale

* Rework dense testcase

And use input_scale and kernel_scale

* Be consistent in use of input_scale and kernel_scale values

* Fixup qnn conv2d tests for input_scale and kernel_scale

* Make pydoc identical between conv2d and dense for weight_tensor

* Fix up conv2d parameters to be in the same order between C++ and python

* Fix ordering of parameters for dense.

* Add input_scale and output_scale to try and satisfy ci gods

* Delete input_scale and kernel_scale.

nn.conv2d does not contain input_scale and kernel_scale. We need
to delete it when lowering it to nn.conv2d.

* Add input_scale and kernel_scale for qnn.conv2d
2019-11-16 08:39:19 -08:00
Animesh Jain 560280dd7c [Debugger] Sorting op-time breakdown for quicker analysis. (#4352) 2019-11-16 08:38:10 -08:00
黎明灰烬 ccde31f1d7 AutoTVM: selecting tuning templates when extracting task (#4338)
* AutoTVM: selecting tuning templates when extracting task

Make the procedure of trying new templates easier.

Test: tests/python/relay/test_autotvm_task_extraction.py

* Use dict to match key for topi ops

* fix lint issue

* be more pythonic :)
2019-11-15 19:53:01 -05:00
Logan Weber 2c5c4da697 [Relay][VM][Interpreter] Enable first-class constructors in VM and interpreter via eta expansion (#4218)
* Fix constructor pretty printing

* Make Module::HasDef name consistent with API

* Add VM constructor compilation via eta expansion

* Lint

* Fix CI

* Fix failing test

* Address comment

* Retrigger CI

* Retrigger CI
2019-11-15 14:12:52 -08:00
Alex Gladkov 888a3c35cf Bump up CUDA log version in tophub.py (#4347) 2019-11-15 11:04:00 -08:00
Zhao Wu b0b16a07e3 [CodeGen] Add build config option disable_assert to control whether to generate assert (#4340) 2019-11-15 10:05:26 -08:00
Jian Weng 9e6371fbae imp module is deprecated (#4275) 2019-11-15 09:13:04 -08:00
Neo Chien 510bd8f680 [Relay][Frontend][ONNX] operator support: DepthToSpace, SpaceToDepth (#4271) 2019-11-15 08:53:13 -08:00
Jon Soifer 1e2c525bb3 [Relay][Frontend][TF] Fix transpose when axes is not a param (#4327)
* [Relay][Frontend][TF] Use _infer_value_simulated when axes is not a const to Transpose

* uncomment tests

* dummy change to retrigger ci
2019-11-14 19:52:40 -08:00
Zhao Wu de1bfa4bf9 Solve custom model of prelu (#4326) 2019-11-14 19:43:38 -08:00
Ina Dobreva 70a3a61216 Add support for quant. mul operator in tflite frontend (#4283)
A test for qnn_mul has to be added when the qnn elemwise tests (#4282) get merged.
2019-11-14 19:41:36 -08:00
Wei Chen 7dca65526b [Relay][Pass] Add pass to remove unused functions in relay module (#4334)
* [Relay][Pass] Add pass to remove unused functions in relay module

* Add tests

* Fix lint

* Fix visit order

* Add pass argument

* Fix
2019-11-14 17:52:01 -08:00
Animesh Jain 3486e2c2cf [QNN][Legalize] Specialize for Platforms without any fast Int8 arithmetic units. (#4307) 2019-11-13 11:18:49 -08:00
Eric Platon e541c75863 Fix the TF tutorial to run against TF2.0 and TF1.x (#4104)
* WIP Run the TF tutorial on TF2

* Remove debugger statement.

* Complete the support for TF2.0's `resize`.

TF2.0 adds a `half_pixel_centers` attribute to the `resize` function in
the image API. This commit completes the hooks in Relay's TF frontend.

At the point of this commit, no new test yet. Also, this commit
addresses solely the `resize` change. Other commits address other
changes in TF2.0.

* Support TF2.0 in the tutorial by using the compat API.

This looks cleaner than trying to detect the TF version.

* Use the TF compat API, so as to support TF2.0.

This is a direct change, relying on the compat API provided by the TF
team.

This code will last as long as the compat API exists, so a
"proper" support for TF1.x and 2.x will require more work in some
future.

* Partial support for EXPLICIT padding introduced in TF2.0.

Explicit padding is a special case in TF2.0 (see reference linked
below). Some models are serialized with that mode, and break TF support
in TVM.

Support is *partial* as EXPLICIT falls back to set padding on the
Relay op, which only supports 2 values. At some point, padding may need
to be extended to support 4 values, but that is out of scope of this
support commit.

Reference on EXPLICIT padding: https://github.com/tensorflow/tensorflow/commit/ec81825aaf7e848d9f8ddffdf1e0d20aebe9172c#diff-1d1c0bb0a880f85b6164f71dbb2f446e

* Guard on checking for optional TF2.0 attribute.

* Do not expect Relay to implement TF-specific attributes.

The `half_pixel_centers` attribute is a new feature in TF2.0. Earlier
commits of mine mistakenly introduce them in the Relay API. This is
probably not what Relay is expected to support, and the semantics of
`half_pixel_centers` is unclear (to me, at least) at this point.

* Remove unclear comment.

CR https://github.com/dmlc/tvm/pull/4104#discussion_r338705742

Addresses #4104

* Changes after review.

Complying without understanding the rationale for now.

* Fix the arguments set mistakenly.

An argument ignored for the wrong operation.
2019-11-12 15:52:24 -08:00
Wei Chen 03a29da764 [Relay][Op][TF] Complete tensor array unstack with all ranks support (#4309) 2019-11-12 12:36:28 -08:00
Haichen Shen dddb0ed025 add (#4311) 2019-11-12 11:54:56 -08:00
Xingyu Zhou 83bac2d1d7 [Relay][Frontend][Keras] batch_norm op params not handling well (#4310)
* Relay Keras frontent batch_norm op params not handeling well

* add unit test for Relay Frontend Keras batch_norm
2019-11-12 10:30:04 -08:00
Neo Chien d184d2f839 [Relay][Frontend][Tensorflow] Fix type assignment for operator 'tf.range' (#4294) 2019-11-11 20:34:50 -08:00
Yao Wang 62521453a0 Add More Shape Functions (#4179)
* Add shape functions

* Fix get_const_tuple

* Fix cpplint

* Fix pylint

* Fix pylint

* rebase and fix

* Check Any for infer type

* Fix expand_dim shape func for zero rank input

* Fix pooling infer type

* Address comment

* Register layout transform attr
2019-11-11 15:46:29 -08:00
Wei Chen 10b77ef37a [TF][Relay][Op] Pass module when infer shape (#4287)
* [TF][Relay][Op] Pass module when infer shape

* Fix lint

* Improve style

* Add test
2019-11-11 11:22:14 -08:00
Tianqi Chen f823c57721 [RUNTIME][REFACTOR] Use object protocol to support runtime::Module (#4289)
Previously runtime::Module was supported using shared_ptr.
This PR refactors the codebase to use the Object protocol.

It will open doors to allow easier interpolation between
Object containers and module in the future.
2019-11-11 10:09:29 -08:00
Yao Wang 18f8581bbe Fix tf reshape (#4285)
* Fix tf reshape

* Fix test

* Fix pylint

* Fix pylint
2019-11-11 08:23:23 -08:00
Zhi cff62bdbd2 [tutorial] Relay pass infra tutorial (#4083)
* Add pass manager tutorial

* fix some examples

* retrigger ci

* Update tutorials/dev/relay_pass_infra.py

Co-Authored-By: 雾雨魔理沙 <lolisa@marisa.moe>

* Add ToANormalForm link
2019-11-10 21:57:43 -08:00
Zhao Wu 2f65a87f47 [TFLite] Support PRelu (#4298) 2019-11-10 11:45:10 -08:00
Minmin Sun (孙敏敏) d64bf6b51b Auto TensorCore CodeGen (#4234)
* Add Auto TensorCore TensorCore Unit Test

* Rebase to tvm master branch & Add auto tensor core

* Code Refine

* Add tensor core switch by pragma

* Add pragma in tensor core example code

* Get real tile size to replace hard coded 16

* support more than 2 dimensions (e.g. batchmatmul) for buffer bind scope

* support batch matmul

* Move cuda env check to tensor_core.cc

* Coderefine for tensor_core.cc

* Refine comments

* Some refinements of code and comment

* Update TensorCore UT to pass the CPU test

* remove redundant code

* matmul's storage align for different layout

* Add support for differenct position of type cast

* Add formal tutorial for auto tensorcore codegen

* move tensorcore check up to tutorial code

* code and doc refine

* comment out tune_and_evaluate in tutorial

* fix cpplint error
2019-11-09 13:01:36 -08:00
Jon Soifer 5bcd3313ee [Relay][Frontend][ONNX] Add support for broadcasting to Where and MatMul (#4267) 2019-11-07 14:10:30 -08:00
Josh Fromm 14a5a35882 [AutoTVM] Add batch_matmul to tunable operations (#4242)
* Batch matmul tuning running but with errors.

* Default x86 schedule as good as before.

* Code Cleanup

* Remove unused argument.

* improved template documentation.

* Silly lint fix

* Removed leftover comment.

* Moved cfg declaration to schedule for batch_matmul

* Moved x86 dense cfg declaration to schedule.

* lint fix

* Removed duplicate cfg declaration in dense.

* Reverted changes to dense.
2019-11-06 16:07:09 -08:00
Neo Chien ddaa953087 [Contrib] Fix error message at callback_get_section_size() (#4221)
* [Contrib] Fix error message at callback_get_section_size()

* Trigger notification
2019-11-06 10:39:40 -08:00
Tianqi Chen 86b844b995 [DOCS] Update link loc (#4257) 2019-11-05 16:03:04 -08:00