Skip to content

Commit

Permalink
Update TVM Version and CI scripts (apache#46)
Browse files Browse the repository at this point in the history
  • Loading branch information
tqchen authored and sergei-mironov committed Aug 8, 2018
1 parent 975a64d commit 01d9fd2
Show file tree
Hide file tree
Showing 21 changed files with 74 additions and 50 deletions.
2 changes: 1 addition & 1 deletion vta/Jenkinsfile
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@

// nnvm libraries
vta_lib = "lib/libvta.so, lib/libvta.so.json"
vta_lib += ", nnvm/tvm/lib/libtvm.so, nnvm/tvm/lib/libtvm_topi.so, nnvm/lib/libnnvm_compiler.so"
vta_lib += ", tvm/build/libtvm.so, tvm/build/libtvm_topi.so, tvm/build/libnnvm_compiler.so"


// command to start a docker container
Expand Down
4 changes: 2 additions & 2 deletions vta/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -53,10 +53,10 @@ lib/libvta.so: $(VTA_LIB_OBJ)
lint: pylint cpplint

cpplint:
python nnvm/dmlc-core/scripts/lint.py vta cpp include src
python3 tvm/dmlc-core/scripts/lint.py vta cpp include src

pylint:
pylint python/vta --rcfile=$(ROOTDIR)/tests/lint/pylintrc
python3 -m pylint python/vta --rcfile=$(ROOTDIR)/tests/lint/pylintrc

doc:
doxygen docs/Doxyfile
Expand Down
8 changes: 4 additions & 4 deletions vta/docs/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -3,14 +3,14 @@

# You can set these variables from the command line.
SPHINXOPTS =
SPHINXBUILD = sphinx-build
SPHINXBUILD = python3 -m sphinx
PAPER =
BUILDDIR = _build

# User-friendly check for sphinx-build
ifeq ($(shell which $(SPHINXBUILD) >/dev/null 2>&1; echo $$?), 1)
$(error The '$(SPHINXBUILD)' command was not found. Make sure you have Sphinx installed, then set the SPHINXBUILD environment variable to point to the full path of the '$(SPHINXBUILD)' executable. Alternatively you can add the directory with the executable to your PATH. If you don't have Sphinx installed, grab it from http://sphinx-doc.org/)
endif
#ifeq ($(shell which $(SPHINXBUILD) >/dev/null 2>&1; echo $$?), 1)
#$(error The '$(SPHINXBUILD)' command was not found. Make sure you have Sphinx installed, then set the SPHINXBUILD environment variable to point to the full path of the '$(SPHINXBUILD)' executable. Alternatively# you can add the directory with the executable to your PATH. If you don't have Sphinx installed, grab it from http://sphinx-doc.org/)
#endif

# Internal variables.
PAPEROPT_a4 = -D latex_paper_size=a4
Expand Down
4 changes: 2 additions & 2 deletions vta/docs/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -171,7 +171,7 @@ def run_doxygen(folder):
'numpy': ('http://docs.scipy.org/doc/numpy/', None),
'scipy': ('http://docs.scipy.org/doc/scipy/reference', None),
'matplotlib': ('http://matplotlib.org/', None),
'tvm': ('http://docs.tvmlang.org/', None),
'tvm': ('https://docs.tvm.ai/', None),
}

from sphinx_gallery.sorting import ExplicitOrder
Expand Down Expand Up @@ -201,7 +201,7 @@ def setup(app):
'doc_module': ('vta', 'numpy'),
'reference_url': {
'vta': None,
'tvm': 'http://docs.tvmlang.org',
'tvm': 'https://docs.tvm.ai',
'matplotlib': 'http://matplotlib.org',
'numpy': 'http://docs.scipy.org/doc/numpy-1.9.1'},
'examples_dirs': examples_dirs,
Expand Down
1 change: 0 additions & 1 deletion vta/docs/index.rst
Original file line number Diff line number Diff line change
Expand Up @@ -17,4 +17,3 @@ Contents
api/python/index
dev/index
api_links
genindex
4 changes: 2 additions & 2 deletions vta/python/vta/ir_pass.py
Original file line number Diff line number Diff line change
Expand Up @@ -350,7 +350,7 @@ def _fold_buffer_dim(buf, scope, elem_block):
shape = [elem_block]
strides = [1]

if (base < ndim + 1 and not util.equal_const_int(buf.strides[ndim - base], elem_block)):
if base < ndim + 1 and not util.equal_const_int(buf.strides[ndim - base], elem_block):
shape.append(1)
strides.append(elem_block)

Expand Down Expand Up @@ -628,7 +628,7 @@ def _flatten_loop(src_coeff, dst_coeff, extents):
next_dst = dst_coeff.pop()
next_ext = extents.pop()

if (_equal(next_src, vsrc * vext) and _equal(next_dst, vdst * vext)):
if _equal(next_src, vsrc * vext) and _equal(next_dst, vdst * vext):
vext = tvm.ir_pass.Simplify(vext * next_ext)
else:
rev_src_coeff.append(vsrc)
Expand Down
6 changes: 3 additions & 3 deletions vta/python/vta/pkg_config.py
Original file line number Diff line number Diff line change
Expand Up @@ -41,9 +41,9 @@ def __init__(self, cfg, proj_root):
# include path
self.include_path = [
"-I%s/include" % proj_root,
"-I%s/nnvm/tvm/include" % proj_root,
"-I%s/nnvm/tvm/dlpack/include" % proj_root,
"-I%s/nnvm/dmlc-core/include" % proj_root
"-I%s/tvm/include" % proj_root,
"-I%s/tvm/dlpack/include" % proj_root,
"-I%s/tvm/dmlc-core/include" % proj_root
]
# List of source files that can be used to build standalone library.
self.lib_source = []
Expand Down
3 changes: 2 additions & 1 deletion vta/src/device_api.cc
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
#include <dmlc/thread_local.h>
#include <vta/runtime.h>

#include "../nnvm/tvm/src/runtime/workspace_pool.h"
#include "../tvm/src/runtime/workspace_pool.h"


namespace tvm {
Expand Down Expand Up @@ -42,6 +42,7 @@ class VTADeviceAPI final : public DeviceAPI {
size_t size,
TVMContext ctx_from,
TVMContext ctx_to,
TVMType type_hint,
TVMStreamHandle stream) final {
int kind_mask = 0;
if (ctx_from.device_type != kDLCPU) {
Expand Down
24 changes: 17 additions & 7 deletions vta/tests/ci_build/Dockerfile.cpu
Original file line number Diff line number Diff line change
Expand Up @@ -6,21 +6,31 @@ 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_llvm.sh /install/ubuntu_install_llvm.sh
RUN bash /install/ubuntu_install_llvm.sh

COPY install/ubuntu_install_python.sh /install/ubuntu_install_python.sh
RUN bash /install/ubuntu_install_python.sh

COPY install/ubuntu_install_iverilog.sh /install/ubuntu_install_iverilog.sh
RUN bash /install/ubuntu_install_iverilog.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_java.sh /install/ubuntu_install_java.sh
RUN bash /install/ubuntu_install_java.sh

COPY install/ubuntu_install_llvm.sh /install/ubuntu_install_llvm.sh
RUN bash /install/ubuntu_install_llvm.sh

COPY install/ubuntu_install_opengl.sh /install/ubuntu_install_opengl.sh
RUN bash /install/ubuntu_install_opengl.sh


COPY install/ubuntu_install_sphinx.sh /install/ubuntu_install_sphinx.sh
RUN bash /install/ubuntu_install_sphinx.sh

# Enable doxygen for c++ doc build
RUN apt-get update && apt-get install -y doxygen graphviz

# Fix recommonmark to latest version
RUN git clone https://github.com/rtfd/recommonmark
RUN cd recommonmark; python setup.py install

# Enable doxygen for c++ doc build
RUN apt-get update && apt-get install -y doxygen graphviz
RUN cd recommonmark; python3 setup.py install
6 changes: 4 additions & 2 deletions vta/tests/ci_build/Dockerfile.lint
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
# For lint test
FROM ubuntu:16.04

RUN apt-get update && apt-get install -y python-pip sudo
RUN apt-get update && apt-get install -y sudo wget
COPY install/ubuntu_install_python.sh /install/ubuntu_install_python.sh
RUN bash /install/ubuntu_install_python.sh
RUN apt-get install -y doxygen graphviz
RUN pip install cpplint pylint
RUN pip3 install cpplint pylint
8 changes: 8 additions & 0 deletions vta/tests/ci_build/install/ubuntu_install_iverilog.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
apt-get install -y --no-install-recommends --force-yes make bison flex
wget ftp://icarus.com/pub/eda/verilog/v10/verilog-10.1.tar.gz
tar xf verilog-10.1.tar.gz
cd verilog-10.1
./configure --prefix=/usr
make install -j8
cd ..
rm -rf verilog-10.1 verilog-10.1.tar.gz
1 change: 1 addition & 0 deletions vta/tests/ci_build/install/ubuntu_install_java.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
apt-get update && apt-get install -y openjdk-8-jdk maven
2 changes: 1 addition & 1 deletion vta/tests/ci_build/install/ubuntu_install_llvm.sh
Original file line number Diff line number Diff line change
Expand Up @@ -19,4 +19,4 @@ echo deb-src http://apt.llvm.org/xenial/ llvm-toolchain-xenial main\
>> /etc/apt/sources.list.d/llvm.list

wget -O - http://apt.llvm.org/llvm-snapshot.gpg.key|sudo apt-key add -
apt-get update && apt-get install -y --force-yes llvm-4.0 llvm-5.0 llvm-6.0
apt-get update && apt-get install -y --force-yes llvm-4.0 llvm-5.0 llvm-6.0 clang-6.0
4 changes: 4 additions & 0 deletions vta/tests/ci_build/install/ubuntu_install_opengl.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
apt-get update --fix-missing

apt-get install -y --no-install-recommends --force-yes \
libgl1-mesa-dev libglfw3-dev
13 changes: 10 additions & 3 deletions vta/tests/ci_build/install/ubuntu_install_python.sh
Original file line number Diff line number Diff line change
@@ -1,5 +1,12 @@
# install python and pip, don't modify this, modify install_python_package.sh
apt-get update && apt-get install -y python-pip python-dev python3-dev
apt-get update && apt-get install -y python-dev

# the version of the pip shipped with ubuntu may be too lower, install a recent version here
cd /tmp && wget https://bootstrap.pypa.io/get-pip.py && python3 get-pip.py && python2 get-pip.py
# python 3.6
apt-get update && yes | apt-get install software-properties-common
add-apt-repository ppa:jonathonf/python-3.6 &&\
apt-get update && apt-get install -y python-pip python-dev python3.6 python3.6-dev

rm -f /usr/bin/python3 && ln -s /usr/bin/python3.6 /usr/bin/python3

# Install pip
cd /tmp && wget https://bootstrap.pypa.io/get-pip.py && python2 get-pip.py && python3.6 get-pip.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
# install libraries for python package on ubuntu
pip2 install nose pylint numpy nose-timer cython decorator scipy tornado
pip3 install nose pylint numpy nose-timer cython decorator scipy tornado
pip3 install nose pylint numpy nose-timer cython decorator scipy tornado typed_ast
2 changes: 1 addition & 1 deletion vta/tests/ci_build/install/ubuntu_install_sphinx.sh
Original file line number Diff line number Diff line change
@@ -1 +1 @@
pip install sphinx sphinx-gallery sphinx_rtd_theme matplotlib Image commonmark>=0.7.3 docutils>=0.11
pip3 install sphinx sphinx-gallery sphinx_rtd_theme matplotlib Image commonmark>=0.7.3 docutils>=0.11
18 changes: 6 additions & 12 deletions vta/tests/scripts/task_build.sh
Original file line number Diff line number Diff line change
@@ -1,21 +1,15 @@
#!/bin/bash
echo "Build TVM..."
cd nnvm/tvm
cp make/config.mk .
echo USE_CUDA=0 >> config.mk
echo LLVM_CONFIG=llvm-config-4.0 >> config.mk
echo USE_RPC=1 >> config.mk
echo USE_BLAS=openblas >> config.mk
echo USE_GRAPH_RUNTIME=1 >> config.mk
cd tvm
cp cmake/config.cmake .
echo set\(USE_LLVM llvm-config-5.0\) >> config.cmake
echo set\(USE_RPC ON\) >> config.cmake
echo set\(USE_BLAS openblas\) >> config.cmake
echo set\(USE_GRAPH_RUNTIME ON\) >> config.cmake
make "$@"
make cython
make cython3
cd ..

echo "Build NNVM..."
make "$@"

cd ..

echo "Build VTA..."
make "$@"
4 changes: 1 addition & 3 deletions vta/tests/scripts/task_clean.sh
Original file line number Diff line number Diff line change
@@ -1,10 +1,8 @@
#!/bin/bash
echo "Cleanup data..."
cd nnvm
make clean

cd tvm
make clean

cd ../..
cd ..
make clean
6 changes: 3 additions & 3 deletions vta/tests/scripts/task_python_docs.sh
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
#!/bin/bash
cd nnvm/tvm
cd tvm
make cython
make cython3
cd ../../
cd ../

mkdir -p docs/_build/html
# C++ doc
Expand All @@ -11,7 +11,7 @@ make doc
rm -rf python/vta/*.pyc python/vta/*/*.pyc

cd docs
PYTHONPATH=../python:../nnvm/tvm/python:../nnvm/tvm/topi/python:../nnvm/python make html || exit -1
PYTHONPATH=../python:../tvm/python:../tvm/topi/python:../tvm/nnvm/python make html || exit -1
cd _build/html
tar czf docs.tgz *
mv docs.tgz ../../../
2 changes: 1 addition & 1 deletion vta/tests/scripts/task_python_test.sh
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#!/bin/bash

export PYTHONPATH=python:nnvm/python:nnvm/tvm/python:nnvm/tvm/topi/python
export PYTHONPATH=python:tvm/nnvm/python:tvm/python:tvm/topi/python

echo "Running unittest..."
python -m nose -v tests/python/unittest || exit -1
Expand Down

0 comments on commit 01d9fd2

Please sign in to comment.