Commit Graph

1199 Commits

Author SHA1 Message Date
Tianqi Chen 55bd786fe2 [REFACTOR][RUNTIME] Update NDArray use the Unified Object System (#4581)
* [REFACTOR][RUNTIME] Move NDArray to Object System.

Previously NDArray has its own object reference counting mechanism.
This PR migrates NDArray to the unified object protocol.

The calling convention of NDArray remained intact.
That means NDArray still has its own type_code and
its handle is still DLTensor compatible.

In order to do so, this PR added a few minimum runtime type
detection in TVMArgValue and RetValue only when the corresponding
type is a base type(ObjectRef) that could also refer to NDArray.

This means that even if we return a base reference object ObjectRef
which refers to the NDArray. The type_code will still be translated
correctly as kNDArrayContainer.
If we assign a non-base type(say Expr) that we know is not compatible
with NDArray during compile time, no runtime type detection will be performed.

This PR also adopts the object protocol for NDArray sub-classing and
removed the legacy NDArray subclass protocol.
Examples in apps/extension are now updated to reflect that.

Making NDArray as an Object brings all the benefits of the object system.
For example, we can now use the Array container to store NDArrays.

* Address review comments
2019-12-29 22:16:27 -08:00
Leyuan Wang fadea9229c [Perf] Add CublasLt extern support for better Igemm performance (#4550)
* cublaslt added

* fix lint

* address comments

* address more comments

* Trigger CI

* Trigger CI
2019-12-30 07:35:38 +09:00
Neo Chien f727810135 [GraphRuntime] Support parameter out in the graph runtime debug (#4598)
* [GraphRuntime] Support parameter out in the graph runtime debug

* Dummy commit to trigger build
2019-12-29 13:21:04 -08:00
optima2005 227c7af446 [FRONTEND][TF] conv2d_transpose 'SAME' support kernel more than 1x1 (#4484)
* [FRONTEND][TF] conv3d_transpose 'SAME' support kernel more than 1x1

* revised per as review comments

* add more fallback wolkaround to make all tests pass
2019-12-28 12:05:14 -08:00
zhuochen 3227614684 fix tf.compat.v1 issue for tf verison <=1.12 (#4593) 2019-12-28 12:04:41 -08:00
Wang Yucheng e6d9f89c1c [autotvm] fix typos in comment (#4591) 2019-12-27 11:22:42 -08:00
optima2005 c3deec194f [TOPI] add 3D upsampling Op. (#4584)
* [TOPI] add 3D upsampling Op.

* fix lint issues

* change align_corners to coordinate_transformation_mode

* fix resize3d half_pixel

* make a simple function and clean up trilinear_resize3d_python

* fix doc
2019-12-27 23:25:25 +09:00
Animesh Jain 73dda6be50 [Relay] Convert Layout Pass. (#4335) 2019-12-26 11:15:46 -08:00
黎明灰烬 672b0909dc [TOPI][AutoTVM] NHWC conv2d templates for ARM (#3859)
* [AutoTVM][TOPI] NHWC conv2d templates (spatial pack) for ARM

As some frontends (tflite for example) are using NHWC as the default
layout, we are enabling NHWC schedule templates in TOPI and AutoTVM.

* some comments fix
2019-12-26 09:36:31 -08:00
masahi a457df8a9b [Quantization, Calibrate] Fix context creation when current_target is explicity set (#4582) 2019-12-26 23:13:38 +09:00
kice 949c4d27ef Some Windows and MSVC fixes (#4569)
* fix python exception creation in Windows

* better string conversion for msvc

* fix cpp style issue
2019-12-25 13:42:03 -08:00
Tianqi Chen e91cc5aba8 [RUNTIME] Remove Extension VTable in favor of Unified Object system. (#4578)
Before the unified object protocol, we support pass
additional extension objects around by declaring a type as an extension type.
The old extension mechanism requires the types to register their
constructor and deleter to a VTable and does not enjoy the benefit of the
self-contained deletion property of the new Object system.

This PR upgrades the extension example to make use of the new object system
and removed the old Extension VTable.

Note that the register_extension funtion in the python side continues to work
when the passed argument does not require explicit container copy/deletion,
which covers the current usecases of the extension mechanism.
2019-12-25 09:21:01 -08:00
Tianqi Chen ff65698f40 [DEPRECATION] Cleanup legacy verilog support (#4576)
This PR cleans up the left over code for legacy verilog support which was experimental.
The new hardware backend path is now support by VTA via TSIM.
2019-12-24 15:14:03 -08:00
Bohan Hou c90160b229 [DOC] fix doc in api.py (#4580) 2019-12-24 08:51:05 -08:00
Josh Fromm 9b92c53913 [Relay/Topi][Op] Added native DepthToSpace and SpaceToDepth Operators (#4566)
* Added tvm function stencil for subpixel operations to topi.

* Topi subpixel operators added and tested.

* Added subpixel attrs.

* Added depth_to_space relay attributes.

* depth_to_space fully working.

* Fixed NHWC shape bug.

* SpaceToDepth in and all tests passing.

* lint fixes.

* Added string include

* Fixed topi formatting.

* Added DCR/CDR mode to depthtospace operator.
2019-12-23 21:04:34 -08:00
masahi 9ec0e5ce1a remove unnecessary cast to int32 (#4573) 2019-12-23 08:48:37 -08:00
Yong Wu f277da76e4 [Relay] add max_pool3d in relay and TF converter (#4551)
* [Relay] add max_pool3d in relay and TF converter

* fix comments
2019-12-23 10:43:33 +09:00
Tianqi Chen e6ff3f701b [TEST] Remove nnvm related code in topi and test script (#4562)
* [TEST] Remove nnvm related code in topi and test script

* Remove docs dep
2019-12-22 09:47:34 -08:00
Neo Chien 8acc413cf8 [Relay][Frontend][ONNX] Support auto_pad in Conv and ConvTranspose (#4563) 2019-12-22 09:03:39 -08:00
Zhao Wu f076c839ef Support standardize runtime module (#4532) 2019-12-21 20:14:40 -08:00
Tianqi Chen bc5367a07b [PYTHON][FFI] Cythonize NDArray.copyto (#4549)
* [PYTHON][FFI] Cythonize NDArray.copyto

* Cythonize the shape property
2019-12-20 14:21:09 -08:00
Takato Yamada e274e66eae [relay][op] add expand op (from ONNX) to relay frontend (#4483)
* Add Expand to onnx.py

* add test function for expand

* Fix a onnx frontend test

* Add tests for the value itself instead of shape only on test_expand

* Cleaned up some unnecessary modifications.
2019-12-18 09:58:37 -08:00
Alex Gladkov d430fbb586 Implement 1d deconvolution (#4476) 2019-12-18 12:35:22 -05:00
Zhi c44b7bf107 [Relay] External codegen (#4482) 2019-12-17 19:17:55 -08:00
lhutton1 603280bf6f PIL is depreciated and should be replaced with pillow (a fork of PIL) (#4533)
Change-Id: If2075df5475505f2da87dae7145af5a7ab83d8a4
2019-12-17 09:55:32 -08:00
masahi 093405d8b7 fix onnx shape dtype (#4528) 2019-12-16 08:11:53 -08:00
Cody Yu 8e3b5d39c3 fix empty config caused KeyError (#4520) 2019-12-15 22:37:43 -08:00
Josh Fromm f221844bd9 Fixed extra reshape parameter bug. (#4524) 2019-12-15 15:08:35 -08:00
SWu f10944c90c Fix bias_add gradient (#4516)
* Fix bias_add gradient

A change caused collapse_sum_like to reject implicit dimension
broadcasting for bias_add gradient, so switch to explicit sum reduction
on the non-bias axis dimensions.

* Lint fix
2019-12-13 15:09:56 -05:00
Alexander Pivovarov 6e085b4032 Fix TF resize for dynamic size models (#4510) 2019-12-13 09:42:58 -08:00
masahi 48a5aa066f [Quantization] Fix annotation for multiply op (#4458)
* fix mul rewrite

* register Realize Rewrite for global avg pool and add test

* remove unnecessary check

* improve the test case
2019-12-12 17:52:06 -05:00
Haichen Shen 123a40774c [Hybrid][Fix] Fix hybrid script to support array of tensors (#4494)
* [Fix][Hybrid] Fix hybrid script to support array of tensors

* add test case

* clean up

* trigger ci
2019-12-12 14:33:56 -08:00
Ramana Radhakrishnan 99fee85f25 Refactor bilinear and neighbour implementation in Tensorflow frontend (#4504)
There is significant duplication between functions.

Spotted while looking to move the tensorflow and tflite framework support to later than
1.13.1. The tests barf around resize_nearest_neighbour not ignoring the attribute
'helpful_pixel_centers'.

That upgrade is a separate discussion while this can go in
independently.

Thanks,
Ramana
2019-12-11 10:42:15 -08:00
Ina Dobreva 18592c8d9d [Relay][Frontend][TFlite] Add parses support for UNPACK tflite operator (#4447)
* use SPLIT & SQUEEZE = UNPACK as implemented in tensorflow parser
  Relay doesn't support UNPACK
* tflite 1.13: UNPACK doesn't work as exepcted -> copies the values from
  1st unpacked tensor to the other unpacks
* tflite 1.13: doesn't accept negative axis
2019-12-09 09:20:55 -08:00
Alexander Pivovarov 7cf1eadc64 Fix typo in travserse (#4469) 2019-12-06 00:35:20 -08:00
Zhi ba9d96bcb5 [relay][op] Add shape func to tile (#4441)
* [relay][op] Add shape func to tile

* retrigger ci

* check dynamic axes

* retrigger ci
2019-12-04 22:16:37 -08:00
Junru Shao 6ef2418b3e [BUGFIX] Fix search path for libtvm_topi.so (#4467) 2019-12-04 15:08:28 -08:00
ziheng 24713bde42 [CONTRIB] TFLite Runtime (#4439) 2019-12-04 10:09:31 -08:00
optima2005 7e32f3731d implement conv3d op (#4400)
* implement conv3d op

* add back missed conv2d_output_shape by mistake

* fix typo and docs, add topi test

* rebase to master and merge 2d/3d unification

* use cudnn.conv_forward
2019-12-04 17:44:07 +09:00
Tianqi Chen 279a8ebae6 [RUNTIME][RPC] Update RPC runtime to allow remote module as arg (#4462) 2019-12-03 15:14:07 -08:00
optima2005 77bdd5f78a [RUNTIME] Add cudnn conv3d (#4418)
* [RUNTIME] Add cudnn conv3d

* add output checking to test_cudnn.verify()

* fix tests failure

* revised per as review comments

* unify conv_output_shape, conv_find_algo and conv_forward

* convert python list to tvm.array in conv_forward

* revise per as comments

* 'pass as reference' for vector args

* add back con2d/3d seperated implementation

* remove unused included header

* remove extra std::vectors

* remove unused header
2019-12-04 06:18:19 +09:00
abergeron 6d88c98790 [TOPI][Relay][OP] Add a strided_set operation. (#4303) 2019-12-03 09:39:13 -08:00
Yong Wu e3eff20d8a [Relay] shape func for zeros, zeros_like, ones, ones_like (#4448) 2019-12-02 13:41:44 -08:00
Logan Weber 47c870a9eb [µTVM] Enable AutoTVM for ARM STM32F746XX Boards (#4274) 2019-12-02 10:38:12 -08:00
Alexander Pivovarov a1b6f46981 [TFLite] Add transpose_conv to TFLite parser (#4440) 2019-12-01 07:41:50 -08:00
Haichen Shen 2a8c6978b5 [Relay][Pass] Fix lambda lift pass for recursive call (#4432)
* Fix lambda lift

* clean up

* lint

* fix

* remove unused import
2019-11-30 16:27:15 -08:00
Thierry Moreau b16e2ff8b7 rpi4b target (#4445) 2019-11-28 10:12:49 -08:00
Zhao Wu 2d0010f368 [ARM CPU] Fix infer shape error of depthwise (#4384)
* [ARM CPU] Fix contrib_spatial_pack error

* PyLint error fix

* diable no-else-return as other files

* Change the test case split OC not be 1 to cover 5D weight layout
2019-11-26 22:42:20 -08:00
Haichen Shen bc69a534f6 Tweak debugger result (#4426) 2019-11-26 11:06:47 -08:00
Xingyu Zhou accc7db813 [AutoTVM] select model with the most tuned schedules (#4404)
* select model with the most tuned schedules

* change detect empty map method

* modify model description for load_reference_log
2019-11-26 10:17:25 -08:00