platform/upstream/tvm.git
3 years agoChange the meaning of conv3d_transpose output_padding to match conv{1,2}d_transpose...
abergeron [Wed, 5 Aug 2020 05:15:21 +0000 (01:15 -0400)]
Change the meaning of conv3d_transpose output_padding to match conv{1,2}d_transpose (#6065)

* Change the meaning of output_padding to correspond to conv{1,2}d_transpose

* Fix long lines

* Fix the relay test

* Add missing doc.

* fix size ordering problem

3 years ago [Rust] fix #6205 (#6207)
韩朴宇 [Wed, 5 Aug 2020 02:32:26 +0000 (10:32 +0800)]
 [Rust] fix #6205 (#6207)

3 years ago[COREML]Unary ops support added in frontend (#6196)
Siju Samuel [Tue, 4 Aug 2020 13:48:05 +0000 (19:18 +0530)]
[COREML]Unary ops support added in frontend (#6196)

* [COREML]Unary ops support added in frontend

* Used coreml enums

3 years ago[RELAY] Basic block normal form (#6152)
Haibin Lin [Tue, 4 Aug 2020 04:38:51 +0000 (21:38 -0700)]
[RELAY] Basic block normal form (#6152)

* initial commit

* refactor utils

* add util

* revert anf test

* update test

* fix logging

* fix scope bug

* complete tests

* remove logging

* revert refactoring

* add one more test case

* fix missing var binding

* fix test

* fix lint

* fix lint

* fix clang-format

* fix lint

* fix lint

* commit missing code

* add analysis api

* fix lint

* fix lint

* lint

* add test for func

* address CR

* fix typo

* fix return type

* fix lint

* refactor classes

* fix lint

* remove prints

* address comments

Co-authored-by: Ubuntu <ubuntu@ip-172-31-42-138.ec2.internal>
3 years ago[TFLite] Implemented PADV2 Operator for TFLite and added support for constant values...
Rishabh Jain [Tue, 4 Aug 2020 02:08:13 +0000 (07:38 +0530)]
[TFLite] Implemented PADV2 Operator for TFLite and added support for constant values in PAD. (#6167)

3 years ago[CI][ETHOSN] Enable CI for Ethos-N (#6171)
mbaret [Tue, 4 Aug 2020 02:04:16 +0000 (03:04 +0100)]
[CI][ETHOSN] Enable CI for Ethos-N (#6171)

This introduces the necessary changes to docker to
support building the Ethos-N driver stack. This is
required for subsequent patches which introduce
the Ethos-N integration into TVM.

Co-authored-by: Leo Blonk <Leo.Blonk@arm.com>
Co-authored-by: Leandro Nunes <leandro.nunes@arm.com>
# Please enter the commit message for your changes. Lines starting
# with '#' will be kept; you may remove them yourself if you want to.
# An empty message aborts the commit.
#
# Date:      Mon Jul 27 15:43:41 2020 +0100
#
# On branch ethosn-ci
# Changes to be committed:
# modified:   docker/Dockerfile.ci_cpu
# new file:   docker/install/ubuntu_install_ethosn_driver_stack.sh
#
# Untracked files:
# CombinedMemoryMap.hex
# OutputModel.hex
# config.txt
# docker/install/ethosn_cap/
# docker/install/ethosn_driver_dev-20.05-dbg-20200612-141030.tar.gz
# ssd.npy
# tests/python/integration/test_tir_gemm.py
# tests/python/relay/test_pattern_annotate.py
# tests/python/unittest/failure.py
#

3 years ago[DOCS] Added casting to hybrid script doc and fixed pass infra doc (#6174)
Lily Orth-Smith [Tue, 4 Aug 2020 01:51:25 +0000 (18:51 -0700)]
[DOCS] Added casting to hybrid script doc and fixed pass infra doc (#6174)

* updated hybridscript docs and pass infra docs

* forgot uint16

3 years ago[AutoScheduler] Fix alignment of note (#6181)
LiangLiu [Tue, 4 Aug 2020 01:51:03 +0000 (09:51 +0800)]
[AutoScheduler] Fix alignment of note (#6181)

* Fix alignment of note

* trigger CI

Co-authored-by: Lianmin Zheng <lianminzheng@gmail.com>
3 years ago[Target] Rename target_id => target_kind (#6199)
Junru Shao [Tue, 4 Aug 2020 01:50:32 +0000 (18:50 -0700)]
[Target] Rename target_id => target_kind (#6199)

3 years ago[TIR][Transform] HoistIfThenElse added (#6066)
ANSHUMAN TRIPATHY [Mon, 3 Aug 2020 20:50:11 +0000 (02:20 +0530)]
[TIR][Transform] HoistIfThenElse added (#6066)

* [TIR][Transform] HoistIfThenElse added

* lint error resolved

* Pass position changed

* pylint error resolved

* CI issues resolved

* Frontend tflite test case failure resolved

* [1] Review comment handled

* [2] Review comment handled

* [3] Review comment handled

* Lint error resolved

3 years ago[TIR] Enhance VerifyGPUCode (#6194)
Lianmin Zheng [Mon, 3 Aug 2020 20:23:07 +0000 (13:23 -0700)]
[TIR] Enhance VerifyGPUCode (#6194)

3 years ago[Fix] avoid unexpected throw in AttrInitEntry (#6128)
qiuhan [Mon, 3 Aug 2020 19:29:55 +0000 (03:29 +0800)]
[Fix] avoid unexpected throw in AttrInitEntry (#6128)

3 years ago[FoldConstant] Create Interpreter for each constant subgraph (#6195)
Animesh Jain [Mon, 3 Aug 2020 16:36:41 +0000 (09:36 -0700)]
[FoldConstant] Create Interpreter for each constant subgraph (#6195)

3 years ago[BUILD] Remove libtopi from the build (#6189)
Tianqi Chen [Sun, 2 Aug 2020 23:51:22 +0000 (16:51 -0700)]
[BUILD] Remove libtopi from the build (#6189)

3 years ago[CI] Remove topi from the CI cache (#6188)
Tianqi Chen [Sun, 2 Aug 2020 20:39:50 +0000 (13:39 -0700)]
[CI] Remove topi from the CI cache (#6188)

3 years ago[REFACTOR] topi -> tvm/topi (#6186)
Tianqi Chen [Sun, 2 Aug 2020 16:29:29 +0000 (09:29 -0700)]
[REFACTOR] topi -> tvm/topi (#6186)

This PR migrates the topi library as a sub namespace of tvm.

3 years ago[TEST] Temporary disable conv2d grad strided flaky test (#6183)
Tianqi Chen [Sat, 1 Aug 2020 03:24:29 +0000 (20:24 -0700)]
[TEST] Temporary disable conv2d grad strided flaky test (#6183)

3 years ago[FIX] Fixes #6096 (#6131)
Tristan Konolige [Fri, 31 Jul 2020 19:50:16 +0000 (12:50 -0700)]
[FIX] Fixes #6096 (#6131)

Clear the compile cache between module builds so that schedule changes
will have an effect. Also, clear the warning cache so that schedule
changes properly list untuned ops.

3 years ago[DOCS] Improve the docs build instructions (#6173)
Tianqi Chen [Fri, 31 Jul 2020 19:49:27 +0000 (12:49 -0700)]
[DOCS] Improve the docs build instructions (#6173)

3 years ago[Relay] Fix bug in transpose_shape_func (#6180)
lixiaoquan [Fri, 31 Jul 2020 15:06:37 +0000 (23:06 +0800)]
[Relay] Fix bug in transpose_shape_func (#6180)

3 years agoFix incorrect function signature in header (#6172)
Wuwei Lin [Thu, 30 Jul 2020 23:21:19 +0000 (19:21 -0400)]
Fix incorrect function signature in header (#6172)

3 years ago[BYOC] Retire the example json runtime (#6177)
Zhi [Thu, 30 Jul 2020 20:16:36 +0000 (13:16 -0700)]
[BYOC] Retire the example json runtime (#6177)

3 years agoBuffer logger assert removed (#6147)
ANSHUMAN TRIPATHY [Thu, 30 Jul 2020 16:58:23 +0000 (22:28 +0530)]
Buffer logger assert removed (#6147)

3 years ago[AutoScheduler] Improve doc string (#6176)
Lianmin Zheng [Thu, 30 Jul 2020 16:35:29 +0000 (09:35 -0700)]
[AutoScheduler] Improve doc string (#6176)

3 years ago[TF] Fix some shape mismatches between TF and Relay (#6166)
lixiaoquan [Wed, 29 Jul 2020 17:34:32 +0000 (01:34 +0800)]
[TF] Fix some shape mismatches between TF and Relay (#6166)

Make ndarray_size output scalar
  Make gather_nd output scalar if needed

3 years agofix bug when converting constant nodes with types of int64 or float64 (#6159)
sleepwalker2017 [Wed, 29 Jul 2020 17:30:03 +0000 (01:30 +0800)]
fix bug when converting constant nodes with types of int64 or float64 (#6159)

Co-authored-by: yuweilong <yuweilong03@meituan.com>
3 years ago[BYOC][ACL] Support asymmetric per-layer quantized operators (#6109)
lhutton1 [Wed, 29 Jul 2020 16:18:57 +0000 (17:18 +0100)]
[BYOC][ACL] Support asymmetric per-layer quantized operators (#6109)

* [BYOC][ACL] Support asymmetric per-layer quantization

Adds support for asymmetric per-layer quantization in the ACL runtime. This includes support for qnn.conv2d, nn.maxpool2d and reshape. Reflected these changes in codegen and runtime tests.

Change-Id: I8f610bd37af1e3740fd48c2d502bcc4727d9d712

* Address comments

Change-Id: I4f9e3e7dbf6053066927cf07c4c19ecc88572e9d

* Fix tutorial

Change-Id: I4371e9d97a120fb7776db40ffcde60f46927af4d

* Improve test infrastructure

* Doc-string for generate trials
* Output params on error

Change-Id: Ib2e2b1fcdf05cdc77f7f4fb4b46395f28c129957

3 years ago[Parser] Typo in mod creation (#6165)
Animesh Jain [Wed, 29 Jul 2020 15:56:23 +0000 (08:56 -0700)]
[Parser] Typo in mod creation (#6165)

3 years ago[CI] Update ci-cpu to the latest (#6164)
Tianqi Chen [Wed, 29 Jul 2020 15:34:38 +0000 (08:34 -0700)]
[CI] Update ci-cpu to the latest (#6164)

4 years ago[Ansor][AutoTVM v2.0] Phase 1: Add pragma/storage_align/rfactor steps (#6141)
Chenfan [Wed, 29 Jul 2020 06:39:21 +0000 (14:39 +0800)]
[Ansor][AutoTVM v2.0] Phase 1: Add pragma/storage_align/rfactor steps (#6141)

* Add pragma/storage_align/rfactor step

* Update

* Update

* Update UT

* Update

4 years agoImprove error messages in graph tuner, graph runtime, and module loader. (#6148)
Tristan Konolige [Wed, 29 Jul 2020 03:04:19 +0000 (20:04 -0700)]
Improve error messages in graph tuner, graph runtime, and module loader. (#6148)

* Raise error if no operators are found in GraphTuner

* Raise error if key cannot be found in graph runtime inputs

* Detailed error message when module loader is not found

4 years ago[Relay] Handle ndarray_size in FoldConstant (#6156)
lixiaoquan [Tue, 28 Jul 2020 22:49:21 +0000 (06:49 +0800)]
[Relay] Handle ndarray_size in FoldConstant (#6156)

* [Relay] Handle ndarray_size in FoldConstant

* Use Optional

4 years ago[Topi, x86] Using MKL blas for quantized dense (#6115)
Animesh Jain [Tue, 28 Jul 2020 20:32:00 +0000 (13:32 -0700)]
[Topi, x86] Using MKL blas for quantized dense (#6115)

* [Topi, x86] Using MKL blas for quantized dense

* Typo

* CBLAS_OFFSET only available for MKL

* Skipping tests as GPU CI uses Openblas

* Retrigger

Co-authored-by: Ubuntu <ubuntu@ip-172-31-0-202.us-west-2.compute.internal>
4 years agoCorrect runtime.load_module (#6161)
Tianqi Chen [Tue, 28 Jul 2020 20:18:14 +0000 (13:18 -0700)]
Correct runtime.load_module (#6161)

4 years ago[TIR][Bugfix] Improved massive build times caused by tir.floormod and tir.floordiv...
dprankratz [Tue, 28 Jul 2020 16:06:06 +0000 (10:06 -0600)]
[TIR][Bugfix] Improved massive build times caused by tir.floormod and tir.floordiv. Fixed Topi testcase. (#5666)

* Improved uncommon case of floormod and floordiv. Removed dependence on np floor_div and fmod.

* Fixed clang-format complaints

* Streamlined floormod and floordiv lowering logic

* Improved build times by expressing int64 case of tir FloorMod and FloorDiv using let nodes

* Updated use-def analysis and llvm codegen to support duplicated letnodes.

* Corrected misuse of var_map_ in llvm codegen

* Updated backends that support LetNode

* Changed floormod and div lowering logic to avoid using FP on systems that don't support it.

* Fixed formatting

Co-authored-by: pankratz <pankratz@ualberta.ca>
4 years ago[CI][Caffe Frontend] add caffe environment (#6023)
FernChen [Tue, 28 Jul 2020 15:58:26 +0000 (23:58 +0800)]
[CI][Caffe Frontend] add caffe environment (#6023)

* [CI][Caffe Frontend] add caffe environment

* [CI][Caffe Frontend] change the caffe deps into BVLC distribution.

* [CI][Caffe Fronted] simplify configuration while installing tzdata for precompiled caffe.

* [CI][Caffe Frontend] add more information about tzdata.

* [CI][CaffeFrontend]remove the ci for gpu env and change to pip3 env

Co-authored-by: fernchen <zifeng.cf@alibaba-inc.com>
4 years ago[Ansor][AutoTVM v2.0] Phase 1: Add follow_split and follow_fused_split steps (#6142)
jiuqi-yang [Tue, 28 Jul 2020 14:49:05 +0000 (22:49 +0800)]
[Ansor][AutoTVM v2.0] Phase 1: Add follow_split and follow_fused_split steps (#6142)

* Add cache_read/cache_write step

* Update

* Add follow split and follow fused split

Signed-off-by: jingbang.yjb <jingbang.yjb@alibaba-inc.com>
Conflicts:
src/auto_scheduler/compute_dag.cc
src/auto_scheduler/transform_step.cc
src/auto_scheduler/transform_step.h
tests/python/unittest/test_auto_scheduler_loop_state.py

* add loop_state.py

Signed-off-by: jingbang.yjb <jingbang.yjb@alibaba-inc.com>
* Update

* Update

* Update state->current_compute_dag to Optional

* Add some doc strings for Follow_Split and Follow_fused_split

Signed-off-by: jingbang.yjb <jingbang.yjb@alibaba-inc.com>
* Check code using c-lint

Signed-off-by: jingbang.yjb <jingbang.yjb@alibaba-inc.com>
* Add more doc strings and change the order for follow split.

Signed-off-by: jingbang.yjb <jingbang.yjb@alibaba-inc.com>
* Add record test for follow_split and follow_fused_split

Signed-off-by: jingbang.yjb <jingbang.yjb@alibaba-inc.com>
* Add record test for follow_split

Signed-off-by: jingbang.yjb <jingbang.yjb@alibaba-inc.com>
* Add record test for follow_fused_split.

Signed-off-by: jingbang.yjb <jingbang.yjb@alibaba-inc.com>
* Add test record for follow_fused_split
1. delete a comment
2. add "fuse" between follow_split and follow_fused_split

Signed-off-by: jingbang.yjb <jingbang.yjb@alibaba-inc.com>
* Add doc strings for some functions and variables

Signed-off-by: jingbang.yjb <jingbang.yjb@alibaba-inc.com>
* Fix the code format in src/auto_scheduler/transform_step.h

Signed-off-by: jingbang.yjb <jingbang.yjb@alibaba-inc.com>
* Update

* Update doc

* Update

* Update

* Fix follow_split and follow_fused_split record test.

Signed-off-by: jingbang.yjb <jingbang.yjb@alibaba-inc.com>
* Doc update

* Update some doc strings

Signed-off-by: jingbang.yjb <jingbang.yjb@alibaba-inc.com>
* Fix code style and some function definitions.

Signed-off-by: jingbang.yjb <jingbang.yjb@alibaba-inc.com>
* Update

Signed-off-by: jingbang.yjb <jingbang.yjb@alibaba-inc.com>
* Add comments on parameters.

Signed-off-by: jingbang.yjb <jingbang.yjb@alibaba-inc.com>
* Add more doc strings and fix some.

Signed-off-by: jingbang.yjb <jingbang.yjb@alibaba-inc.com>
* Update

Signed-off-by: jingbang.yjb <jingbang.yjb@alibaba-inc.com>
* Update

Signed-off-by: jingbang.yjb <jingbang.yjb@alibaba-inc.com>
* Update

Signed-off-by: jingbang.yjb <jingbang.yjb@alibaba-inc.com>
* Update.

Signed-off-by: jingbang.yjb <jingbang.yjb@alibaba-inc.com>
Co-authored-by: chengfan.jcf <chengfan.jcf@alibaba-inc.com>
Co-authored-by: jingbang.yjb <jingbang.yjb@alibaba-inc.com>
4 years agoAdding t-vi as a reviewer (#6149)
Thierry Moreau [Tue, 28 Jul 2020 14:36:34 +0000 (07:36 -0700)]
Adding t-vi as a reviewer (#6149)

4 years ago[DOCS][REFACTOR] Clarify Docs Categorization (#6155)
Tianqi Chen [Tue, 28 Jul 2020 14:27:01 +0000 (07:27 -0700)]
[DOCS][REFACTOR] Clarify Docs Categorization (#6155)

This PR categorizes the docs into a few categories:
- How To
- Tutorials
- References
- Deep Dive
- MISC

Co-authored-by: Chris Hoge <chris@hogepodge.com>
Co-authored-by: Chris Hoge <chris@hogepodge.com>
4 years ago[Android][RPC] Add missing RPC sources after refactor (#6113)
Chris Sullivan [Tue, 28 Jul 2020 03:35:06 +0000 (20:35 -0700)]
[Android][RPC] Add missing RPC sources after refactor  (#6113)

4 years agoAdd TVM application extension with WASM runtime (#5892)
Leon Wang [Tue, 28 Jul 2020 03:34:19 +0000 (11:34 +0800)]
Add TVM application extension with WASM runtime (#5892)

* Refactor wasm runtime module and resovle conflict errors

Signed-off-by: leonwanghui <wanghui71leon@gmail.com>
* Fix some cargo clippy warnings

Signed-off-by: leonwanghui <wanghui71leon@gmail.com>
4 years ago[CI][TEST] Temporary disable nmsv4 test (#6151)
Tianqi Chen [Tue, 28 Jul 2020 02:51:47 +0000 (19:51 -0700)]
[CI][TEST] Temporary disable nmsv4 test (#6151)

4 years ago[DOCS][REFACTOR] Reorganize the docs. (#6146)
Tianqi Chen [Mon, 27 Jul 2020 20:41:28 +0000 (13:41 -0700)]
[DOCS][REFACTOR] Reorganize the docs. (#6146)

- Move most toctree to `:hiden:` so there can be top-level categorizations in the navigation bar.
- Move frontend guide into design and developer guides
- Move get started tutorials into its separate folder.

Co-authored-by: Chris Hoge <chris@hogepodge.com>
Co-authored-by: Chris Hoge <chris@hogepodge.com>
4 years ago[Relay][OP] Support NMSv4 ingestion from TF. (#6085)
Chris Sullivan [Mon, 27 Jul 2020 17:38:52 +0000 (10:38 -0700)]
[Relay][OP] Support NMSv4 ingestion from TF. (#6085)

4 years ago[Ansor][AutoTVM v2.0] Phase 1: Add cache_read/cache_write steps (#6107)
Chenfan [Mon, 27 Jul 2020 04:35:52 +0000 (12:35 +0800)]
[Ansor][AutoTVM v2.0] Phase 1: Add cache_read/cache_write steps (#6107)

* Add cache_read/cache_write step

* Update

* Update

* Update

* Update state->current_compute_dag to Optional

* Update

* Update doc

* Update

* Update

* Doc update

* Update

4 years ago[Relay] Fix interpreter for dyanmic shape input of ndarray_size (#6086)
lixiaoquan [Sat, 25 Jul 2020 15:16:06 +0000 (23:16 +0800)]
[Relay] Fix interpreter for dyanmic shape input of ndarray_size (#6086)

4 years ago[Fix] Remove the tvm web from version update (#6122)
Haichen Shen [Sat, 25 Jul 2020 15:14:10 +0000 (08:14 -0700)]
[Fix] Remove the tvm web from version update (#6122)

4 years agoadd attr option mfloat-abi for arm32 (#6123)
qunluo [Sat, 25 Jul 2020 15:13:55 +0000 (23:13 +0800)]
add attr option mfloat-abi for arm32 (#6123)

* add attr option mfloat-abi for arm32

* retrigger

4 years ago[Ansor][AutoTVM v2.0] Phase 1: Access Analyzer (#6103)
Lianmin Zheng [Sat, 25 Jul 2020 12:07:17 +0000 (05:07 -0700)]
[Ansor][AutoTVM v2.0] Phase 1: Access Analyzer (#6103)

* add access analyzer

* add test cases

* move header files and polish comments

* fix lint

* update

* fix lint

* address comments

* fix lint

4 years ago\b[TOPI] Fix CUDA Library Tuning (#6132)
Cody Yu [Sat, 25 Jul 2020 04:09:06 +0000 (21:09 -0700)]
\b[TOPI] Fix CUDA Library Tuning (#6132)

4 years ago[AutoTVM][BugFix] Fix autotvm on the conv2d_nchw_winograd.mali operator (#6130)
Yanming Wang [Fri, 24 Jul 2020 23:00:09 +0000 (16:00 -0700)]
[AutoTVM][BugFix] Fix autotvm on the conv2d_nchw_winograd.mali operator (#6130)

* [AutoTVM] Fix conv2d_nchw_winograd.mali

* Fix pylint error

Co-authored-by: Yanming Wang <yanmwang@amazon.com>
4 years ago[Relay][VM] Allow to config allocator type and refactor vm code structure (#6105)
Haichen Shen [Fri, 24 Jul 2020 22:49:45 +0000 (15:49 -0700)]
[Relay][VM] Allow to config allocator type and refactor vm code structure (#6105)

* [Relay][VM] Allow to config allocator type and refactor vm code structure

* fix doc

* fix

* update

* trigger ci

* trigger ci

* trigger ci

* trigger ci

* fix doc warning

4 years ago[Flaky] TFLite quantized conv test (#6084)
Animesh Jain [Fri, 24 Jul 2020 16:40:25 +0000 (09:40 -0700)]
[Flaky] TFLite quantized conv test (#6084)

4 years ago[Relay]Port eliminate_common_subexpr to non-recursive form (#6134)
Zheng Jiang [Fri, 24 Jul 2020 16:09:50 +0000 (00:09 +0800)]
[Relay]Port eliminate_common_subexpr to non-recursive form (#6134)

Co-authored-by: Zheng Jiang <zhejiang@amazon.com>
4 years ago[Relay] Keep fixed dim when unifying dynamic shape (#5795)
lixiaoquan [Fri, 24 Jul 2020 14:42:13 +0000 (22:42 +0800)]
[Relay] Keep fixed dim when unifying dynamic shape (#5795)

4 years agoAdd 'get_num_inputs' to GraphRuntime (#6118)
Alexander Booth [Fri, 24 Jul 2020 14:22:39 +0000 (07:22 -0700)]
Add 'get_num_inputs' to GraphRuntime (#6118)

4 years ago[Rust] Some rust cleanups (#6116)
Jason Knight [Thu, 23 Jul 2020 21:04:30 +0000 (14:04 -0700)]
[Rust] Some rust cleanups (#6116)

* Some rust cleanups

* Turn off default features for bindgen
* Upgrade some deps for smaller total dep tree
* Switch (/complete switch) to thiserror
* Remove unnecessary transmutes

* Fix null pointer assert

* Update wasm32 test

4 years ago[RELAY][Fix] i64 indices (#5235)
Haozheng Fan [Thu, 23 Jul 2020 21:04:10 +0000 (05:04 +0800)]
[RELAY][Fix] i64 indices (#5235)

* fix

* resolve comments

4 years agoRegister Shape Func for Some Operators to Handle Dynamic Shapes (#5955)
Siyuan Li [Thu, 23 Jul 2020 20:23:49 +0000 (04:23 +0800)]
Register Shape Func for Some Operators to Handle Dynamic Shapes (#5955)

* Register Shape Func for Floor Operator

Register the shape function for `floor` operator. Otherwise, a bug will happen when input of floor is any.

* Register shape func for log

* add shape function for crop_and_size

* change import location

* add mirror_pad shape function

* add test cases for crop_and_resize and mirror_pad shape funcs

* support different layout

* fix pylint error

* fix pylint error

* add test for nchw layout

* block nchw test

* test for nchw

* use tvm.testing.assert_allclose instead

Co-authored-by: lisiyuan <lisiyuan@nucflow>
4 years agoImprove reduction schedule on arm CPUs (#6110)
Giuseppe Rossini [Thu, 23 Jul 2020 15:38:56 +0000 (16:38 +0100)]
Improve reduction schedule on arm CPUs (#6110)

* Improve reduction schedule on arm CPUs

Change-Id: I9cd85deac6a57666b82ff7250d827652a4000d82

* Retrigger CI

Change-Id: I5efd99e34268e6bb990904a4b98e1edf2174b26b

4 years ago[Rust] Clean up conversions between TVM and Rust functions (#6114)
Max Willsey [Thu, 23 Jul 2020 08:14:17 +0000 (01:14 -0700)]
[Rust] Clean up conversions between TVM and Rust functions (#6114)

* Replace ToBoxedFn with From

* Compact and improve Typed and ToFunction impls

- Clone one less time
- Don't panic if number of args is wrong, return an error
- Actually drop functions/closures on the rust side

* Retry

4 years ago[DOCS][REFACTOR] Organize Design and Architectures (#6097)
Tianqi Chen [Wed, 22 Jul 2020 05:32:18 +0000 (22:32 -0700)]
[DOCS][REFACTOR] Organize Design and Architectures (#6097)

* [DOCS][REFACTOR] Design and Architectures

This PR refactors the design and architecture docs.
Previously this part of documentation was quite unstructured, and lacks a global
view of the overall architecture.

This PR takes a stab in resolving the problem

- Provide a guided overview of the current TVM's overall design
- Categorize the specific docs into architecture components or How tos.

* Apply suggestions from code review

Co-authored-by: Jared Roesch <roeschinc@gmail.com>
* Apply suggestions from code review

Co-authored-by: Jared Roesch <roeschinc@gmail.com>
* Update per comment

* More updates per feedbacks

* clarify external codegen

* Update per comments

Co-authored-by: Jared Roesch <roeschinc@gmail.com>
4 years ago[Rust][CI] Move CI over to new Rust crates and try to fix flaky test. (#6011)
Jared Roesch [Wed, 22 Jul 2020 02:53:45 +0000 (19:53 -0700)]
[Rust][CI] Move CI over to new Rust crates and try to fix flaky test. (#6011)

4 years agoUpdate installation doc with minor improvements (#6104)
Chris Hoge [Tue, 21 Jul 2020 23:41:29 +0000 (16:41 -0700)]
Update installation doc with minor improvements (#6104)

Make some minor improvements to the install from source doc
about flags to enable, package managers, and virtual environments.

4 years ago[Ansor][AutoTVM v2.0] Phase 1: Add annotation/compute_at/compute_root/compute_inline...
Chenfan [Tue, 21 Jul 2020 19:58:48 +0000 (03:58 +0800)]
[Ansor][AutoTVM v2.0] Phase 1: Add annotation/compute_at/compute_root/compute_inline steps (#6073)

* Add annotation step

* Add compute_at/compute_root/compute_inline

* Doc update

* Update

* Update

* Update measure record UT

* Update

* Update

* Update

* Move state implementation to step

* Move measure_record implementation to step

* Order update & API update

* Update the order of state api

* Update

4 years ago[Relay][VM] Add ReshapeTensor instruction in the VM to replace the reshape op (#6089)
Haichen Shen [Tue, 21 Jul 2020 17:10:16 +0000 (10:10 -0700)]
[Relay][VM] Add ReshapeTensor instruction in the VM to replace the reshape op (#6089)

* [VM] Add reshape tensor instruction

* update

* lint

* fix

* fix

4 years ago[BYOC][Contrib] Arm Compute Library integration (#5915)
lhutton1 [Tue, 21 Jul 2020 15:30:26 +0000 (16:30 +0100)]
[BYOC][Contrib] Arm Compute Library integration (#5915)

* [BYOC][Contrib] Arm Compute Library integration

Arm Compute Library (ACL) integration using the BYOC infrastructure. This will enable offloading select operators from a relay
graph to ACL so we can achieve faster inference times on Arm CPU's due to hand crafted optimized routines. The PR adds initial
support for offloading FP32 conv2d, maxpool2d and reshape to ACL. ACL codegen is used to generate a JSON representation of an
operator or 'ACL layer', the ACL runtime then uses this representation to construct a layer, cache it and create a packed
function to for the graph runtime to call into.

RFC here: https://discuss.tvm.ai/t/rfc-byoc-arm-compute-library-integration/7082

Change-Id: If756dcea787ea346b1508e9a191b7eed7bd02b7f

* Refactor ACL integration to support JSON runtime

* Now uses JSON runtime
* Addresses tutorial comments
* Rename acl to arm_compute_lib in user facing api

Change-Id: I3b5ef80607f713e898363e82ab4398fbc2cf267a

* Address comments

Change-Id: I041fda14f3bf9975f3518ba8a4e3ab43ba98403d

* Address comments

* correct mistakes in tutorial
* reshuffle runtime to use fewer macro blocks
* preprocess module using "optimize" functionality
* use new module api

Change-Id: I219488e617e5767edd7489b43b8bfce876cd24b8

* Enable ACL codegen tests in CI

* Skips runtime tests as these are not supported on x86.

Change-Id: I6843c003a2604afe95cfdccf2323d2a336b56fe5

* Fix check for runtime

Change-Id: I3f9eec15c599f01b1105d624fb053b73bfb6ed41

* Address comments

* Add warning to ACL engine creation
* Correct runtime check so it doesn't fail when codegen not present
* Improve testing to check acl partitions is what is expected
* Check results of multiple runs test

Change-Id: I9522950930805b9b601dad03269adcf8ed3138cc

* Address comments

* Multiple style improvements
* Use base class for creating json node for single op
* Move GetSource to base class
* Improve annotation checks

Change-Id: I8219659c4b99e86df887cd914720157cb94c61a0

* Improve tutorial

Change-Id: I8f610bd37af1e3740fd48c2d502bcc4727d9d712

* Initialize conv with nullptr

Change-Id: I6c37f0d75a064001c74e171ff83b9f7a7c3f1918

4 years agoUpdate SGX example Cargo.toml (#6067)
Nick Hynes [Tue, 21 Jul 2020 14:52:48 +0000 (07:52 -0700)]
Update SGX example Cargo.toml (#6067)

4 years agoload empty config (#6100)
Cody Yu [Tue, 21 Jul 2020 14:52:17 +0000 (07:52 -0700)]
load empty config (#6100)

4 years agodelete declaration of unused op_node (#6102)
QingFu Wei [Tue, 21 Jul 2020 14:51:33 +0000 (22:51 +0800)]
delete declaration of unused op_node (#6102)

4 years ago[Cmake] Add default value for option USE_DNNL_CODEGEN in the cmake (#6099)
Haichen Shen [Tue, 21 Jul 2020 04:09:55 +0000 (21:09 -0700)]
[Cmake] Add default value for option USE_DNNL_CODEGEN in the cmake (#6099)

4 years ago[DSL/TE] Scalar support for `te.extern` (#6079)
Haibin Lin [Tue, 21 Jul 2020 00:49:59 +0000 (17:49 -0700)]
[DSL/TE] Scalar support for `te.extern`  (#6079)

* fix make shape with scalar shapes

* add test

* add test

* remove scalar shape assertion

* fix the data type for overflow problems

* add extra tests

Co-authored-by: Ubuntu <ubuntu@ip-172-31-42-138.ec2.internal>
4 years agoMXNet pre-quantized BERT (#6039)
Animesh Jain [Mon, 20 Jul 2020 22:59:55 +0000 (15:59 -0700)]
MXNet pre-quantized BERT (#6039)

* MXNet pre-quantized BERT

* Comments.

* Trigger.

* Retrigger CI

* Retrigger CI

* Retrigger CI

* Retrigger

4 years ago[DOCS] Cleanup docs build instructions. (#6094)
Tianqi Chen [Mon, 20 Jul 2020 20:54:06 +0000 (13:54 -0700)]
[DOCS] Cleanup docs build instructions. (#6094)

4 years ago[Ansor][AutoTVM v2.0] Phase 1: Add RPC Runner (#6077)
Chenfan [Mon, 20 Jul 2020 18:13:48 +0000 (02:13 +0800)]
[Ansor][AutoTVM v2.0] Phase 1: Add RPC Runner (#6077)

* Add rpc runner

* Update

* Update

* Add clflush & non-empty ndarray TODO hints

* Update

* UT Update

* Update timeout in UT

4 years agolint: add opencl .cl file type (#6092)
ZHANG Hao [Mon, 20 Jul 2020 15:49:42 +0000 (23:49 +0800)]
lint: add opencl .cl file type (#6092)

4 years ago[Docs] improve the doc of release (#6091)
Yizhi Liu [Sat, 18 Jul 2020 20:28:20 +0000 (13:28 -0700)]
[Docs] improve the doc of release (#6091)

4 years ago[Relay][Dyn] Add dynamic reshape grad (#6080)
Matthew Brookhart [Fri, 17 Jul 2020 22:39:57 +0000 (15:39 -0700)]
[Relay][Dyn] Add dynamic reshape grad (#6080)

* add dynamic rehape grad

* fix lint

* fix unit tests, warning

4 years agoFixed point multiplication improvements for AArch64 (#5980)
Giuseppe Rossini [Fri, 17 Jul 2020 16:14:49 +0000 (17:14 +0100)]
Fixed point multiplication improvements for AArch64 (#5980)

* Fixed point multiplication improvements for AArch64

Change-Id: Ib3c10348d4c0eac11fa92b39cc6e792560e9eba4

* Fix python linting errors

Change-Id: I4cf5ac18aa24b39374b83805dcc8e1663e173909

* Fix doxygen errors

Change-Id: Ie3c861f8ead3f1ea5b30d5e9d7d94e222299d407

* Fix arm_cpu injective tests

Change-Id: I6ad9da61b61e6bd737627f26fba59767418c07cd

* Fix python linting errors - 2

Change-Id: Ic864a235aa5da5786393cbf6146dd815c121df5e

* Fix arm_cpu injective tests - 2

Change-Id: If9ca1cc3d947b1656c836c7f88de90470d92f979

* Redesign: introduce a qmuls (q-multiply and shift) general intrinsic

Change-Id: I1966fef9aee32eab50e4b984bbe81018488c8c02

* Fix python linting errors - 3

Change-Id: Ib87a19a8ee2d532954a7db1eb5793666e7aef366

* Addressing review comments

Change-Id: Ie82e75204e5a421d17660f381f3e31fc325cd26c

* Fixing test failures

Change-Id: I74cc675764cf8d260fe68a41e770b1ec7e84729a

* Renaming qmuls to q_multiply_shift

Change-Id: I5a8ed60ba855208040304fcdf6e1ea28061f06ad

4 years ago[Test] Add missing test for fast erf (#6058)
Haichen Shen [Fri, 17 Jul 2020 16:13:19 +0000 (09:13 -0700)]
[Test] Add missing test for fast erf (#6058)

* add missing test for fast erf

* trigger ci

4 years agoFix LocalBuilder on macos with python 3.8. (#6083)
Tristan Konolige [Fri, 17 Jul 2020 14:51:12 +0000 (07:51 -0700)]
Fix LocalBuilder on macos with python 3.8. (#6083)

Python 3.8 changes the default way multiprocessing creates new processes
on macOS from forking to spawing. Spawning requires all objects to be
picklable. Nested functions and lambdas are not picklable, so this
commit fixes the one instance of nested functions in the codebase that
was causing issues.

4 years ago[Fix] Add missing expr visitor for any (#6082)
Haichen Shen [Fri, 17 Jul 2020 14:48:38 +0000 (07:48 -0700)]
[Fix] Add missing expr visitor for any (#6082)

4 years ago[TOPI] Fix the filter width parameter in depthwise_conv2d (#6081)
Krzysztof Parzyszek [Fri, 17 Jul 2020 02:24:06 +0000 (21:24 -0500)]
[TOPI] Fix the filter width parameter in depthwise_conv2d (#6081)

* [TOPI] Fix the filter width parameter in depthwise_conv2d

* Retrigger build

Co-authored-by: Venkat Rasagna Reddy Komatireddy <quic_rasagna@quicinc.com>
4 years agoRefine LSTMBlockCell to support dynamic rnn (#5963)
lixiaoquan [Thu, 16 Jul 2020 22:22:28 +0000 (06:22 +0800)]
Refine LSTMBlockCell to support dynamic rnn (#5963)

1. Refine conversion of `LSTMBlockCell`
       1) Make its output follows definition in TensorFlow
       2) Avoid introducing variables which doesn't match any placeholder nodes in TensorFlow graph

    2. About change in test_forward_ptb
       States nodes of LSTMBlockCell in this PB file  are actually Constant node.
       TF can feed data to those Constant nodes but relay can't do that, so current conversion of LSTMBockCell introduces extra variables to solve this issue.
       But this causes that relay IR doesn't match original TF graph. This PR solves this issue by convert those states node into placeholders.

4 years ago[ARITH] Improve vector simplification for float operands (#6043)
Lianmin Zheng [Thu, 16 Jul 2020 20:18:25 +0000 (13:18 -0700)]
[ARITH] Improve vector simplification for float operands (#6043)

4 years ago[VTA] Fix FSIM Compile Error. (#6070)
Hua Jiang [Thu, 16 Jul 2020 19:06:43 +0000 (12:06 -0700)]
[VTA] Fix FSIM Compile Error. (#6070)

Issue:
when set vta target into "sim", vta compile would get fail and
show error message "fatal error: vta/driver.h: No such file or directory".

Solution:
set VTA_HW include path correctly.

4 years ago[AutoTVM][BugFix] Fix variable name conflict with OpenCL keyword (#6048)
Yanming Wang [Thu, 16 Jul 2020 18:02:06 +0000 (11:02 -0700)]
[AutoTVM][BugFix] Fix variable name conflict with OpenCL keyword (#6048)

Co-authored-by: Yanming Wang <yanmwang@amazon.com>
4 years agoRemove unnecessary std::cout (#6072)
Zhao Wu [Thu, 16 Jul 2020 17:30:08 +0000 (01:30 +0800)]
Remove unnecessary std::cout (#6072)

* Remove unnecessary std::cout

* Trigger CI

4 years ago[RUNTIME][CRT] init TVMPackedFunc's name (#6044)
windclarion [Thu, 16 Jul 2020 10:42:08 +0000 (18:42 +0800)]
[RUNTIME][CRT] init TVMPackedFunc's name (#6044)

or else src/runtime/crt/graph_runtime/graph_runtime.c TVMGraphRuntime_Run
Line 639 will show messy code.

Signed-off-by: windclarion <windclarion@gmail.com>
4 years agoFix error message in Buffer::vstore, NFC (#6056)
Krzysztof Parzyszek [Thu, 16 Jul 2020 02:22:56 +0000 (21:22 -0500)]
Fix error message in Buffer::vstore, NFC (#6056)

* Fix error message in Buffer::vstore, NFC

* Fix whitespace in comment as well

4 years agoAdd operation scatter_add to relay, based on scatter implementation. (#6030)
notoraptor [Thu, 16 Jul 2020 02:21:28 +0000 (22:21 -0400)]
Add operation scatter_add to relay, based on scatter implementation. (#6030)

4 years ago[Relay][Pass] Merge two consecutive reshape ops (#6052)
Haichen Shen [Thu, 16 Jul 2020 01:34:21 +0000 (18:34 -0700)]
[Relay][Pass] Merge two consecutive reshape ops (#6052)

4 years ago[BYOC][Optimization] Run accelerator specific optimizations (#6068)
Zhi [Thu, 16 Jul 2020 01:04:37 +0000 (18:04 -0700)]
[BYOC][Optimization] Run accelerator specific optimizations  (#6068)

* register and invoke optimization pipeline for external codegen

* add unit test

4 years ago[clflush] Enable x86 cpu cache flush (#5914)
Zhao Wu [Wed, 15 Jul 2020 22:23:40 +0000 (06:23 +0800)]
[clflush] Enable x86 cpu cache flush (#5914)

4 years ago[TARGET] ONNX codegen (#5052)
Mahesh Ambule [Wed, 15 Jul 2020 20:24:24 +0000 (01:54 +0530)]
[TARGET] ONNX codegen (#5052)

* Relay to ONNX converter

* Relay to ONNX op test cases

* Relay to ONNX end to end model test cases

* Add test cases to jenkins

* CI CD fixes

* ONNX codegen

* ONNX codegen

* ONNX codegen

* onnx testcases

* ONNX codegen

* test onnx

* ONNX codegen

* shape calculation

* move onnx codegen to contrib/target

* review comments

* ONNX target use visitor

* onnx fixes

* lint fixes

* doc string changes

* review comments

* review comment fixes

* review comment

* pytest skip

* rename type to node type

* test

* Fix for constantshpae, add exp, fix for metadatamodule

* Fix cpplint

* change error tol values

4 years ago[Doc] update frontend tutorials to new model based runtime (#6063)
Zhao Wu [Wed, 15 Jul 2020 17:06:36 +0000 (01:06 +0800)]
[Doc] update frontend tutorials to new model based runtime (#6063)

4 years ago[Ansor][AutoTVM v2.0] Part 1: Rename namspace form auto_schedule to auto_scheduler...
Chenfan [Wed, 15 Jul 2020 07:24:19 +0000 (15:24 +0800)]
[Ansor][AutoTVM v2.0] Part 1: Rename namspace form auto_schedule to auto_scheduler (#6059)

* Rename namespace auto_schedule to auto_scheduler

* Update

* Lint fix

4 years ago[RUNTIME] Support module based interface runtime (#5753)
Zhao Wu [Wed, 15 Jul 2020 03:07:43 +0000 (11:07 +0800)]
[RUNTIME] Support module based interface runtime (#5753)

4 years agoBuild crttest and cpptest separately. (#6057)
Andrew Reusch [Wed, 15 Jul 2020 01:11:56 +0000 (18:11 -0700)]
Build crttest and cpptest separately. (#6057)

* Build crttest and cpptest separately.

 * Try to fix random CI crashing, likely caused by concurrent cmake execution.

* Revert to -j8

4 years ago[Ansor][AutoTVM v2.0] Part 0: Ansor minimum system for auto schedule generating ...
Chenfan [Wed, 15 Jul 2020 00:16:22 +0000 (08:16 +0800)]
[Ansor][AutoTVM v2.0] Part 0: Ansor minimum system for auto schedule generating (#5962)

* Code migration Start (#1)

* Init commit: Code migration Start

* Add loop_state.cc/h

* Add ComputeDAG basic test

* Split transform_step out & Update more UTs (#3)

* Split transform_step out

* Update GetProducers & GetConsumers

* Update UTs

* Add UT for CacheReadWrite & Some bug fix

* Add search_task, measure and serialization (#4)

* Add FollowSplit & FollowFusedSplit tests

* Update dag.InferBound & its UT

* Add search_task, measure and serialization

* Update Serialization UT

* Add MetaTileRewritePolicy (#5)

* Add feature

* Add cost_model, meta_tile_rewrite_policy

* Add MetaTileRewritePolicy basic UT

* Basic Python API for State (#6)

* Add Basic Python API for State

* Add UTs for State

* Add Python API: Measure & Task (#7)

* Update the return value of state operation

* Add task

* Copy measure.py & utils.py

* Fix LocalBuilder

* Fix LocalRunner

* Add ansor.auto_schedule() API; First AutoSchedule working version(#8)

* Add basic Python support for ansor.auto_schedule

* Update AutoSchedule API

* Bug fix for get the attach point of a fused iter

* Update UT after infer bug fix

* Bug fix & Add python serialization API (#10)

* Delete C++ UT hack since Python is ready

* Add ndarray.non_empty

* Update Serialization python API

* Improve code style, python wrapper and test cases (#11)

* Update c++ code style and unit test

* Update python State wrapper and test cases

* fix unit tests

* Add RPCRunner & OpenCL/CUDA test (#12)

* Add RPCRunner & OpenCL search test

* Add CUDA search test

* Add RPCRunner test

* rebase to upstream/master

* Add Ansor basic tutorial (#13)

* Add basic tutorial

* migrate feature extraction (#14)

* Add XGBModel & RPCRunnerWarpper (#15)

* Add XGBModel & RPCRunnerWarpper

* Revert "Add Parallel Granularity Mutation"

* Migrate workload_registry.py (#16)

* add workload registry

* update

* update

* add task scheduler (#17)

* Add conv2d cuda tutorial with workload registry (#18)

* add tune_test.py (the old tune_wkl.py) (#19)

* add tune_test.py (the old tune_wkl.py)

* update

* fix measure

* fix for gpu

* Code refine for tune_test.py & Add a pre load callback (#20)

* Bug fix for tutorials

* Add PreLoadMeasuredStates

* Add search_callback support for task tuner

* Code refine for tune_test.py

* Update

* Update

* Update

* Update

* Bug fix

* Add python custom sketch rule (#21)

* Add custom sketch rule

* Bug fix

* Ansor Relay Integration (without layout rewrite) (#22)

* relay integration

* Add tune_op_subgraph.py & Some code clean for tune_network.py (#23)

* Add single op tune scripts

* Add tune subgraph support

* Merge all op & all subgraph to one file

* Rename file

* add explicit_unroll_max_extent (#25)

* Add Index simplification & API update (#26)

* Add vectorized cooperative_fetching test

* Update math simplify for vectorized CF

* File rename

* Update tune_network

* API update

* Update PreLoadMeasuredStates & Some bug fix (#27)

* Add a threading wrapper to fix the test bug

* Set default TVM_USE_AUTO_SCHEDULER to false

* Update PreLoadMeasuredStates callback

* Add tensorize step for loop_state (#31)

* Add tensorize step

* State python api update (#33)

* Start to update api

* Add compute_dag to state

* API update

* kernel layout rewrite (#28)

* kernel layout rewrite

* remove some hacks

* add defuse_ops pass and move kernel_layout_rewrite pass after fuse_ops pass

* set TVM_RELAY_DISABLE_BUILD_CACHE for task extraction and prepare_layout_rewrite

* [cache flush] port cache flush to ansor (#32)

* Improve relay integration (#34)

* tmp checkpoint

* Improve relay integration

* Improve relay integration

* Fix xgb error & Simplify dispatcher (#35)

* Rename "MetaTileRewritePolicy" to "SketchPolicy". (#36)

* Rename "MetaTileRewritePolicy" to "SketchPolicy".

* Add a new class for auto_unroll_max_step, storage_offset in StageNode

* fix tune_op_subgraph.py

* rebase

* Migrate all node::make to noderef's construct function (#37)

* Start to move xxxnode::make to noderef()

* Update

* Update

* Finish transform_step

* Finish comute dag & auto schedule

* Update

* Update

* Update

* Update

* Update

* Code refine

* Code refine

* Code refine

* Update

* Update

* Some lint fix & Recover the double constructor of tvm::PrimExpr (#39)

* lint fix

* clang-format-fix

* pylint fix

* Update

* Recover the double constructor of tvm::PrimExpr

* Fix pylint

* pylint fix

* pylint fix

* Add MutateComputeLocation and MutateParallel in evolutionary search (#40)

* Add MutateComputeLocation and MutateParallel in evolutionary search

* fix lint

* Improve loop state python API (stage_tensors -> stage_ops) (#41)

* improve loop state python API (stage_tensors -> stage_ops)

* fix

* ComputeDAG bug fix & Add Custom TensorCore Matmul Example (#42)

* Bug Fix

* Sample example of Custom TensorCore Matmul

* Rever Commits, Start to build minimum Ansor system

* Code clean for minimum Ansor system

* Bug fix & Delete AccessAnalyzer

* Delete attachmap & Code clean

* Doc update

Update statenode::stages from vector to Array

* Headfile update & Python doc update

* clang-format fix

* pylint fix

* Update

* Doc update

* Update

* Bug fix after code merge to the new master

* clang-format fix

* Update

* Update

* Update std::vector to Array; Update verbosity setting; Some commemts
addressed

* std::vector->Array & std::string->String

* Add init_state to ComputeDAG

* Update

* Update some unordered_map to Map

* clang-format fix

* Comments addressed
Delete ReplayAndInferBound
Delete ReplaySteps & InferBoundCommon

* Lint fix

* Update

* Update

* Update

* Update

* Update

* Update

* Update

* Update

* Update

* Rename ansor namespace to auto_schedule

* Update

* Rename ThreadPool to ParallelFor

* Add parallel_for

* Remove ThreadPool

* Update python/tvm/auto_schedule/auto_schedule.py

* trigger CI

Co-authored-by: Lianmin Zheng <lianminzheng@gmail.com>
Co-authored-by: Minmin Sun (孙敏敏) <minmin.smm@alibaba-inc.com>
Co-authored-by: Zhao Wu <zhaowu@apache.org>