[incubator-tvm] branch master updated (579da6b -> 46787c8)

2020-05-11 Thread tqchen
This is an automated email from the ASF dual-hosted git repository.

tqchen pushed a change to branch master
in repository https://gitbox.apache.org/repos/asf/incubator-tvm.git.


from 579da6b  [TARGET] Phase out WebGL (#5570)
 add 46787c8  [LINT] Enable clang-format. (#5572)

No new revisions were added by this update.

Summary of changes:
 apps/bundle_deploy/bundle.c|  55 ++--
 apps/bundle_deploy/bundle_static.c |  27 +-
 apps/bundle_deploy/demo_static.c   |  41 ++-
 apps/bundle_deploy/runtime.c   |   4 +-
 apps/bundle_deploy/test_static.c   |  33 ++-
 docs/contribute/code_guide.rst |  41 +++
 docs/contribute/pull_request.rst   |  11 +-
 src/ir/error.cc|   2 +-
 src/ir/expr.cc |   4 +-
 src/relay/op/tensor/unary.cc   |  35 ++-
 src/runtime/crt/crt_backend_api.c  |   7 +-
 src/runtime/crt/crt_runtime_api.c  |  27 +-
 src/runtime/crt/graph_runtime.c| 283 +++--
 src/runtime/crt/load_json.c| 124 +
 src/runtime/crt/memory.c   | 131 +-
 src/runtime/crt/ndarray.c  |  48 ++--
 src/runtime/hexagon/sim/driver/fake_pthread.cc |  20 +-
 src/runtime/hexagon/sim/driver/pthread.h   |  16 +-
 src/runtime/hexagon/sim/driver/sim_device.cc   |  45 ++--
 .../micro/device/arm/stm32f746xx/utvm_timer.c  |  16 +-
 src/runtime/micro/device/host/utvm_timer.c |   5 +-
 src/runtime/micro/device/riscv_spike/utvm_timer.c  |   4 +-
 .../micro/host_driven/utvm_device_dylib_redirect.c |  32 ++-
 src/runtime/micro/host_driven/utvm_runtime.c   |  27 +-
 tests/lint/git-clang-format.sh |   2 +-
 tests/lint/rat-excludes|   1 +
 tests/scripts/task_lint.sh |   7 +
 27 files changed, 548 insertions(+), 500 deletions(-)



[incubator-tvm] branch master updated (5428b54 -> 579da6b)

2020-05-11 Thread tqchen
This is an automated email from the ASF dual-hosted git repository.

tqchen pushed a change to branch master
in repository https://gitbox.apache.org/repos/asf/incubator-tvm.git.


from 5428b54  [DOCKER] Add clang-format and nodejs to ci-lint (#5567)
 add 579da6b  [TARGET] Phase out WebGL (#5570)

No new revisions were added by this update.

Summary of changes:
 CMakeLists.txt  |   2 -
 include/tvm/runtime/device_api.h|   2 -
 include/tvm/te/schedule.h   |   8 -
 include/tvm/tir/expr.h  |   1 -
 include/tvm/tir/stmt.h  |   7 -
 src/runtime/module.cc   |   2 -
 src/target/opt/build_opengl_off.cc  |  37 
 src/target/source/codegen_opengl.cc | 308 
 src/target/source/codegen_opengl.h  |  71 
 src/target/source/intrin_rule_opengl.cc |  64 ---
 src/target/target.cc|   5 +-
 src/te/schedule/schedule_lang.cc|  43 -
 src/te/schedule/schedule_ops.cc |   4 -
 src/tir/transforms/storage_flatten.cc   |  30 ++--
 14 files changed, 12 insertions(+), 572 deletions(-)
 delete mode 100644 src/target/opt/build_opengl_off.cc
 delete mode 100644 src/target/source/codegen_opengl.cc
 delete mode 100644 src/target/source/codegen_opengl.h
 delete mode 100644 src/target/source/intrin_rule_opengl.cc



[incubator-tvm] branch master updated (4d713d6 -> 5428b54)

2020-05-11 Thread tqchen
This is an automated email from the ASF dual-hosted git repository.

tqchen pushed a change to branch master
in repository https://gitbox.apache.org/repos/asf/incubator-tvm.git.


from 4d713d6  [CI] Update ci-lint to use the latest image that contains 
clang-format (#5568)
 add 5428b54  [DOCKER] Add clang-format and nodejs to ci-lint (#5567)

No new revisions were added by this update.

Summary of changes:
 .gitignore |  2 +-
 docker/Dockerfile.ci_lint  | 20 +--
 ...ython.sh => ubuntu1804_install_clang_format.sh} | 15 +++---
 tests/lint/git-clang-format.sh | 61 ++
 tests/lint/rat-excludes|  2 +
 5 files changed, 85 insertions(+), 15 deletions(-)
 copy docker/install/{ubuntu1804_install_python.sh => 
ubuntu1804_install_clang_format.sh} (70%)
 create mode 100755 tests/lint/git-clang-format.sh



[incubator-tvm] branch master updated (39b2db4 -> 5cd8bb3)

2020-05-11 Thread tqchen
This is an automated email from the ASF dual-hosted git repository.

tqchen pushed a change to branch master
in repository https://gitbox.apache.org/repos/asf/incubator-tvm.git.


from 39b2db4  [DOCKER] Fix vulkansdk in the ci-gpu (#5566)
 add 5cd8bb3  [CI] reintroduce docker stage for wasm tests (#5565)

No new revisions were added by this update.

Summary of changes:
 .gitignore |  2 +-
 Jenkinsfile| 13 +++
 ...Dockerfile.ci_emscripten => Dockerfile.ci_wasm} | 36 +++---
 docker/bash.sh |  2 +-
 docker/install/ubuntu_install_emscripten.sh| 22 +++
 docker/install/ubuntu_install_nodejs.sh|  4 +-
 ...nfig_build_cpu.sh => task_config_build_wasm.sh} |  4 +-
 tests/scripts/task_web_build.sh| 20 --
 tests/scripts/task_web_test.sh | 43 --
 .../scripts/task_web_wasm.sh   | 12 +-
 web/package.json   |  2 +-
 11 files changed, 56 insertions(+), 104 deletions(-)
 rename docker/{Dockerfile.ci_emscripten => Dockerfile.ci_wasm} (60%)
 copy tests/scripts/{task_config_build_cpu.sh => task_config_build_wasm.sh} 
(90%)
 delete mode 100755 tests/scripts/task_web_build.sh
 delete mode 100755 tests/scripts/task_web_test.sh
 copy docker/install/ubuntu_install_mxnet.sh => tests/scripts/task_web_wasm.sh 
(86%)



[incubator-tvm] branch master updated: [DOCKER] Fix vulkansdk in the ci-gpu (#5566)

2020-05-11 Thread tqchen
This is an automated email from the ASF dual-hosted git repository.

tqchen pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/incubator-tvm.git


The following commit(s) were added to refs/heads/master by this push:
 new 39b2db4  [DOCKER] Fix vulkansdk in the ci-gpu (#5566)
39b2db4 is described below

commit 39b2db4bd88266c25b203b18571f960d0cc64896
Author: Tianqi Chen 
AuthorDate: Mon May 11 15:28:04 2020 -0700

[DOCKER] Fix vulkansdk in the ci-gpu (#5566)
---
 docker/Dockerfile.ci_gpu|  5 +
 docker/install/ubuntu_install_vulkan.sh | 11 ---
 2 files changed, 5 insertions(+), 11 deletions(-)

diff --git a/docker/Dockerfile.ci_gpu b/docker/Dockerfile.ci_gpu
index 1625496..d829014 100644
--- a/docker/Dockerfile.ci_gpu
+++ b/docker/Dockerfile.ci_gpu
@@ -111,7 +111,4 @@ ENV 
LD_LIBRARY_PATH=/usr/local/cuda/lib64:/usr/local/cuda/compact:${LD_LIBRARY_P
 
 ENV LD_LIBRARY_PATH=/opt/rocm/lib:${LD_LIBRARY_PATH}
 ENV PATH=/node_modules/.bin:${PATH}
-ENV VULKAN_SDK=/usr/local/VulkanSDK/1.0.65.0/x86_64
-ENV PATH=${PATH}:${VULKAN_SDK}/bin
-ENV LD_LIBRARY_PATH=${LD_LIBRARY_PATH}:${VULKAN_SDK}/lib
-ENV VK_LAYER_PATH=${VULKAN_SDK}/etc/explicit_layer.d
+ENV VULKAN_SDK=/usr
diff --git a/docker/install/ubuntu_install_vulkan.sh 
b/docker/install/ubuntu_install_vulkan.sh
index 5fb4082..b7d2d46 100755
--- a/docker/install/ubuntu_install_vulkan.sh
+++ b/docker/install/ubuntu_install_vulkan.sh
@@ -20,10 +20,7 @@ set -e
 set -u
 set -o pipefail
 
-wget -q 
https://sdk.lunarg.com/sdk/download/1.0.65.0/linux/vulkansdk-linux-x86_64-1.0.65.0.run
-
-bash vulkansdk-linux-x86_64-1.0.65.0.run
-mv VulkanSDK /usr/local/VulkanSDK
-cd /usr/local/VulkanSDK/1.0.65.0
-./build_tools.sh
-./build_samples.sh
+wget -qO - http://packages.lunarg.com/lunarg-signing-key-pub.asc | apt-key add 
-
+wget -qO /etc/apt/sources.list.d/lunarg-vulkan-1.2.135-xenial.list 
http://packages.lunarg.com/vulkan/1.2.135/lunarg-vulkan-1.2.135-xenial.list
+apt update
+apt install -y vulkan-sdk



[incubator-tvm] branch master updated: [Refactor][std::string --> String] IR is updated with String (#5547)

2020-05-11 Thread tqchen
This is an automated email from the ASF dual-hosted git repository.

tqchen pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/incubator-tvm.git


The following commit(s) were added to refs/heads/master by this push:
 new 1a0f44d  [Refactor][std::string --> String] IR is updated with String 
(#5547)
1a0f44d is described below

commit 1a0f44d4c8dead73a47fbdf44e50c0b8edde5f00
Author: ANSHUMAN TRIPATHY 
AuthorDate: Tue May 12 00:38:04 2020 +0530

[Refactor][std::string --> String] IR is updated with String (#5547)

* [std::string --> String] GlobalTypeVar is updated with String

* [std::string --> String] GlobalVar is updated with String

* [std::string --> String][IR] ADT is updated with String

* [std::string --> String][IR] OP is updated with String

* [std::string --> String][IR] Attrs is updated with String input

* [std::string --> String][IR] GlobalVar is updated with String

* [std::string --> String][Test] Pyconverter is updated with String change
---
 include/tvm/ir/adt.h |  2 +-
 include/tvm/ir/env_func.h|  2 +-
 include/tvm/ir/expr.h|  4 ++--
 include/tvm/ir/op.h  |  9 +
 include/tvm/ir/transform.h   |  8 
 include/tvm/ir/type.h|  4 ++--
 include/tvm/runtime/container.h  |  9 +
 python/tvm/ir/json_compact.py|  4 ++--
 python/tvm/relay/testing/py_converter.py |  4 ++--
 src/ir/adt.cc|  4 ++--
 src/ir/env_func.cc   |  2 +-
 src/ir/expr.cc   |  4 ++--
 src/ir/function.cc   |  2 +-
 src/ir/op.cc | 10 +-
 src/ir/transform.cc  | 14 +++---
 src/ir/type.cc   |  4 ++--
 src/printer/relay_text_printer.cc|  4 +++-
 17 files changed, 51 insertions(+), 39 deletions(-)

diff --git a/include/tvm/ir/adt.h b/include/tvm/ir/adt.h
index 9d45dc1..9b45c66 100644
--- a/include/tvm/ir/adt.h
+++ b/include/tvm/ir/adt.h
@@ -91,7 +91,7 @@ class Constructor : public RelayExpr {
* \param inputs The input types.
* \param belong_to The data type var the constructor will construct.
*/
-  TVM_DLL Constructor(std::string name_hint, Array inputs, GlobalTypeVar 
belong_to);
+  TVM_DLL Constructor(String name_hint, Array inputs, GlobalTypeVar 
belong_to);
 
   TVM_DEFINE_OBJECT_REF_METHODS(Constructor, RelayExpr, ConstructorNode);
 };
diff --git a/include/tvm/ir/env_func.h b/include/tvm/ir/env_func.h
index 320d6e3..2f80367 100644
--- a/include/tvm/ir/env_func.h
+++ b/include/tvm/ir/env_func.h
@@ -92,7 +92,7 @@ class EnvFunc : public ObjectRef {
* \return The created global function.
* \note The function can be unique
*/
-  TVM_DLL static EnvFunc Get(const std::string& name);
+  TVM_DLL static EnvFunc Get(const String& name);
   /*! \brief specify container node */
   using ContainerType = EnvFuncNode;
 };
diff --git a/include/tvm/ir/expr.h b/include/tvm/ir/expr.h
index 717ffb1..6797f16 100644
--- a/include/tvm/ir/expr.h
+++ b/include/tvm/ir/expr.h
@@ -188,7 +188,7 @@ class GlobalVar;
 class GlobalVarNode : public RelayExprNode {
  public:
   /*! \brief The name of the variable, this only acts as a hint. */
-  std::string name_hint;
+  String name_hint;
 
   void VisitAttrs(AttrVisitor* v) {
 v->Visit("name_hint", _hint);
@@ -216,7 +216,7 @@ class GlobalVarNode : public RelayExprNode {
  */
 class GlobalVar : public RelayExpr {
  public:
-  TVM_DLL explicit GlobalVar(std::string name_hint);
+  TVM_DLL explicit GlobalVar(String name_hint);
 
   TVM_DEFINE_OBJECT_REF_METHODS(GlobalVar, RelayExpr, GlobalVarNode);
 };
diff --git a/include/tvm/ir/op.h b/include/tvm/ir/op.h
index 7fafb5a..aeda4fa 100644
--- a/include/tvm/ir/op.h
+++ b/include/tvm/ir/op.h
@@ -185,7 +185,7 @@ class Op : public RelayExpr {
* \param op_name Name of the operator.
* \return Pointer to a Op, valid throughout program lifetime.
*/
-  TVM_DLL static const Op& Get(const std::string& op_name);
+  TVM_DLL static const Op& Get(const String& op_name);
 
   /*! \brief specify container node */
   using ContainerType = OpNode;
@@ -196,13 +196,13 @@ class Op : public RelayExpr {
* \param key The attribute key
* \return reference to GenericOpMap
*/
-  TVM_DLL static const GenericOpMap& GetGenericAttr(const std::string& key);
+  TVM_DLL static const GenericOpMap& GetGenericAttr(const String& key);
   /*!
* \brief Checks if the key is present in the registry
* \param key The attribute key
* \return bool True if the key is present
*/
-  TVM_DLL static bool HasGenericAttr(const std::string& key);
+  TVM_DLL static bool HasGenericAttr(const String& key);
 };
 
 /*!
@@ -303,7 +303,8 @@ class OpRegistry {
   // return internal pointer to op.
   inline OpNode* get();
   // update the 

[incubator-tvm] branch master updated (621a61d -> ad2ee97)

2020-05-11 Thread tqchen
This is an automated email from the ASF dual-hosted git repository.

tqchen pushed a change to branch master
in repository https://gitbox.apache.org/repos/asf/incubator-tvm.git.


from 621a61d  [FRONTEND]onnx, mxnet, pytorch mathops added (#5561)
 add ad2ee97  Fix topi test for tensorcore (#5563)

No new revisions were added by this update.

Summary of changes:
 topi/tests/python/test_topi_conv2d_nhwc_winograd.py | 3 +++
 1 file changed, 3 insertions(+)



[incubator-tvm] branch master updated (7f5e37a -> 621a61d)

2020-05-11 Thread masahi
This is an automated email from the ASF dual-hosted git repository.

masahi pushed a change to branch master
in repository https://gitbox.apache.org/repos/asf/incubator-tvm.git.


from 7f5e37a  [Fix] Fix conv2d alter op for arm cpu (#5532)
 add 621a61d  [FRONTEND]onnx, mxnet, pytorch mathops added (#5561)

No new revisions were added by this update.

Summary of changes:
 python/tvm/relay/frontend/mxnet.py| 13 ++---
 python/tvm/relay/frontend/onnx.py | 11 +++
 python/tvm/relay/frontend/pytorch.py  |  2 ++
 tests/python/frontend/mxnet/test_forward.py   | 21 +
 tests/python/frontend/onnx/test_forward.py| 11 +++
 tests/python/frontend/pytorch/test_forward.py | 14 --
 6 files changed, 67 insertions(+), 5 deletions(-)



[incubator-tvm] branch master updated (4196726 -> 7f5e37a)

2020-05-11 Thread kevinthesun
This is an automated email from the ASF dual-hosted git repository.

kevinthesun pushed a change to branch master
in repository https://gitbox.apache.org/repos/asf/incubator-tvm.git.


from 4196726  [CI] Update ci-cpu to bionic (#5554)
 add 7f5e37a  [Fix] Fix conv2d alter op for arm cpu (#5532)

No new revisions were added by this update.

Summary of changes:
 topi/python/topi/arm_cpu/conv2d_alter_op.py | 2 ++
 1 file changed, 2 insertions(+)



[incubator-tvm] branch master updated (0e87752 -> de866b0)

2020-05-11 Thread tqchen
This is an automated email from the ASF dual-hosted git repository.

tqchen pushed a change to branch master
in repository https://gitbox.apache.org/repos/asf/incubator-tvm.git.


from 0e87752  [BYOC, MergeComposite] Add additional check before re-using 
the cached match (#5552)
 add de866b0  [WEB] Setup lint, doc, test (#5556)

No new revisions were added by this update.

Summary of changes:
 web/.eslintrc.json | 34 +
 web/Makefile   |  7 ++-
 .../riscv_spike/utvm_init.s => web/jest.config.js  | 50 ++-
 web/package.json   | 56 --
 web/tests/node/test_module_load.js | 21 
 web/tests/node/test_ndarray.js | 14 --
 web/tests/node/test_packed_func.js | 45 +
 web/typedoc.json   | 11 +
 8 files changed, 140 insertions(+), 98 deletions(-)
 create mode 100644 web/.eslintrc.json
 copy src/runtime/micro/device/riscv_spike/utvm_init.s => web/jest.config.js 
(86%)
 create mode 100644 web/typedoc.json



[incubator-tvm] branch master updated: [CI] Update ci-cpu to bionic (#5554)

2020-05-11 Thread tqchen
This is an automated email from the ASF dual-hosted git repository.

tqchen pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/incubator-tvm.git


The following commit(s) were added to refs/heads/master by this push:
 new 4196726  [CI] Update ci-cpu to bionic (#5554)
4196726 is described below

commit 419672617d983cca2836e84d7908ffda20003990
Author: Tianqi Chen 
AuthorDate: Mon May 11 09:04:28 2020 -0700

[CI] Update ci-cpu to bionic (#5554)
---
 docker/Dockerfile.ci_cpu   | 12 +--
 ...nstall_nnpack.sh => ubuntu1804_install_llvm.sh} | 25 +-
 ...stall_redis.sh => ubuntu1804_install_python.sh} | 17 ++-
 docker/install/ubuntu_install_nnpack.sh|  2 +-
 docker/install/ubuntu_install_redis.sh |  5 ++---
 docker/install/ubuntu_install_tflite.sh|  4 +---
 6 files changed, 37 insertions(+), 28 deletions(-)

diff --git a/docker/Dockerfile.ci_cpu b/docker/Dockerfile.ci_cpu
index abd7c0d..f1a928a 100644
--- a/docker/Dockerfile.ci_cpu
+++ b/docker/Dockerfile.ci_cpu
@@ -16,22 +16,22 @@
 # under the License.
 
 # CI docker CPU env
-# tag: v0.55
-FROM ubuntu:16.04
+# tag: v0.62
+FROM ubuntu:18.04
 
 RUN apt-get update --fix-missing
 
 COPY install/ubuntu_install_core.sh /install/ubuntu_install_core.sh
 RUN bash /install/ubuntu_install_core.sh
 
-COPY install/ubuntu_install_python.sh /install/ubuntu_install_python.sh
-RUN bash /install/ubuntu_install_python.sh
+COPY install/ubuntu1804_install_python.sh /install/ubuntu1804_install_python.sh
+RUN bash /install/ubuntu1804_install_python.sh
 
 COPY install/ubuntu_install_python_package.sh 
/install/ubuntu_install_python_package.sh
 RUN bash /install/ubuntu_install_python_package.sh
 
-COPY install/ubuntu_install_llvm.sh /install/ubuntu_install_llvm.sh
-RUN bash /install/ubuntu_install_llvm.sh
+COPY install/ubuntu1804_install_llvm.sh /install/ubuntu1804_install_llvm.sh
+RUN bash /install/ubuntu1804_install_llvm.sh
 
 # Rust env (build early; takes a while)
 COPY install/ubuntu_install_rust.sh /install/ubuntu_install_rust.sh
diff --git a/docker/install/ubuntu_install_nnpack.sh 
b/docker/install/ubuntu1804_install_llvm.sh
similarity index 50%
copy from docker/install/ubuntu_install_nnpack.sh
copy to docker/install/ubuntu1804_install_llvm.sh
index 6eb94ae..4f7c9df 100755
--- a/docker/install/ubuntu_install_nnpack.sh
+++ b/docker/install/ubuntu1804_install_llvm.sh
@@ -20,16 +20,21 @@ set -e
 set -u
 set -o pipefail
 
-apt-get update && apt-get install -y --no-install-recommends git cmake
+echo deb http://apt.llvm.org/bionic/ llvm-toolchain-bionic-9 main\
+ >> /etc/apt/sources.list.d/llvm.list
+echo deb-src http://apt.llvm.org/bionic/ llvm-toolchain-bionic-9 main\
+ >> /etc/apt/sources.list.d/llvm.list
 
-git clone https://github.com/Maratyszcza/NNPACK NNPACK
-git clone https://github.com/Maratyszcza/pthreadpool  NNPACK/pthreadpool
 
-# Use specific versioning tag.
-(cd NNPACK && git checkout 1e005b0c2)
-(cd NNPACK/pthreadpool && git checkout 13da0b4c)
+echo deb http://apt.llvm.org/bionic/ llvm-toolchain-bionic-10 main\
+ >> /etc/apt/sources.list.d/llvm.list
+echo deb-src http://apt.llvm.org/bionic/ llvm-toolchain-bionic-10 main\
+ >> /etc/apt/sources.list.d/llvm.list
 
-mkdir -p NNPACK/build
-cd NNPACK/build
-cmake -DCMAKE_INSTALL_PREFIX:PATH=. -DNNPACK_INFERENCE_ONLY=OFF 
-DNNPACK_CONVOLUTION_ONLY=OFF -DNNPACK_BUILD_TESTS=OFF 
-DCMAKE_POSITION_INDEPENDENT_CODE=ON -DPTHREADPOOL_SOURCE_DIR=pthreadpool .. && 
make -j2 && make install
-cd -
+echo deb http://apt.llvm.org/bionic/ llvm-toolchain-bionic main\
+ >> /etc/apt/sources.list.d/llvm.list
+echo deb-src http://apt.llvm.org/bionic/ llvm-toolchain-bionic main\
+ >> /etc/apt/sources.list.d/llvm.list
+
+wget -q -O - http://apt.llvm.org/llvm-snapshot.gpg.key|sudo apt-key add -
+apt-get update && apt-get install -y llvm-9 llvm-10 llvm-11 clang-9 clang-10 
clang-11
diff --git a/docker/install/ubuntu_install_redis.sh 
b/docker/install/ubuntu1804_install_python.sh
similarity index 71%
copy from docker/install/ubuntu_install_redis.sh
copy to docker/install/ubuntu1804_install_python.sh
index 9679fdd..6b4d6fb 100755
--- a/docker/install/ubuntu_install_redis.sh
+++ b/docker/install/ubuntu1804_install_python.sh
@@ -6,9 +6,9 @@
 # to you under the Apache License, Version 2.0 (the
 # "License"); you may not use this file except in compliance
 # with the License.  You may obtain a copy of the License at
-# 
+#
 #   http://www.apache.org/licenses/LICENSE-2.0
-# 
+#
 # Unless required by applicable law or agreed to in writing,
 # software distributed under the License is distributed on an
 # "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
@@ -20,6 +20,13 @@ set -e
 set -u
 set -o pipefail
 
-apt-get update && apt-get install -y redis-server
-pip2 install xgboost psutil
-pip3 install xgboost psutil
+# install python and pip, don't modify this, modify install_python_package.sh

[incubator-tvm] branch master updated: [CI] Update ci-cpu to bionic (#5555)

2020-05-11 Thread tqchen
This is an automated email from the ASF dual-hosted git repository.

tqchen pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/incubator-tvm.git


The following commit(s) were added to refs/heads/master by this push:
 new a4eae2b  [CI] Update ci-cpu to bionic (#)
a4eae2b is described below

commit a4eae2b12b3b84ed28c2a9f4678d64cf540c6746
Author: Tianqi Chen 
AuthorDate: Mon May 11 09:04:20 2020 -0700

[CI] Update ci-cpu to bionic (#)
---
 Jenkinsfile| 2 +-
 tests/scripts/task_config_build_cpu.sh | 2 +-
 tests/scripts/task_rust.sh | 2 +-
 3 files changed, 3 insertions(+), 3 deletions(-)

diff --git a/Jenkinsfile b/Jenkinsfile
index 1ad8350..9f36120 100644
--- a/Jenkinsfile
+++ b/Jenkinsfile
@@ -45,7 +45,7 @@
 
 ci_lint = "tvmai/ci-lint:v0.60"
 ci_gpu = "tvmai/ci-gpu:v0.63"
-ci_cpu = "tvmai/ci-cpu:v0.61"
+ci_cpu = "tvmai/ci-cpu:v0.62"
 ci_i386 = "tvmai/ci-i386:v0.52"
 
 // tvm libraries
diff --git a/tests/scripts/task_config_build_cpu.sh 
b/tests/scripts/task_config_build_cpu.sh
index 912e59e..3cd8a3c 100755
--- a/tests/scripts/task_config_build_cpu.sh
+++ b/tests/scripts/task_config_build_cpu.sh
@@ -29,7 +29,7 @@ echo set\(USE_MICRO_STANDALONE_RUNTIME ON\) >> config.cmake
 echo set\(USE_GRAPH_RUNTIME_DEBUG ON\) >> config.cmake
 echo set\(USE_VM_PROFILER ON\) >> config.cmake
 echo set\(USE_EXAMPLE_EXT_RUNTIME ON\) >> config.cmake
-echo set\(USE_LLVM llvm-config-8\) >> config.cmake
+echo set\(USE_LLVM llvm-config-9\) >> config.cmake
 echo set\(USE_NNPACK ON\) >> config.cmake
 echo set\(NNPACK_PATH /NNPACK/build/\) >> config.cmake
 echo set\(USE_ANTLR ON\) >> config.cmake
diff --git a/tests/scripts/task_rust.sh b/tests/scripts/task_rust.sh
index 5529632..93195e4 100755
--- a/tests/scripts/task_rust.sh
+++ b/tests/scripts/task_rust.sh
@@ -24,7 +24,7 @@ export TVM_HOME="$(git rev-parse --show-toplevel)"
 export LD_LIBRARY_PATH="$TVM_HOME/lib:$TVM_HOME/build:${LD_LIBRARY_PATH:-}"
 export PYTHONPATH="$TVM_HOME/python":"$TVM_HOME/topi/python"
 export RUST_DIR="$TVM_HOME/rust"
-export LLVM_CONFIG_PATH=`which llvm-config-8`
+export LLVM_CONFIG_PATH=`which llvm-config-9`
 echo "Using $LLVM_CONFIG_PATH"
 
 cd $RUST_DIR



[GitHub] [incubator-tvm] roastduck opened a new issue #5559: [TIR] Bugs in HoistIfThenElse

2020-05-11 Thread GitBox


roastduck opened a new issue #5559:
URL: https://github.com/apache/incubator-tvm/issues/5559


   `HoistIfThenElse` is a pass currently not enabled in TVM. I tried to enable 
it in #5553, but there are too many bugs in this pass. Let's fix them first.
   
   **BUG 1:** `HoistIfThenElse` transforms
   
   ```
   for (n.inner, 0, 2) {
 for (o.inner, 0, 2) {
   if threadIdx.y*2) + n.inner) < 2)) {
 if threadIdx.z*2) + o.inner) < 4)) {
   if ((threadIdx.y < 1)) {
 if ((threadIdx.z < 2)) {
   tvm_store_matrix_sync(Conv.wmma.accumulator, 16, 16, 16, 
((n.inner*2) + o.inner), tvm_access_ptr(type_annotation(), Conv, 
(threadIdx.y*401408) + (n.inner*200704)) + (blockIdx.z*1024)) + 
(threadIdx.z*512)) + (o.inner*256)), 256, 2), 16, "row_major")
 }
   }
 }
   }
 }
   }
   ```
   
   into
   
   ```
   if threadIdx.y*2) + n.inner) < 2)) {
 if ((threadIdx.y < 1)) {
   if ((threadIdx.z < 2)) {
 for (n.inner, 0, 2) {
   for (o.inner, 0, 2) {
 if threadIdx.z*2) + o.inner) < 4)) {
   tvm_store_matrix_sync(Conv.wmma.accumulator, 16, 16, 16, 
((n.inner*2) + o.inner), tvm_access_ptr(type_annotation(), Conv, 
(threadIdx.y*401408) + (n.inner*200704)) + (blockIdx.z*1024)) + 
(threadIdx.z*512)) + (o.inner*256)), 256, 2), 16, "row_major")
 }
   }
 }
   }
 }
   }
   ```
   
   Possible cause:
   
   
https://github.com/apache/incubator-tvm/blob/0e877521f454e239f5c44bb88e557801444d81a5/src/tir/pass/hoist_if_then_else.cc#L295
   
   It only checks whether `if_stmt` has a preferred position, but that position 
is not guaranteed to be the current position. Change it to
   
   ```c++
   if (if_position_map.count(if_stmt.get()) &&
   if_position_map.at(if_stmt.get()).as()->loop_var.get() == 
top_for_var) {
   ```
   
   may solve the problem.
   
   **BUG 2:** `src/tir/transforms/split_host_device.cc` want the IR to be an 
SSA form, where each variable can only be defined once. Since we are copying 
loops into both "then" branches and "else" branches, we have to rename the loop 
variables in "else" branches to be different from those in "then" branches. I 
have already written some code for this, see #5553.
   
   **BUG 3:**  `IfThenElse` nodes containing thread indices should not be 
hoisted over the definition of the indices. This would happen when `Attr` node 
for `thread_extent` is scheduled into the body of a `For` node, using a 
`compute_at` command. I have already written some code for this, see #5553.
   
   **BUG 4:** 
   
   
https://github.com/apache/incubator-tvm/blob/0e877521f454e239f5c44bb88e557801444d81a5/src/tir/pass/hoist_if_then_else.cc#L371
   
   Look at this line. `if_stmt` can already been updated when running this 
line. Look at the example below.
   
   ```
   for (i, 0, 10) {
 for (j, 0, 10) {
   for (k, 0, 10) {
 if ((i >= 3)) {
   if ((j >= 3)) {
 data[(((i*100) + (j*10)) + k)] = (data[(((i*100) + (j*10)) + k)] + 
0.5f)
   }
 }
   }
 }
   }
   ```
   
   After hoisting `j >= 3`, if becomes
   
   ```
   for (i, 0, 10) {
 for (j, 0, 10) {
   if ((j >= 3)) {
 for (k, 0, 10) {
   if ((i >= 3)) {
 data[(((i*100) + (j*10)) + k)] = (data[(((i*100) + (j*10)) + k)] + 
0.5f)
   }
 }
   }
 }
   }
   ```
   
   Now, when we are hoisting `i >= 3`, we need to compare and remove
   
   ```
   if ((i >= 3)) {
 if ((j >= 3)) {
   data[(((i*100) + (j*10)) + k)] = (data[(((i*100) + (j*10)) + k)] + 0.5f)
 }
   }
   ```
   
   But `j >= 3` has been gone, so `RemoveIf` fails. We have to track the 
updating to `IfThenElse` just like what we did for `For`.
   
   **BUG 4:** It is for tests this time.
   
   
https://github.com/apache/incubator-tvm/blob/0e877521f454e239f5c44bb88e557801444d81a5/tests/python/unittest/test_tir_pass_hoist_if.py#L175
   
   Why do we expect a `('For', 'j')` inside itself? As a potential problem, 
maybe we should change the variable names to prevent there are two `i`s and two 
`j`s.
   
   These are all the bugs I found.
   
   Beside, I suggest changing all the `for (size_t i = 0; i < xxx.size(); i++)` 
into `for (size_t i = 0, n = xxx.size(); i < n; i++)`, since C++ compiler can't 
detect this loop invariant.



This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org




[GitHub] [incubator-tvm] roastduck commented on pull request #5553: [TIR] Enable HoistIfThenElse in the default lowering procedure

2020-05-11 Thread GitBox


roastduck commented on pull request #5553:
URL: https://github.com/apache/incubator-tvm/pull/5553#issuecomment-626669556


   Since there are too many bugs in `HoistIfThenElse`, let's track them in 
another issue, and enable the pass after they are all fixed. Closing for now.



This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org




[GitHub] [incubator-tvm] masahi commented on pull request #5552: [BYOC, MergeComposite] Add additional check before re-using the cached match

2020-05-11 Thread GitBox


masahi commented on pull request #5552:
URL: https://github.com/apache/incubator-tvm/pull/5552#issuecomment-626658705


   Thanks @comaniac @zhiics 



This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org




[incubator-tvm] branch master updated: [BYOC, MergeComposite] Add additional check before re-using the cached match (#5552)

2020-05-11 Thread masahi
This is an automated email from the ASF dual-hosted git repository.

masahi pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/incubator-tvm.git


The following commit(s) were added to refs/heads/master by this push:
 new 0e87752  [BYOC, MergeComposite] Add additional check before re-using 
the cached match (#5552)
0e87752 is described below

commit 0e877521f454e239f5c44bb88e557801444d81a5
Author: masahi 
AuthorDate: Mon May 11 21:00:43 2020 +0900

[BYOC, MergeComposite] Add additional check before re-using the cached 
match (#5552)

* Add additional check before re-using the cached match in merge composite

* clean up ExtractPattern calls
---
 src/relay/transforms/merge_composite.cc | 11 ++-
 tests/python/relay/test_pass_merge_composite.py | 39 +
 2 files changed, 42 insertions(+), 8 deletions(-)

diff --git a/src/relay/transforms/merge_composite.cc 
b/src/relay/transforms/merge_composite.cc
index 46fdae0..ae549fa 100644
--- a/src/relay/transforms/merge_composite.cc
+++ b/src/relay/transforms/merge_composite.cc
@@ -121,17 +121,12 @@ class MergeCompositeWrapper : public ExprMutator {
 for (const auto& arg : pattern->args) {
   Expr new_arg;
   if (arg->IsInstance()) {
+new_arg =
+ExtractPattern(Downcast(arg), Downcast(root->args[i]), 
var_map, call_map);
 // if we've already processed this call node, return the previous 
result
-if (call_map->find(arg) != call_map->end()) {
+if (call_map->find(arg) != call_map->end() && new_arg.defined()) {
   new_arg = (*call_map)[arg];
 } else {
-  // fail if the root argument is not also a call node
-  if (!root->args[i]->IsInstance()) {
-return Expr();
-  }
-  // if it's a call node, recursively call this function
-  new_arg =
-  ExtractPattern(Downcast(arg), 
Downcast(root->args[i]), var_map, call_map);
   call_map->Set(arg, new_arg);
 }
   } else if (arg->IsInstance()) {
diff --git a/tests/python/relay/test_pass_merge_composite.py 
b/tests/python/relay/test_pass_merge_composite.py
index e3c8991..317bb42 100644
--- a/tests/python/relay/test_pass_merge_composite.py
+++ b/tests/python/relay/test_pass_merge_composite.py
@@ -765,6 +765,44 @@ def test_pattern_with_check():
 assert result.body.op.attrs["Composite"] == "conv_bias_relu"
 
 
+def test_diamond_not_merge():
+"""
+The pattern on the left shouldn't match the structure on the right
+
+relu relu
+ | \  | \
+ | clip   | add
+ |  / |  |
+ mul  | clip
+  |  /
+  mul
+"""
+def get_pattern():
+conv = make_conv_bias_relu_pattern()
+clip = relay.op.clip(conv, 0, 255)
+return relay.op.multiply(conv, clip)
+
+def get_net():
+data = relay.var('data', shape=(1, 512, 28, 28))
+kernel = relay.var('kernel', shape=(256, 512, 1, 1))
+conv = relay.nn.conv2d(data, kernel,
+   kernel_size=(1, 1),
+   padding=(0, 0),
+   strides=(1, 1))
+bias = relay.nn.bias_add(conv, relay.var('bias', shape=(256,)))
+relu = relay.nn.relu(bias)
+add = relay.op.add(relu, relay.const(1.0))
+clip2 = relay.op.clip(add, 0, 255)
+mul = relay.op.multiply(relu, clip2)
+return relay.Function(relay.analysis.free_vars(mul), mul)
+
+pat_table = [("pat", get_pattern())]
+net = get_net()
+result = run_opt_pass(net, relay.transform.MergeComposite(pat_table))
+expected = run_opt_pass(net, relay.transform.InferType())
+assert tvm.ir.structural_equal(result, expected, map_free_vars=True)
+
+
 if __name__ == "__main__":
 test_simple_merge()
 test_branch_merge()
@@ -775,3 +813,4 @@ if __name__ == "__main__":
 test_reuse_call_merge()
 test_tuple_get_item_merge()
 test_pattern_with_check()
+test_diamond_not_merge()



[GitHub] [incubator-tvm] liangfu commented on pull request #5547: [Refactor][std::string --> String] IR is updated with String

2020-05-11 Thread GitBox


liangfu commented on pull request #5547:
URL: https://github.com/apache/incubator-tvm/pull/5547#issuecomment-626652892


   Hi @ANSHUMAN87, please rebase upon the latest master branch, and resolve the 
conflicts. Thanks!



This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org




[GitHub] [incubator-tvm] lixiaoquan commented on a change in pull request #5429: [RELAY][TF] Support symbolic newshape for Reshape

2020-05-11 Thread GitBox


lixiaoquan commented on a change in pull request #5429:
URL: https://github.com/apache/incubator-tvm/pull/5429#discussion_r422950273



##
File path: python/tvm/relay/op/_transform.py
##
@@ -189,10 +192,9 @@ def _reshape_shape_func(data_shape, newshape, ndim):
 out[infer_idx] = old_size // new_size
 return out
 
-@_reg.register_shape_func("reshape", False)
+@_reg.register_shape_func("reshape", True)

Review comment:
   @icemelon9  I've solved your concern. Could you please take another 
look? Thanks





This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org




[GitHub] [incubator-tvm] giuseros opened a new pull request #5558: Add a quantized conv2 unit test for the tflite front-end

2020-05-11 Thread GitBox


giuseros opened a new pull request #5558:
URL: https://github.com/apache/incubator-tvm/pull/5558


   Signed-off-by: Giuseppe Rossini 
   
   I am adding a conv2/quantized test case in 
`tests/python/frontend/tflite/test_forward.py`



This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org




[GitHub] [incubator-tvm] xqdan commented on pull request #5483: [TIR][Printer] text format printer considering future parsing use

2020-05-11 Thread GitBox


xqdan commented on pull request #5483:
URL: https://github.com/apache/incubator-tvm/pull/5483#issuecomment-626509149


   > > Binds in some pass function is not clean for round trip dump ir, how do 
we deal with it?
   > 
   > Do you mean that `buffer_bind` is not necessary to print after the pass 
`storage_flatten`?
   > Yes, the buffer no longer exists after the flatten pass. All we have is 
that Var(buffer->data) in Load and Store. But we still need a place to define 
those vars, and that's why we still have buffer_bind, where we define buffer as 
well as buffer->data, in low-level functions
   > 
   > Furthermore, maybe one day we can use BufferLoad/ BufferStore after the 
flatten and use buffer from the beginning to the end.
   
   
https://github.com/apache/incubator-tvm/blob/master/src/driver/driver_api.cc#L139
   
   that's i'm asking, seems binds is embedding into ir at the beginning, looks 
good



This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org