Skip to content

Commit 0e9a464

Browse files
author
Peter Yeh
committed
Merge branch 'master' into benchmark
* master: (51 commits) [QNN][TFLite] Parsing QNN Add op. Adding MobilenetV2. (apache#4142) [CI] Pin NNPack pthreadtools version (apache#4152) Fix typo (apache#4144) [Relay][Frontend][TF] Add tensor array ops (apache#3798) [relay][vm] Separate VM runtime with executable (apache#4100) [PATCH] Fix undefined __floatdihf in libtvmruntime.so on aarch64. (apache#4119) [DOCKER] Pin torchvision==0.4.1 (apache#4140) [TOPI][x86] Cascade lake support. (apache#4123) [Relay] Improve build error when no lowered funcs are produced (apache#4132) [RUNTIME] Refactor object python FFI to new protocol. (apache#4128) Update PULL_REQUEST_TEMPLATE.md Adding support for dequantizing from int32 to float32. (apache#4130) [Relay][Training] Add and fix gradients (apache#4126) [QNN] Change default rouning to UPWARD. (apache#4131) Fix infer type of kernel in dense. (apache#4125) [Relay][AlterOpLayout] NHWC to NCHWc pad operator. (apache#4103) [ARITH] Fix lowering of floormod(x, y) != 0 (apache#4127) [RFC][RUNTIME] Introduce new object protocol. (apache#4115) [Relay][Topi] Disable conv NHWC pack int8. (apache#4038) Update task_cpp_unittest.sh ...
2 parents 9d5c129 + fdb01cb commit 0e9a464

File tree

165 files changed

+8142
-2996
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

165 files changed

+8142
-2996
lines changed

.github/PULL_REQUEST_TEMPLATE.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
Thanks for contributing to TVM! Please refer to guideline https://docs.tvm.ai/contribute/ for useful information and tips. After the pull request is submitted, please request code reviews from [Reviewers](https://github.com/dmlc/tvm/blob/master/CONTRIBUTORS.md#reviewers).
1+
Thanks for contributing to TVM! Please refer to guideline https://docs.tvm.ai/contribute/ for useful information and tips. After the pull request is submitted, please request code reviews from [Reviewers](https://github.com/dmlc/tvm/blob/master/CONTRIBUTORS.md#reviewers) by @ them in the pull request thread.

CONTRIBUTORS.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -97,6 +97,7 @@ We do encourage everyone to work anything they are interested in.
9797
- [Junru Shao](https://github.com/junrushao1994): @junrushao1994
9898
- [Haichen Shen](https://github.com/icemelon9): @icemelon9
9999
- [Xingjian Shi](https://github.com/sxjscience): @sxjscience
100+
- [Jon Soifer](https://github.com/soiferj): @soiferj
100101
- [Andrew Tulloch](https://github.com/ajtulloch): @ajtulloch
101102
- [Luis Vega](https://github.com/vegaluisjose): @vegaluisjose
102103
- [Alex Weaver](https://github.com/alex-weaver): @alex-weaver

Makefile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -70,7 +70,7 @@ cpplint:
7070
python3 3rdparty/dmlc-core/scripts/lint.py vta cpp vta/include vta/src
7171
python3 3rdparty/dmlc-core/scripts/lint.py topi cpp topi/include;
7272
python3 3rdparty/dmlc-core/scripts/lint.py nnvm cpp nnvm/include nnvm/src;
73-
python3 3rdparty/dmlc-core/scripts/lint.py tvm cpp include src verilog\
73+
python3 3rdparty/dmlc-core/scripts/lint.py tvm cpp include src \
7474
examples/extension/src examples/graph_executor/src
7575

7676
pylint:

apps/howto_deploy/python_deploy.py

Lines changed: 48 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,48 @@
1+
# Licensed to the Apache Software Foundation (ASF) under one
2+
# or more contributor license agreements. See the NOTICE file
3+
# distributed with this work for additional information
4+
# regarding copyright ownership. The ASF licenses this file
5+
# to you under the Apache License, Version 2.0 (the
6+
# "License"); you may not use this file except in compliance
7+
# with the License. You may obtain a copy of the License at
8+
#
9+
# http://www.apache.org/licenses/LICENSE-2.0
10+
#
11+
# Unless required by applicable law or agreed to in writing,
12+
# software distributed under the License is distributed on an
13+
# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
14+
# KIND, either express or implied. See the License for the
15+
# specific language governing permissions and limitations
16+
# under the License.
17+
18+
# Copyright (c) 2017 by Contributors
19+
# brief Example code on load and run TVM module.s
20+
# file python_deploy.py
21+
22+
import tvm
23+
import numpy as np
24+
25+
def verify(mod, fname):
26+
# Get the function from the module
27+
f = mod.get_function(fname)
28+
# Use tvm.nd.array to convert numpy ndarray to tvm
29+
# NDArray type, so that function can be invoked normally
30+
N = 10
31+
x = tvm.nd.array(np.arange(N, dtype=np.float32))
32+
y = tvm.nd.array(np.zeros(N, dtype=np.float32))
33+
# Invoke the function
34+
f(x, y)
35+
np_x = x.asnumpy()
36+
np_y = y.asnumpy()
37+
# Verify correctness of function
38+
assert(np.all([xi+1 == yi for xi, yi in zip(np_x, np_y)]))
39+
print("Finish verification...")
40+
41+
42+
if __name__ == "__main__":
43+
# The normal dynamic loading method for deployment
44+
mod_dylib = tvm.module.load("lib/test_addone_dll.so")
45+
print("Verify dynamic loading from test_addone_dll.so")
46+
verify(mod_dylib, "addone")
47+
# There might be methods to use the system lib way in
48+
# python, but dynamic loading is good enough for now.

apps/howto_deploy/run_example.sh

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,5 +25,8 @@ export DYLD_LIBRARY_PATH=../../build:${DYLD_LIBRARY_PATH}
2525
echo "Run the deployment with all in one packed library..."
2626
lib/cpp_deploy_pack
2727

28-
echo "Run the deployment with all in normal library..."
28+
echo "Run the cpp deployment with all in normal library..."
2929
lib/cpp_deploy_normal
30+
31+
echo "Run the python deployment with all in normal library..."
32+
python python_deploy.py

cmake/modules/VTA.cmake

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -84,7 +84,7 @@ elseif(PYTHON)
8484
# Rules for Zynq-class FPGAs with pynq OS support (see pynq.io)
8585
if(${VTA_TARGET} STREQUAL "pynq" OR
8686
${VTA_TARGET} STREQUAL "ultra96")
87-
file(GLOB FPGA_RUNTIME_SRCS vta/src/pynq/pynq_driver.cc)
87+
list(APPEND FPGA_RUNTIME_SRCS vta/src/pynq/pynq_driver.cc)
8888
# Rules for Pynq v2.4
8989
find_library(__cma_lib NAMES cma PATH /usr/lib)
9090
elseif(${VTA_TARGET} STREQUAL "de10nano") # DE10-Nano rules

docker/install/ubuntu_install_nnpack.sh

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -6,9 +6,9 @@
66
# to you under the Apache License, Version 2.0 (the
77
# "License"); you may not use this file except in compliance
88
# with the License. You may obtain a copy of the License at
9-
#
9+
#
1010
# http://www.apache.org/licenses/LICENSE-2.0
11-
#
11+
#
1212
# Unless required by applicable law or agreed to in writing,
1313
# software distributed under the License is distributed on an
1414
# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
@@ -22,11 +22,14 @@ set -o pipefail
2222

2323
apt-get update && apt-get install -y --no-install-recommends git cmake
2424

25-
# TODO: specific tag?
2625
git clone https://github.com/Maratyszcza/NNPACK NNPACK
26+
git clone https://github.com/Maratyszcza/pthreadpool NNPACK/pthreadpool
27+
28+
# Use specific versioning tag.
2729
(cd NNPACK && git checkout 1e005b0c2)
30+
(cd NNPACK/pthreadpool && git checkout 13da0b4c)
2831

2932
mkdir -p NNPACK/build
3033
cd NNPACK/build
31-
cmake -DCMAKE_INSTALL_PREFIX:PATH=. -DNNPACK_INFERENCE_ONLY=OFF -DNNPACK_CONVOLUTION_ONLY=OFF -DNNPACK_BUILD_TESTS=OFF -DCMAKE_POSITION_INDEPENDENT_CODE=ON .. && make -j4 && make install
34+
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 -j4 && make install
3235
cd -

docker/install/ubuntu_install_onnx.sh

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,5 +23,8 @@ set -o pipefail
2323
# fix to certain version for now
2424
pip3 install onnx==1.5.0
2525

26-
pip3 install https://download.pytorch.org/whl/cu80/torch-1.0.1.post2-cp36-cp36m-linux_x86_64.whl
27-
pip3 install torchvision
26+
# torch depends on a number of other packages, but unhelpfully, does
27+
# not expose that in the wheel!!!
28+
pip3 install future
29+
30+
pip3 install torch==1.2.0 torchvision==0.4.0

docs/install/from_source.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,7 @@ Our goal is to build the shared libraries:
5454
.. code:: bash
5555
5656
sudo apt-get update
57-
sudo apt-get install -y python3 python3-dev python3-setuptools gcc libtinfo-dev zlib1g-dev build-essential cmake
57+
sudo apt-get install -y python3 python3-dev python3-setuptools gcc libtinfo-dev zlib1g-dev build-essential cmake libedit-dev libxml2-dev
5858
5959
The minimal building requirements are
6060

include/tvm/arithmetic.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -245,6 +245,8 @@ class RewriteSimplifier {
245245
const Expr& new_expr,
246246
bool override = false);
247247

248+
std::function<void()> EnterConstraint(const Expr& constraint);
249+
248250
private:
249251
friend class Analyzer;
250252
friend class ConstraintContext;

0 commit comments

Comments
 (0)