Commit 430f0c14 by Tianqi Chen

Update TVM Version and CI scripts (#46)

parent d31f58b3
...@@ -5,7 +5,7 @@ ...@@ -5,7 +5,7 @@
// nnvm libraries // nnvm libraries
vta_lib = "lib/libvta.so, lib/libvta.so.json" 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 // command to start a docker container
......
...@@ -53,10 +53,10 @@ lib/libvta.so: $(VTA_LIB_OBJ) ...@@ -53,10 +53,10 @@ lib/libvta.so: $(VTA_LIB_OBJ)
lint: pylint cpplint lint: pylint cpplint
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:
pylint python/vta --rcfile=$(ROOTDIR)/tests/lint/pylintrc python3 -m pylint python/vta --rcfile=$(ROOTDIR)/tests/lint/pylintrc
doc: doc:
doxygen docs/Doxyfile doxygen docs/Doxyfile
......
...@@ -3,14 +3,14 @@ ...@@ -3,14 +3,14 @@
# You can set these variables from the command line. # You can set these variables from the command line.
SPHINXOPTS = SPHINXOPTS =
SPHINXBUILD = sphinx-build SPHINXBUILD = python3 -m sphinx
PAPER = PAPER =
BUILDDIR = _build BUILDDIR = _build
# User-friendly check for sphinx-build # User-friendly check for sphinx-build
ifeq ($(shell which $(SPHINXBUILD) >/dev/null 2>&1; echo $$?), 1) #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/) #$(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 #endif
# Internal variables. # Internal variables.
PAPEROPT_a4 = -D latex_paper_size=a4 PAPEROPT_a4 = -D latex_paper_size=a4
......
...@@ -171,7 +171,7 @@ intersphinx_mapping = { ...@@ -171,7 +171,7 @@ intersphinx_mapping = {
'numpy': ('http://docs.scipy.org/doc/numpy/', None), 'numpy': ('http://docs.scipy.org/doc/numpy/', None),
'scipy': ('http://docs.scipy.org/doc/scipy/reference', None), 'scipy': ('http://docs.scipy.org/doc/scipy/reference', None),
'matplotlib': ('http://matplotlib.org/', None), 'matplotlib': ('http://matplotlib.org/', None),
'tvm': ('http://docs.tvmlang.org/', None), 'tvm': ('https://docs.tvm.ai/', None),
} }
from sphinx_gallery.sorting import ExplicitOrder from sphinx_gallery.sorting import ExplicitOrder
...@@ -201,7 +201,7 @@ sphinx_gallery_conf = { ...@@ -201,7 +201,7 @@ sphinx_gallery_conf = {
'doc_module': ('vta', 'numpy'), 'doc_module': ('vta', 'numpy'),
'reference_url': { 'reference_url': {
'vta': None, 'vta': None,
'tvm': 'http://docs.tvmlang.org', 'tvm': 'https://docs.tvm.ai',
'matplotlib': 'http://matplotlib.org', 'matplotlib': 'http://matplotlib.org',
'numpy': 'http://docs.scipy.org/doc/numpy-1.9.1'}, 'numpy': 'http://docs.scipy.org/doc/numpy-1.9.1'},
'examples_dirs': examples_dirs, 'examples_dirs': examples_dirs,
......
...@@ -17,4 +17,3 @@ Contents ...@@ -17,4 +17,3 @@ Contents
api/python/index api/python/index
dev/index dev/index
api_links api_links
genindex
...@@ -350,7 +350,7 @@ def inject_dma_intrin(stmt_in): ...@@ -350,7 +350,7 @@ def inject_dma_intrin(stmt_in):
shape = [elem_block] shape = [elem_block]
strides = [1] 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) shape.append(1)
strides.append(elem_block) strides.append(elem_block)
...@@ -628,7 +628,7 @@ def inject_alu_intrin(stmt_in): ...@@ -628,7 +628,7 @@ def inject_alu_intrin(stmt_in):
next_dst = dst_coeff.pop() next_dst = dst_coeff.pop()
next_ext = extents.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) vext = tvm.ir_pass.Simplify(vext * next_ext)
else: else:
rev_src_coeff.append(vsrc) rev_src_coeff.append(vsrc)
......
...@@ -41,9 +41,9 @@ class PkgConfig(object): ...@@ -41,9 +41,9 @@ class PkgConfig(object):
# include path # include path
self.include_path = [ self.include_path = [
"-I%s/include" % proj_root, "-I%s/include" % proj_root,
"-I%s/nnvm/tvm/include" % proj_root, "-I%s/tvm/include" % proj_root,
"-I%s/nnvm/tvm/dlpack/include" % proj_root, "-I%s/tvm/dlpack/include" % proj_root,
"-I%s/nnvm/dmlc-core/include" % proj_root "-I%s/tvm/dmlc-core/include" % proj_root
] ]
# List of source files that can be used to build standalone library. # List of source files that can be used to build standalone library.
self.lib_source = [] self.lib_source = []
......
...@@ -8,7 +8,7 @@ ...@@ -8,7 +8,7 @@
#include <dmlc/thread_local.h> #include <dmlc/thread_local.h>
#include <vta/runtime.h> #include <vta/runtime.h>
#include "../nnvm/tvm/src/runtime/workspace_pool.h" #include "../tvm/src/runtime/workspace_pool.h"
namespace tvm { namespace tvm {
...@@ -42,6 +42,7 @@ class VTADeviceAPI final : public DeviceAPI { ...@@ -42,6 +42,7 @@ class VTADeviceAPI final : public DeviceAPI {
size_t size, size_t size,
TVMContext ctx_from, TVMContext ctx_from,
TVMContext ctx_to, TVMContext ctx_to,
TVMType type_hint,
TVMStreamHandle stream) final { TVMStreamHandle stream) final {
int kind_mask = 0; int kind_mask = 0;
if (ctx_from.device_type != kDLCPU) { if (ctx_from.device_type != kDLCPU) {
......
...@@ -6,21 +6,31 @@ RUN apt-get update --fix-missing ...@@ -6,21 +6,31 @@ RUN apt-get update --fix-missing
COPY install/ubuntu_install_core.sh /install/ubuntu_install_core.sh COPY install/ubuntu_install_core.sh /install/ubuntu_install_core.sh
RUN bash /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 COPY install/ubuntu_install_python.sh /install/ubuntu_install_python.sh
RUN bash /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 COPY install/ubuntu_install_python_package.sh /install/ubuntu_install_python_package.sh
RUN bash /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 COPY install/ubuntu_install_sphinx.sh /install/ubuntu_install_sphinx.sh
RUN bash /install/ubuntu_install_sphinx.sh RUN bash /install/ubuntu_install_sphinx.sh
# 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 # Enable doxygen for c++ doc build
RUN apt-get update && apt-get install -y doxygen graphviz 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; python3 setup.py install
# For lint test # For lint test
FROM ubuntu:16.04 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 apt-get install -y doxygen graphviz
RUN pip install cpplint pylint RUN pip3 install cpplint pylint
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
apt-get update && apt-get install -y openjdk-8-jdk maven
...@@ -19,4 +19,4 @@ echo deb-src http://apt.llvm.org/xenial/ llvm-toolchain-xenial main\ ...@@ -19,4 +19,4 @@ echo deb-src http://apt.llvm.org/xenial/ llvm-toolchain-xenial main\
>> /etc/apt/sources.list.d/llvm.list >> /etc/apt/sources.list.d/llvm.list
wget -O - http://apt.llvm.org/llvm-snapshot.gpg.key|sudo apt-key add - 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
apt-get update --fix-missing
apt-get install -y --no-install-recommends --force-yes \
libgl1-mesa-dev libglfw3-dev
\ No newline at end of file
# install python and pip, don't modify this, modify install_python_package.sh # 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 # python 3.6
cd /tmp && wget https://bootstrap.pypa.io/get-pip.py && python3 get-pip.py && python2 get-pip.py 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
# install libraries for python package on ubuntu # install libraries for python package on ubuntu
pip2 install nose pylint numpy nose-timer cython decorator scipy tornado 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
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
#!/bin/bash #!/bin/bash
echo "Build TVM..." echo "Build TVM..."
cd nnvm/tvm cd tvm
cp make/config.mk . cp cmake/config.cmake .
echo USE_CUDA=0 >> config.mk echo set\(USE_LLVM llvm-config-5.0\) >> config.cmake
echo LLVM_CONFIG=llvm-config-4.0 >> config.mk echo set\(USE_RPC ON\) >> config.cmake
echo USE_RPC=1 >> config.mk echo set\(USE_BLAS openblas\) >> config.cmake
echo USE_BLAS=openblas >> config.mk echo set\(USE_GRAPH_RUNTIME ON\) >> config.cmake
echo USE_GRAPH_RUNTIME=1 >> config.mk
make "$@" make "$@"
make cython make cython
make cython3 make cython3
cd .. cd ..
echo "Build NNVM..."
make "$@"
cd ..
echo "Build VTA..." echo "Build VTA..."
make "$@" make "$@"
#!/bin/bash #!/bin/bash
echo "Cleanup data..." echo "Cleanup data..."
cd nnvm
make clean
cd tvm cd tvm
make clean make clean
cd ../.. cd ..
make clean make clean
#!/bin/bash #!/bin/bash
cd nnvm/tvm cd tvm
make cython make cython
make cython3 make cython3
cd ../../ cd ../
mkdir -p docs/_build/html mkdir -p docs/_build/html
# C++ doc # C++ doc
...@@ -11,7 +11,7 @@ make doc ...@@ -11,7 +11,7 @@ make doc
rm -rf python/vta/*.pyc python/vta/*/*.pyc rm -rf python/vta/*.pyc python/vta/*/*.pyc
cd docs 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 cd _build/html
tar czf docs.tgz * tar czf docs.tgz *
mv docs.tgz ../../../ mv docs.tgz ../../../
#!/bin/bash #!/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..." echo "Running unittest..."
python -m nose -v tests/python/unittest || exit -1 python -m nose -v tests/python/unittest || exit -1
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment