Commit Graph

1125 Commits

Author SHA1 Message Date
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
zhuochen aae5cde8b9 workaround typing.Deque import error for Python 3.5 (#4254) 2019-11-05 09:51:36 -08:00
Trevor Morris 3f472f94b3 [Relay][Frontend][Tensorflow] Fix GatherV2, Add StopGradient (#4238)
* Add StopGradient. Add batch_dims attr to ignore list for GatherV2

* Trigger CI
2019-11-04 10:37:41 -08:00
Kim 996cf30e8d remove PEP498 f-string new feature for support python3.5 (#4250) 2019-11-04 08:04:02 -08:00
Yao Wang e9039d0452 Support reshape for dynamic shape in tf converter (#4185)
* Support reshape for dynamic shape in tf converter

* Only allow reshape directly after shape function for symbolic input shape

* Fix lint
2019-11-01 20:10:21 -07:00
Jared Roesch 2083513fcd Implement explicit IR representation of memory alloction (#3560) 2019-11-01 14:28:23 -07:00
Wei Chen 19164063aa [Relay][Prelude] Add more dtypes to tensor_t (#4233) 2019-11-01 13:37:58 -07:00
Kim cd717dea4d [ Relay ][ Frontend ][ Tensorflow ]add op add_n to relay/frontend/tensorflow.py (#4181) 2019-11-01 08:54:33 -07:00
KoolKoffee a6221a1f71 Fix typo in get_output doc-string (#4237) 2019-10-31 09:15:57 -07:00
Wei Chen 31b47c84b3 [Relay] Install Relay Prelude program in package install (#4227) 2019-10-30 15:54:56 -07:00
Jon Soifer b07b195264 [Relay][Topi][TensorFlow][ONNX][Lang] Add support for Any op (#4205)
* Add support for Any op

* Support ONNX frontend

* Add doc

* Add to relay docs

* Dummy change to retrigger CI
2019-10-30 11:43:09 -07:00
Josh Fromm 156aa5900a [Relay][Frontend][ONNX] New Operators and Opsets to Support BERT (#4197)
* Added slice v10

* Added constantofshape operation and small refactor.

* Finished one_hot implementation.

* Reshape working across all bert layers.

* Fixed constantofshape and removed code duplication.

* onnx model fully ingested.

* Working on improving onnx tests.

* Changed onnx testing to use onnxruntime instead of caffe2, also formatted.

* Add arbitrary output nodes to onnx frontend.

* Added v6 tiling for bert squad 8 support.

* Small syntax fixes

* Reduced code duplication in split opset versions.

* Added batch matmul test

* Added unstack split testing.

* Adde onehot test, needs a little cleanup probably.

* Replaced deprecated constant fill with constantofshape and updated tests accordingly.

* Added tests for new opset version of slice and tile.

* lint clean up

* Lint fixes

* Changed onnx dependency

* Went back to caffe2 runtime for CI integration.

* Rebase and small typo/syntax changes.

* Added hard casting of onehot attributes to int.
2019-10-30 11:24:47 -07:00
Tianqi Chen 71f39be5a3 [PYTHON] Add __init__ to the generated grammar so that it can be installed properly (#4223) 2019-10-30 11:17:33 -07:00
shoubhik 2be444f905 Improve the lowering of Qnn Dense (#4213)
* [QNN] Improving Dense lowering.

* - Moving get_shape method to util
- Finalizing the test cases and the code structure for optimized dense computation.

* - Fixing cpplint.

* - Addressing review comments.

* - Renaming the variables correctly.

* - Renaming the variables correctly.
2019-10-30 09:12:14 -07:00
Logan Weber 09f0ac3385 [Relay] Add Python type functor and tests (#4209)
* Add Python type functor and tests

* Lint roller
2019-10-29 21:51:20 -07:00
LiangHao 2386e74b03 Optimizing autotvm task extraction speed (#4138)
* Optimize task extraction speed

* correct pylint errors

* Delete unused function

* remove unnecessary argument

* resolve code review comments

* corrent cpp lint errors

* remove one more graph_json return value

* fix test bugs
2019-10-29 11:45:02 -07:00
Wuwei Lin 794db3702b Update have_int8 condition to run on compute capability 7.x devices (#4214) 2019-10-29 21:23:23 +09:00
Wuwei Lin e8899285ea [Relay][Quantize] Use fixed point mulplications (#4160) 2019-10-29 00:51:29 -04:00
Xingyu Zhou 8b1fb4d592 [Relay][Op] Enhance Upsample Operator to support float scales (#4206)
* :add scale2 for upsample

* update unit test for upsampling

* support latest upsample op for multiple frontend

* fix lint

* fix lint

* fix lint

* fix lint

* update scale description and rebase
2019-10-28 11:34:56 -07:00
Logan Weber 319c279ddf Fix type var docs (#4208) 2019-10-28 11:03:32 -04:00
Jon Soifer 07606e4cb4 [Relay][Frontend][ONNX] Add support for op Where (#4184)
* Add support for op Where

* Update impl version
2019-10-26 17:05:22 -07:00
Jared Roesch 9cc7874166 [Relay][Params] Add APIs for storing and retrieving parameters from individual functions. (#4194)
* Add support for attaching params

* Fix types

* Fix test
2019-10-26 17:05:03 -07:00
Altan Haan 93d610a19a [Relay][Training] Add checkpoint annotation for checkpointing memory optimization (#4146)
* add checkpoint annotation for checkpointing memory optimization

* add alpha-equivalence checkpoint test and fix gradient type issue

* fix build issues

* ignore checkpoint annotation when checking missing gradients

* refactor, fix checkpoint compute for tuple and add tests
2019-10-26 17:04:42 -07:00
雾雨魔理沙 1ad6a2af67 [Relay] crossentropy_with_logits and its gradient (#4075)
* save

* lint
2019-10-25 17:54:29 +03:00
Siyuan Feng 324a9607eb TensorCore Support using Intrinsic (#4136)
* add tensor core support

* avoid memory bank conflict

* fix thread sync & better performance

* better performance

* add schedule test for conv2d

* extend into BatchMatMul

* support config fragment shape and layout using intrinsic

* add TensorCore tutorial

* add int support and fix lint

* address comment

* add 32*16*8 TensorCore test

* fix wmma include logic
2019-10-24 12:04:37 -07:00