Commit bb2b8620 by tqchen Committed by Tianqi Chen

[DOCS] documentation merge

parent 891b4e06
...@@ -7,7 +7,8 @@ ...@@ -7,7 +7,8 @@
tvm_runtime = "lib/libtvm_runtime.so, config.mk" tvm_runtime = "lib/libtvm_runtime.so, config.mk"
tvm_lib = "lib/libtvm.so, " + tvm_runtime tvm_lib = "lib/libtvm.so, " + tvm_runtime
// LLVM upstream lib // LLVM upstream lib
tvm_multilib = "lib/libtvm_llvm40.so, lib/libtvm_llvm50.so, lib/libtvm_llvm60.so, lib/libtvm_topi.so, " + tvm_runtime tvm_multilib = "lib/libtvm_llvm40.so, lib/libtvm_llvm50.so, lib/libtvm_llvm60.so, " +
"lib/libtvm_topi.so, nnvm/lib/libnnvm_compiler.so, " + tvm_runtime
// command to start a docker container // command to start a docker container
docker_run = 'tests/ci_build/ci_build.sh' docker_run = 'tests/ci_build/ci_build.sh'
...@@ -50,11 +51,11 @@ stage("Sanity Check") { ...@@ -50,11 +51,11 @@ stage("Sanity Check") {
def make(docker_type, make_flag) { def make(docker_type, make_flag) {
timeout(time: max_time, unit: 'MINUTES') { timeout(time: max_time, unit: 'MINUTES') {
try { try {
sh "${docker_run} ${docker_type} make ${make_flag}" sh "${docker_run} ${docker_type} ./tests/scripts/task_build.sh ${make_flag}"
} catch (exc) { } catch (exc) {
echo 'Incremental compilation failed. Fall back to build from scratch' echo 'Incremental compilation failed. Fall back to build from scratch'
sh "${docker_run} ${docker_type} make clean" sh "${docker_run} ${docker_type} ./tests/scripts/task_clean.sh"
sh "${docker_run} ${docker_type} make ${make_flag}" sh "${docker_run} ${docker_type} ./tests/scripts/task_build.sh ${make_flag}"
} }
} }
} }
...@@ -231,6 +232,7 @@ stage('Integration Test') { ...@@ -231,6 +232,7 @@ stage('Integration Test') {
sh "${docker_run} gpu ./tests/scripts/task_python_integration.sh" sh "${docker_run} gpu ./tests/scripts/task_python_integration.sh"
sh "${docker_run} gpu ./tests/scripts/task_python_topi.sh" sh "${docker_run} gpu ./tests/scripts/task_python_topi.sh"
sh "${docker_run} gpu ./tests/scripts/task_cpp_topi.sh" sh "${docker_run} gpu ./tests/scripts/task_cpp_topi.sh"
sh "${docker_run} gpu ./tests/scripts/task_python_nnvm.sh"
} }
} }
} }
......
...@@ -10,7 +10,8 @@ endif ...@@ -10,7 +10,8 @@ endif
include $(config) include $(config)
.PHONY: clean install installdev all test doc pylint cpplint lint verilog cython cython2 cython3 web runtime .PHONY: clean install installdev all test doc pylint cpplint lint\
verilog cython cython2 cython3 web topi nnvm runtime
ifndef DMLC_CORE_PATH ifndef DMLC_CORE_PATH
DMLC_CORE_PATH = $(ROOTDIR)/dmlc-core DMLC_CORE_PATH = $(ROOTDIR)/dmlc-core
...@@ -36,6 +37,7 @@ EMCC_FLAGS= -std=c++11 -DDMLC_LOG_STACK_TRACE=0\ ...@@ -36,6 +37,7 @@ EMCC_FLAGS= -std=c++11 -DDMLC_LOG_STACK_TRACE=0\
-s EXTRA_EXPORTED_RUNTIME_METHODS="['cwrap','getValue','setValue','addFunction']"\ -s EXTRA_EXPORTED_RUNTIME_METHODS="['cwrap','getValue','setValue','addFunction']"\
-s USE_GLFW=3 -s USE_WEBGL2=1 -lglfw\ -s USE_GLFW=3 -s USE_WEBGL2=1 -lglfw\
$(INCLUDE_FLAGS) $(INCLUDE_FLAGS)
# llvm configuration # llvm configuration
ifdef LLVM_CONFIG ifdef LLVM_CONFIG
LLVM_VERSION=$(shell $(LLVM_CONFIG) --version| cut -b 1,3) LLVM_VERSION=$(shell $(LLVM_CONFIG) --version| cut -b 1,3)
...@@ -62,6 +64,8 @@ SGX_SRC = $(wildcard src/runtime/sgx/untrusted/*.cc) ...@@ -62,6 +64,8 @@ SGX_SRC = $(wildcard src/runtime/sgx/untrusted/*.cc)
RPC_SRC = $(wildcard src/runtime/rpc/*.cc) RPC_SRC = $(wildcard src/runtime/rpc/*.cc)
GRAPH_SRC = $(wildcard src/runtime/graph/*.cc) GRAPH_SRC = $(wildcard src/runtime/graph/*.cc)
RUNTIME_SRC = $(wildcard src/runtime/*.cc) RUNTIME_SRC = $(wildcard src/runtime/*.cc)
# TOPI
TOPI_SRC = $(wildcard topi/src/*.cc) TOPI_SRC = $(wildcard topi/src/*.cc)
# Objectives # Objectives
...@@ -78,7 +82,7 @@ RPC_OBJ = $(patsubst src/%.cc, build/%.o, $(RPC_SRC)) ...@@ -78,7 +82,7 @@ RPC_OBJ = $(patsubst src/%.cc, build/%.o, $(RPC_SRC))
GRAPH_OBJ = $(patsubst src/%.cc, build/%.o, $(GRAPH_SRC)) GRAPH_OBJ = $(patsubst src/%.cc, build/%.o, $(GRAPH_SRC))
CC_OBJ = $(patsubst src/%.cc, build/%.o, $(CC_SRC)) $(LLVM_OBJ) CC_OBJ = $(patsubst src/%.cc, build/%.o, $(CC_SRC)) $(LLVM_OBJ)
RUNTIME_OBJ = $(patsubst src/%.cc, build/%.o, $(RUNTIME_SRC)) RUNTIME_OBJ = $(patsubst src/%.cc, build/%.o, $(RUNTIME_SRC))
TOPI_OBJ = $(patsubst topi/%.cc, build/%.o, $(TOPI_SRC)) TOPI_OBJ = $(patsubst topi/src/%.cc, build/topi/%.o, $(TOPI_SRC))
CONTRIB_OBJ = CONTRIB_OBJ =
# Deps # Deps
...@@ -253,6 +257,7 @@ runtime: lib/libtvm_runtime.$(SHARED_LIBRARY_SUFFIX) ...@@ -253,6 +257,7 @@ runtime: lib/libtvm_runtime.$(SHARED_LIBRARY_SUFFIX)
web: lib/libtvm_web_runtime.js lib/libtvm_web_runtime.bc web: lib/libtvm_web_runtime.js lib/libtvm_web_runtime.bc
topi: lib/libtvm_topi.$(SHARED_LIBRARY_SUFFIX) topi: lib/libtvm_topi.$(SHARED_LIBRARY_SUFFIX)
include tests/cpp/unittest.mk include tests/cpp/unittest.mk
test: $(TEST) test: $(TEST)
...@@ -291,9 +296,9 @@ build/%.o: src/%.cc ...@@ -291,9 +296,9 @@ build/%.o: src/%.cc
$(CXX) $(CFLAGS) -MM -MT build/$*.o $< >build/$*.d $(CXX) $(CFLAGS) -MM -MT build/$*.o $< >build/$*.d
$(CXX) -c $(CFLAGS) -c $< -o $@ $(CXX) -c $(CFLAGS) -c $< -o $@
build/src/%.o: topi/src/%.cc build/topi/%.o: topi/src/%.cc
@mkdir -p $(@D) @mkdir -p $(@D)
$(CXX) $(CFLAGS) -MM -MT build/src/$*.o $< >build/src/$*.d $(CXX) $(CFLAGS) -MM -MT build/$*.o $< >build/$*.d
$(CXX) -c $(CFLAGS) -c $< -o $@ $(CXX) -c $(CFLAGS) -c $< -o $@
lib/libtvm.${SHARED_LIBRARY_SUFFIX}: $(ALL_DEP) $(RUNTIME_DEP) lib/libtvm.${SHARED_LIBRARY_SUFFIX}: $(ALL_DEP) $(RUNTIME_DEP)
...@@ -326,12 +331,14 @@ LIBHALIDEIR: ...@@ -326,12 +331,14 @@ LIBHALIDEIR:
cpplint: cpplint:
python dmlc-core/scripts/lint.py topi cpp topi/include; python dmlc-core/scripts/lint.py topi cpp topi/include;
python dmlc-core/scripts/lint.py nnvm cpp nnvm/include nnvm/src;
python dmlc-core/scripts/lint.py tvm cpp include src verilog\ python dmlc-core/scripts/lint.py tvm cpp include src verilog\
examples/extension/src examples/graph_executor/src examples/extension/src examples/graph_executor/src
pylint: pylint:
pylint python/tvm --rcfile=$(ROOTDIR)/tests/lint/pylintrc pylint python/tvm --rcfile=$(ROOTDIR)/tests/lint/pylintrc
pylint topi/python/topi --rcfile=$(ROOTDIR)/tests/lint/pylintrc pylint topi/python/topi --rcfile=$(ROOTDIR)/tests/lint/pylintrc
pylint nnvm/python/nnvm --rcfile=$(ROOTDIR)/tests/lint/pylintrc
jnilint: jnilint:
python dmlc-core/scripts/lint.py tvm4j-jni cpp jvm/native/src python dmlc-core/scripts/lint.py tvm4j-jni cpp jvm/native/src
......
...@@ -753,7 +753,7 @@ WARN_LOGFILE = ...@@ -753,7 +753,7 @@ WARN_LOGFILE =
# spaces. # spaces.
# Note: If this tag is empty the current directory is searched. # Note: If this tag is empty the current directory is searched.
INPUT = include/tvm topi/include/topi INPUT = include/tvm topi/include/topi nnvm/include/nnvm
# This tag can be used to specify the character encoding of the source files # This tag can be used to specify the character encoding of the source files
# that doxygen parses. Internally doxygen uses the UTF-8 encoding. Doxygen uses # that doxygen parses. Internally doxygen uses the UTF-8 encoding. Doxygen uses
......
...@@ -25,6 +25,7 @@ from recommonmark.transform import AutoStructify ...@@ -25,6 +25,7 @@ from recommonmark.transform import AutoStructify
curr_path = os.path.dirname(os.path.abspath(os.path.expanduser(__file__))) curr_path = os.path.dirname(os.path.abspath(os.path.expanduser(__file__)))
sys.path.insert(0, os.path.join(curr_path, '../python/')) sys.path.insert(0, os.path.join(curr_path, '../python/'))
sys.path.insert(0, os.path.join(curr_path, '../topi/python')) sys.path.insert(0, os.path.join(curr_path, '../topi/python'))
sys.path.insert(0, os.path.join(curr_path, '../nnvm/python'))
# -- General configuration ------------------------------------------------ # -- General configuration ------------------------------------------------
...@@ -40,6 +41,7 @@ source_parsers = { ...@@ -40,6 +41,7 @@ source_parsers = {
'.md': CommonMarkParser '.md': CommonMarkParser
} }
os.environ['TVM_BUILD_DOC'] = '1' os.environ['TVM_BUILD_DOC'] = '1'
os.environ['NNVM_BUILD_DOC'] = '1'
# Version information. # Version information.
import tvm import tvm
version = tvm.__version__ version = tvm.__version__
...@@ -187,7 +189,8 @@ gallery_dirs = ['tutorials'] ...@@ -187,7 +189,8 @@ gallery_dirs = ['tutorials']
subsection_order = ExplicitOrder( subsection_order = ExplicitOrder(
['../tutorials/language', ['../tutorials/language',
'../tutorials/optimize', '../tutorials/optimize',
'../tutorials/deployment']) '../tutorials/deployment',
'../tutorials/nnvm'])
def generate_doxygen_xml(app): def generate_doxygen_xml(app):
......
/*! /*!
* Copyright (c) 2017 by Contributors * Copyright (c) 2017 by Contributors
* \file api_registry.h * \file tvm/api_registry.h
* \brief This files include necessary headers to * \brief This files include necessary headers to
* be used to register an global API function. * be used to register an global API function.
*/ */
......
/*! /*!
* Copyright (c) 2016 by Contributors * Copyright (c) 2016 by Contributors
* \file arithmetic.h * \file tvm/arithmetic.h
* \brief Algebra and set operations and simplifications. * \brief Algebra and set operations and simplifications.
*/ */
#ifndef TVM_ARITHMETIC_H_ #ifndef TVM_ARITHMETIC_H_
......
/*! /*!
* Copyright (c) 2016 by Contributors * Copyright (c) 2016 by Contributors
* \file base.h * \file tvm/base.h
* \brief Defines the base data structure * \brief Defines the base data structure
*/ */
#ifndef TVM_BASE_H_ #ifndef TVM_BASE_H_
......
/*! /*!
* Copyright (c) 2016 by Contributors * Copyright (c) 2016 by Contributors
* \file buffer.h * \file tvm/buffer.h
* \brief Symbolic n-dimensional array, to represent a memory buffer. * \brief Symbolic n-dimensional array, to represent a memory buffer.
*/ */
#ifndef TVM_BUFFER_H_ #ifndef TVM_BUFFER_H_
......
/*! /*!
* Copyright (c) 2017 by Contributors * Copyright (c) 2017 by Contributors
* \file build_module.h * \file tvm/build_module.h
* \brief Functions for compiling ops. * \brief Functions for compiling ops.
*/ */
#ifndef TVM_BUILD_MODULE_H_ #ifndef TVM_BUILD_MODULE_H_
......
/*! /*!
* Copyright (c) 2016 by Contributors * Copyright (c) 2016 by Contributors
* \file c_dsl_api.h * \file tvm/c_dsl_api.h
* *
* \brief TVM DSL Node C API, used to interact to DSL compilation. * \brief TVM DSL Node C API, used to interact to DSL compilation.
* *
......
/*! /*!
* Copyright (c) 2017 by Contributors * Copyright (c) 2017 by Contributors
* \file channel.h * \file tvm/channel.h
* \brief Channel object for pipeline. * \brief Channel object for pipeline.
*/ */
#ifndef TVM_CHANNEL_H_ #ifndef TVM_CHANNEL_H_
......
/*! /*!
* Copyright (c) 2016 by Contributors * Copyright (c) 2016 by Contributors
* \file codegen.h * \file tvm/codegen.h
* \brief Collection of Lowlevel IR pass to codegen. * \brief Collection of Lowlevel IR pass to codegen.
*/ */
#ifndef TVM_CODEGEN_H_ #ifndef TVM_CODEGEN_H_
......
/*! /*!
* Copyright (c) 2016 by Contributors * Copyright (c) 2016 by Contributors
* \file expr.h * \file tvm/expr.h
* \brief The Expr and related elements in DataFlow construction. * \brief The Expr and related elements in DataFlow construction.
*/ */
#ifndef TVM_EXPR_H_ #ifndef TVM_EXPR_H_
......
/*! /*!
* Copyright (c) 2016 by Contributors * Copyright (c) 2016 by Contributors
* \file ir.h * \file tvm/ir.h
* \brief Additional high level nodes in the IR * \brief Additional high level nodes in the IR
*/ */
#ifndef TVM_IR_H_ #ifndef TVM_IR_H_
......
/*! /*!
* Copyright (c) 2017 by Contributors * Copyright (c) 2017 by Contributors
* \file ir_functor_ext.h * \file tvm/ir_functor_ext.h
* \brief More powerful Visitor that allows define function signatures. * \brief More powerful Visitor that allows define function signatures.
*/ */
#ifndef TVM_IR_FUNCTOR_EXT_H_ #ifndef TVM_IR_FUNCTOR_EXT_H_
......
/*! /*!
* Copyright (c) 2016 by Contributors * Copyright (c) 2016 by Contributors
* \file ir_mutator.h * \file tvm/ir_mutator.h
* \brief Defines general IRMutation pass * \brief Defines general IRMutation pass
*/ */
#ifndef TVM_IR_MUTATOR_H_ #ifndef TVM_IR_MUTATOR_H_
......
/*! /*!
* Copyright (c) 2017 by Contributors * Copyright (c) 2017 by Contributors
* \file ir_operator.h * \file tvm/ir_operator.h
* \brief Common operators of Expr * \brief Common operators of Expr
*/ */
#ifndef TVM_IR_OPERATOR_H_ #ifndef TVM_IR_OPERATOR_H_
......
/*! /*!
* Copyright (c) 2016 by Contributors * Copyright (c) 2016 by Contributors
* \file ir_pass.h * \file tvm/ir_pass.h
* \brief Collection of IR pass functions * \brief Collection of IR pass functions
* *
* When the pass functions in this file are for Stmt, * When the pass functions in this file are for Stmt,
......
/*! /*!
* Copyright (c) 2016 by Contributors * Copyright (c) 2016 by Contributors
* \file ir_visitor.h * \file tvm/ir_visitor.h
* \brief Visitor to quickly visit IR trees * \brief Visitor to quickly visit IR trees
*/ */
#ifndef TVM_IR_VISITOR_H_ #ifndef TVM_IR_VISITOR_H_
......
/*! /*!
* Copyright (c) 2018 by Contributors * Copyright (c) 2018 by Contributors
* \file logging.h * \file tvm/logging.h
* \brief logging utilities on top of dmlc-core * \brief logging utilities on top of dmlc-core
*/ */
#ifndef TVM_LOGGING_H_ #ifndef TVM_LOGGING_H_
......
/*! /*!
* Copyright (c) 2017 by Contributors * Copyright (c) 2017 by Contributors
* \file lowered_func.h * \file tvm/lowered_func.h
* \brief Information about a lowered TVM function. * \brief Information about a lowered TVM function.
* This data structure is final step toward codegen. * This data structure is final step toward codegen.
*/ */
......
/*! /*!
* Copyright (c) 2016 by Contributors * Copyright (c) 2016 by Contributors
* \file operation.h * \file tvm/operation.h
* \brief Operation node can generate one or multiple Tensors * \brief Operation node can generate one or multiple Tensors
*/ */
#ifndef TVM_OPERATION_H_ #ifndef TVM_OPERATION_H_
......
/*! /*!
* Copyright (c) 2016 by Contributors * Copyright (c) 2016 by Contributors
* \file packed_func_ext.h * \file tvm/packed_func_ext.h
* \brief Extension package to PackedFunc * \brief Extension package to PackedFunc
* This enales pass NodeRef types into/from PackedFunc. * This enales pass NodeRef types into/from PackedFunc.
*/ */
......
/*! /*!
* Copyright (c) 2017 by Contributors * Copyright (c) 2017 by Contributors
* \file c_backend_api.h * \file tvm/runtime/c_backend_api.h
* \brief TVM runtime backend API. * \brief TVM runtime backend API.
* *
* The functions defined in this header are intended to be * The functions defined in this header are intended to be
......
/*! /*!
* Copyright (c) 2016 by Contributors * Copyright (c) 2016 by Contributors
* \file c_runtime_api.h * \file tvm/runtime/c_runtime_api.h
* \brief TVM runtime library. * \brief TVM runtime library.
* *
* The philosophy of TVM project is to customize the compilation * The philosophy of TVM project is to customize the compilation
......
/*! /*!
* Copyright (c) 2017 by Contributors * Copyright (c) 2017 by Contributors
* \file config.h * \file tvm/runtime/config.h
* \brief Runtime library related configurations. * \brief Runtime library related configurations.
*/ */
#ifndef TVM_RUNTIME_CONFIG_H_ #ifndef TVM_RUNTIME_CONFIG_H_
......
/*! /*!
* Copyright (c) 2016 by Contributors * Copyright (c) 2016 by Contributors
* \file device_api.h * \file tvm/runtime/device_api.h
* \brief Abstract device memory management API * \brief Abstract device memory management API
*/ */
#ifndef TVM_RUNTIME_DEVICE_API_H_ #ifndef TVM_RUNTIME_DEVICE_API_H_
......
/*! /*!
* Copyright (c) 2017 by Contributors * Copyright (c) 2017 by Contributors
* \file module.h * \file tvm/runtime/module.h
* \brief Runtime container of the functions generated by TVM, * \brief Runtime container of the functions generated by TVM,
* This is used to support dynamically link, load and save * This is used to support dynamically link, load and save
* functions from different convention under unified API. * functions from different convention under unified API.
......
/*! /*!
* Copyright (c) 2017 by Contributors * Copyright (c) 2017 by Contributors
* \file packed_func.h * \file tvm/runtime/packed_func.h
* \brief Type-erased function used across TVM API. * \brief Type-erased function used across TVM API.
*/ */
#ifndef TVM_RUNTIME_PACKED_FUNC_H_ #ifndef TVM_RUNTIME_PACKED_FUNC_H_
......
/*! /*!
* Copyright (c) 2017 by Contributors * Copyright (c) 2017 by Contributors
* \file registry.h * \file tvm/runtime/registry.h
* \brief This file defines the TVM global function registry. * \brief This file defines the TVM global function registry.
* *
* The registered functions will be made available to front-end * The registered functions will be made available to front-end
......
/*! /*!
* Copyright (c) 2018 by Contributors * Copyright (c) 2018 by Contributors
* \file threading_backend.h * \file tvm/runtime/threading_backend.h
* \brief Utilities for manipulating thread pool threads. * \brief Utilities for manipulating thread pool threads.
*/ */
#ifndef TVM_RUNTIME_THREADING_BACKEND_H_ #ifndef TVM_RUNTIME_THREADING_BACKEND_H_
......
/*! /*!
* Copyright (c) 2017 by Contributors * Copyright (c) 2017 by Contributors
* \file util.h * \file tvm/runtime/util.h
* \brief Useful runtime util. * \brief Useful runtime util.
*/ */
#ifndef TVM_RUNTIME_UTIL_H_ #ifndef TVM_RUNTIME_UTIL_H_
......
/*! /*!
* Copyright (c) 2016 by Contributors * Copyright (c) 2016 by Contributors
* \file schedule.h * \file tvm/schedule.h
* \brief Define a schedule. * \brief Define a schedule.
*/ */
#ifndef TVM_SCHEDULE_H_ #ifndef TVM_SCHEDULE_H_
......
/*! /*!
* Copyright (c) 2016 by Contributors * Copyright (c) 2016 by Contributors
* \file schedule_pass.h * \file tvm/schedule_pass.h
* \brief Collection of Schedule pass functions. * \brief Collection of Schedule pass functions.
* *
* These passes works on the schedule hyper-graph * These passes works on the schedule hyper-graph
......
/*! /*!
* Copyright (c) 2017 by Contributors * Copyright (c) 2017 by Contributors
* \file target_info.h * \file tvm/target_info.h
* \brief Various information about target. * \brief Various information about target.
*/ */
#ifndef TVM_TARGET_INFO_H_ #ifndef TVM_TARGET_INFO_H_
......
/*! /*!
* Copyright (c) 2016 by Contributors * Copyright (c) 2016 by Contributors
* \file tensor.h * \file tvm/tensor.h
* \brief Dataflow tensor object * \brief Dataflow tensor object
*/ */
#ifndef TVM_TENSOR_H_ #ifndef TVM_TENSOR_H_
......
/*! /*!
* Copyright (c) 2017 by Contributors * Copyright (c) 2017 by Contributors
* \file tensor_intrin.h * \file tvm/tensor_intrin.h
* \brief Tensor intrinsic operations. * \brief Tensor intrinsic operations.
*/ */
#ifndef TVM_TENSOR_INTRIN_H_ #ifndef TVM_TENSOR_INTRIN_H_
......
/*! /*!
* Copyright (c) 2016 by Contributors * Copyright (c) 2016 by Contributors
* \file tvm.h * \file tvm/tvm.h
* \brief Header to include all C++ API. * \brief Header to include all C++ API.
*/ */
#ifndef TVM_TVM_H_ #ifndef TVM_TVM_H_
......
...@@ -19,10 +19,10 @@ endif() ...@@ -19,10 +19,10 @@ endif()
# include path # include path
include_directories(BEFORE "include") include_directories(BEFORE "include")
include_directories("tvm/include") include_directories("../include")
include_directories("tvm/dlpack/include") include_directories("../dlpack/include")
include_directories("tvm/HalideIR/src") include_directories("../HalideIR/src")
include_directories("tvm/topi/include") include_directories("../topi/include")
set(NNVM_LINKER_LIBS "") set(NNVM_LINKER_LIBS "")
set(NNVM_COMPILER_LINKER_LIBS "") set(NNVM_COMPILER_LINKER_LIBS "")
...@@ -48,8 +48,7 @@ if(MSVC) ...@@ -48,8 +48,7 @@ if(MSVC)
endif() endif()
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} /EHsc") set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} /EHsc")
find_library(TVM_LIB tvm find_library(TVM_LIB tvm
HINTS ${CMAKE_CURRENT_SOURCE_DIR}/../tvm/build/Release HINTS ${CMAKE_CURRENT_SOURCE_DIR}/../build/Release)
HINTS ${CMAKE_CURRENT_SOURCE_DIR}/tvm/build/Release)
message(STATUS "Build with TVM libary: " ${TVM_LIB}) message(STATUS "Build with TVM libary: " ${TVM_LIB})
list(APPEND NNVM_COMPILER_LINKER_LIBS ${TVM_LIB}) list(APPEND NNVM_COMPILER_LINKER_LIBS ${TVM_LIB})
else(MSVC) else(MSVC)
...@@ -86,8 +85,8 @@ file(GLOB_RECURSE COMPILER_SRCS ...@@ -86,8 +85,8 @@ file(GLOB_RECURSE COMPILER_SRCS
src/top/*.cc src/top/*.cc
) )
if(EXISTS ${CMAKE_CURRENT_SOURCE_DIR}/dmlc-core/CMakeLists.txt) if(EXISTS ${CMAKE_CURRENT_SOURCE_DIR}/../dmlc-core/CMakeLists.txt)
include_directories(${CMAKE_CURRENT_SOURCE_DIR}/dmlc-core/include) include_directories(${CMAKE_CURRENT_SOURCE_DIR}/../dmlc-core/include)
elseif(DMLC_CORE_PATH) elseif(DMLC_CORE_PATH)
include_directories(${DMLC_CORE_PATH}/include) include_directories(${DMLC_CORE_PATH}/include)
endif() endif()
......
#!groovy
// -*- mode: groovy -*-
// Jenkins pipeline
// See documents at https://jenkins.io/doc/book/pipeline/jenkinsfile/
// nnvm libraries
nnvm_lib = "tvm/lib/libtvm.so, tvm/lib/libtvm_runtime.so, lib/libnnvm_compiler.so"
// command to start a docker container
docker_run = 'tests/ci_build/ci_build.sh'
// timeout in minutes
max_time = 60
// initialize source codes
def init_git() {
checkout scm
retry(5) {
timeout(time: 2, unit: 'MINUTES') {
sh 'git submodule update --init --recursive'
}
}
}
def init_git_win() {
checkout scm
retry(5) {
timeout(time: 2, unit: 'MINUTES') {
bat 'git submodule update --init --recursive'
}
}
}
stage("Sanity Check") {
timeout(time: max_time, unit: 'MINUTES') {
node('linux') {
ws('workspace/tvm/sanity') {
init_git()
sh "${docker_run} lint ./tests/scripts/task_lint.sh"
}
}
}
}
// Run make. First try to do an incremental make from a previous workspace in hope to
// accelerate the compilation. If something wrong, clean the workspace and then
// build from scratch.
def make(docker_type, make_flag) {
timeout(time: max_time, unit: 'MINUTES') {
try {
sh "${docker_run} ${docker_type} ./tests/scripts/task_build.sh ${make_flag}"
} catch (exc) {
echo 'Incremental compilation failed. Fall back to build from scratch'
sh "${docker_run} ${docker_type} ./tests/scripts/task_clean.sh"
sh "${docker_run} ${docker_type} ./tests/scripts/task_build.sh ${make_flag}"
}
}
}
// pack libraries for later use
def pack_lib(name, libs) {
sh """
echo "Packing ${libs} into ${name}"
echo ${libs} | sed -e 's/,/ /g' | xargs md5sum
"""
stash includes: libs, name: name
}
// unpack libraries saved before
def unpack_lib(name, libs) {
unstash name
sh """
echo "Unpacked ${libs} from ${name}"
echo ${libs} | sed -e 's/,/ /g' | xargs md5sum
"""
}
stage('Build') {
timeout(time: max_time, unit: 'MINUTES') {
node('GPU' && 'linux') {
ws('workspace/nnvm/build-gpu') {
init_git()
make('gpu', '-j2')
pack_lib('gpu', nnvm_lib)
}
}
}
}
stage('Tests') {
parallel 'python': {
node('GPU' && 'linux') {
ws('workspace/nnvm/it-python-gpu') {
init_git()
unpack_lib('gpu', nnvm_lib)
timeout(time: max_time, unit: 'MINUTES') {
sh "${docker_run} gpu ./tests/scripts/task_python_test.sh"
sh "${docker_run} gpu ./tests/scripts/task_frontend_test.sh"
}
}
}
},
'docs': {
node('GPU' && 'linux') {
ws('workspace/nnvm/docs-python-gpu') {
init_git()
unpack_lib('gpu', nnvm_lib)
timeout(time: max_time, unit: 'MINUTES') {
sh "${docker_run} gpu ./tests/scripts/task_python_docs.sh"
}
pack_lib('mydocs', 'docs.tgz')
}
}
}
}
stage('Deploy') {
node('docker' && 'doc') {
ws('workspace/nnvm/deploy-docs') {
if (env.BRANCH_NAME == "master") {
unpack_lib('mydocs', 'docs.tgz')
sh "tar xf docs.tgz -C /var/nnvm-docs"
}
}
}
}
Apache License
Version 2.0, January 2004
http://www.apache.org/licenses/
TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
1. Definitions.
"License" shall mean the terms and conditions for use, reproduction,
and distribution as defined by Sections 1 through 9 of this document.
"Licensor" shall mean the copyright owner or entity authorized by
the copyright owner that is granting the License.
"Legal Entity" shall mean the union of the acting entity and all
other entities that control, are controlled by, or are under common
control with that entity. For the purposes of this definition,
"control" means (i) the power, direct or indirect, to cause the
direction or management of such entity, whether by contract or
otherwise, or (ii) ownership of fifty percent (50%) or more of the
outstanding shares, or (iii) beneficial ownership of such entity.
"You" (or "Your") shall mean an individual or Legal Entity
exercising permissions granted by this License.
"Source" form shall mean the preferred form for making modifications,
including but not limited to software source code, documentation
source, and configuration files.
"Object" form shall mean any form resulting from mechanical
transformation or translation of a Source form, including but
not limited to compiled object code, generated documentation,
and conversions to other media types.
"Work" shall mean the work of authorship, whether in Source or
Object form, made available under the License, as indicated by a
copyright notice that is included in or attached to the work
(an example is provided in the Appendix below).
"Derivative Works" shall mean any work, whether in Source or Object
form, that is based on (or derived from) the Work and for which the
editorial revisions, annotations, elaborations, or other modifications
represent, as a whole, an original work of authorship. For the purposes
of this License, Derivative Works shall not include works that remain
separable from, or merely link (or bind by name) to the interfaces of,
the Work and Derivative Works thereof.
"Contribution" shall mean any work of authorship, including
the original version of the Work and any modifications or additions
to that Work or Derivative Works thereof, that is intentionally
submitted to Licensor for inclusion in the Work by the copyright owner
or by an individual or Legal Entity authorized to submit on behalf of
the copyright owner. For the purposes of this definition, "submitted"
means any form of electronic, verbal, or written communication sent
to the Licensor or its representatives, including but not limited to
communication on electronic mailing lists, source code control systems,
and issue tracking systems that are managed by, or on behalf of, the
Licensor for the purpose of discussing and improving the Work, but
excluding communication that is conspicuously marked or otherwise
designated in writing by the copyright owner as "Not a Contribution."
"Contributor" shall mean Licensor and any individual or Legal Entity
on behalf of whom a Contribution has been received by Licensor and
subsequently incorporated within the Work.
2. Grant of Copyright License. Subject to the terms and conditions of
this License, each Contributor hereby grants to You a perpetual,
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
copyright license to reproduce, prepare Derivative Works of,
publicly display, publicly perform, sublicense, and distribute the
Work and such Derivative Works in Source or Object form.
3. Grant of Patent License. Subject to the terms and conditions of
this License, each Contributor hereby grants to You a perpetual,
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
(except as stated in this section) patent license to make, have made,
use, offer to sell, sell, import, and otherwise transfer the Work,
where such license applies only to those patent claims licensable
by such Contributor that are necessarily infringed by their
Contribution(s) alone or by combination of their Contribution(s)
with the Work to which such Contribution(s) was submitted. If You
institute patent litigation against any entity (including a
cross-claim or counterclaim in a lawsuit) alleging that the Work
or a Contribution incorporated within the Work constitutes direct
or contributory patent infringement, then any patent licenses
granted to You under this License for that Work shall terminate
as of the date such litigation is filed.
4. Redistribution. You may reproduce and distribute copies of the
Work or Derivative Works thereof in any medium, with or without
modifications, and in Source or Object form, provided that You
meet the following conditions:
(a) You must give any other recipients of the Work or
Derivative Works a copy of this License; and
(b) You must cause any modified files to carry prominent notices
stating that You changed the files; and
(c) You must retain, in the Source form of any Derivative Works
that You distribute, all copyright, patent, trademark, and
attribution notices from the Source form of the Work,
excluding those notices that do not pertain to any part of
the Derivative Works; and
(d) If the Work includes a "NOTICE" text file as part of its
distribution, then any Derivative Works that You distribute must
include a readable copy of the attribution notices contained
within such NOTICE file, excluding those notices that do not
pertain to any part of the Derivative Works, in at least one
of the following places: within a NOTICE text file distributed
as part of the Derivative Works; within the Source form or
documentation, if provided along with the Derivative Works; or,
within a display generated by the Derivative Works, if and
wherever such third-party notices normally appear. The contents
of the NOTICE file are for informational purposes only and
do not modify the License. You may add Your own attribution
notices within Derivative Works that You distribute, alongside
or as an addendum to the NOTICE text from the Work, provided
that such additional attribution notices cannot be construed
as modifying the License.
You may add Your own copyright statement to Your modifications and
may provide additional or different license terms and conditions
for use, reproduction, or distribution of Your modifications, or
for any such Derivative Works as a whole, provided Your use,
reproduction, and distribution of the Work otherwise complies with
the conditions stated in this License.
5. Submission of Contributions. Unless You explicitly state otherwise,
any Contribution intentionally submitted for inclusion in the Work
by You to the Licensor shall be under the terms and conditions of
this License, without any additional terms or conditions.
Notwithstanding the above, nothing herein shall supersede or modify
the terms of any separate license agreement you may have executed
with Licensor regarding such Contributions.
6. Trademarks. This License does not grant permission to use the trade
names, trademarks, service marks, or product names of the Licensor,
except as required for reasonable and customary use in describing the
origin of the Work and reproducing the content of the NOTICE file.
7. Disclaimer of Warranty. Unless required by applicable law or
agreed to in writing, Licensor provides the Work (and each
Contributor provides its Contributions) on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
implied, including, without limitation, any warranties or conditions
of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
PARTICULAR PURPOSE. You are solely responsible for determining the
appropriateness of using or redistributing the Work and assume any
risks associated with Your exercise of permissions under this License.
8. Limitation of Liability. In no event and under no legal theory,
whether in tort (including negligence), contract, or otherwise,
unless required by applicable law (such as deliberate and grossly
negligent acts) or agreed to in writing, shall any Contributor be
liable to You for damages, including any direct, indirect, special,
incidental, or consequential damages of any character arising as a
result of this License or out of the use or inability to use the
Work (including but not limited to damages for loss of goodwill,
work stoppage, computer failure or malfunction, or any and all
other commercial damages or losses), even if such Contributor
has been advised of the possibility of such damages.
9. Accepting Warranty or Additional Liability. While redistributing
the Work or Derivative Works thereof, You may choose to offer,
and charge a fee for, acceptance of support, warranty, indemnity,
or other liability obligations and/or rights consistent with this
License. However, in accepting such obligations, You may act only
on Your own behalf and on Your sole responsibility, not on behalf
of any other Contributor, and only if You agree to indemnify,
defend, and hold each Contributor harmless for any liability
incurred by, or claims asserted against, such Contributor by reason
of your accepting any such warranty or additional liability.
END OF TERMS AND CONDITIONS
APPENDIX: How to apply the Apache License to your work.
To apply the Apache License to your work, attach the following
boilerplate notice, with the fields enclosed by brackets "{}"
replaced with your own identifying information. (Don't include
the brackets!) The text should be enclosed in the appropriate
comment syntax for the file format. We also recommend that a
file or class name and description of purpose be included on the
same "printed page" as the copyright notice for easier
identification within third-party archives.
Copyright 2016 by contributors.
Licensed 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 KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
...@@ -9,20 +9,16 @@ endif ...@@ -9,20 +9,16 @@ endif
endif endif
include $(config) include $(config)
TVMPATH = ..
export LDFLAGS = -pthread -lm export LDFLAGS = -pthread -lm
export CFLAGS = -std=c++11 -Wall -O2 -Iinclude -fPIC export CFLAGS = -std=c++11 -Wall -O2 -Iinclude -fPIC
CFLAGS += -Itvm/include -Itvm/dlpack/include -Itvm/HalideIR/src -Itvm/topi/include CFLAGS += -I$(TVMPATH)/include -I$(TVMPATH)/dlpack/include -I$(TVMPATH)/HalideIR/src -I$(TVMPATH)/topi/include
ifdef DMLC_CORE_PATH
CFLAGS += -I$(DMLC_CORE_PATH)/include
else
CFLAGS += -I$(ROOTDIR)/dmlc-core/include
endif
ifdef DMLC_CORE_PATH ifdef DMLC_CORE_PATH
CFLAGS += -I$(DMLC_CORE_PATH)/include CFLAGS += -I$(DMLC_CORE_PATH)/include
else else
CFLAGS += -I$(ROOTDIR)/dmlc-core/include CFLAGS += -I$(ROOTDIR)/../dmlc-core/include
endif endif
ifneq ($(ADD_CFLAGS), NONE) ifneq ($(ADD_CFLAGS), NONE)
...@@ -89,15 +85,15 @@ cyclean: ...@@ -89,15 +85,15 @@ cyclean:
lint: pylint cpplint lint: pylint cpplint
doc:
doxygen docs/Doxyfile
cpplint: cpplint:
python dmlc-core/scripts/lint.py nnvm cpp include src python ../dmlc-core/scripts/lint.py nnvm cpp include src
pylint: pylint:
pylint python/nnvm --rcfile=$(ROOTDIR)/tests/lint/pylintrc pylint python/nnvm --rcfile=$(ROOTDIR)/tests/lint/pylintrc
doc:
doxygen docs/Doxyfile
clean: clean:
$(RM) -rf build lib bin *~ */*~ */*/*~ */*/*/*~ */*.o */*/*.o */*/*/*.o cli_test $(RM) -rf build lib bin *~ */*~ */*/*~ */*/*/*~ */*.o */*/*.o */*/*/*.o cli_test
......
NNVM Change Log
===============
This file records the changes in TVM library in reverse chronological order.
## 0.8rc
- This is major change in NNVM to introduce end to end compiler stack.
- The NNVM compiler stack ready
- Core tensor operators
- integrates compiler with TVM
- The libnnvm.a is still independent from compiler modules.
## 0.7
- NNVM graph
- Basic pass of serialization, gradient, infer_shape, place_deice, plan_memory
/*! /*!
* Copyright (c) 2016 by Contributors * Copyright (c) 2016 by Contributors
* \file base.h * \file nnvm/base.h
* \brief Configuration of nnvm as well as basic data structure. * \brief Configuration of nnvm as well as basic data structure.
*/ */
#ifndef NNVM_BASE_H_ #ifndef NNVM_BASE_H_
......
/*! /*!
* Copyright (c) 2016 by Contributors * Copyright (c) 2016 by Contributors
* \file c_api.h * \file nnvm/c_api.h
* \brief C API of NNVM symbolic construction and pass. * \brief C API of NNVM symbolic construction and pass.
* Enables construction and transformation of Graph * Enables construction and transformation of Graph
* in any other host languages. * in any other host languages.
......
/*! /*!
* Copyright (c) 2017 by Contributors * Copyright (c) 2017 by Contributors
* \file packed_func_ext.h * \file nnvm/compiler/packed_func_ext.h
* \brief Extension to enable packed functionn for nnvm types * \brief Extension to enable packed functionn for nnvm types
*/ */
#ifndef NNVM_COMPILER_PACKED_FUNC_EXT_H_ #ifndef NNVM_COMPILER_PACKED_FUNC_EXT_H_
......
/*! /*!
* Copyright (c) 2016 by Contributors * Copyright (c) 2016 by Contributors
* \file util.h * \file nnvm/compiler/util.h
* \brief Utility functions for nnvm compiler * \brief Utility functions for nnvm compiler
*/ */
#ifndef NNVM_COMPILER_UTIL_H_ #ifndef NNVM_COMPILER_UTIL_H_
......
/*! /*!
* Copyright (c) 2016 by Contributors * Copyright (c) 2016 by Contributors
* \file graph.h * \file nnvm/graph.h
* \brief Configuation of nnvm as well as basic data structure. * \brief Configuation of nnvm as well as basic data structure.
*/ */
#ifndef NNVM_GRAPH_H_ #ifndef NNVM_GRAPH_H_
......
/*! /*!
* Copyright (c) 2016 by Contributors * Copyright (c) 2016 by Contributors
* \file graph_attr_types.h * \file nnvm/graph_attr_types.h
* \brief Data structures that can appear in graph attributes. * \brief Data structures that can appear in graph attributes.
*/ */
#ifndef NNVM_GRAPH_ATTR_TYPES_H_ #ifndef NNVM_GRAPH_ATTR_TYPES_H_
......
/*! /*!
* Copyright (c) 2018 by Contributors * Copyright (c) 2018 by Contributors
* \file layout.h * \file nnvm/layout.h
* \brief Layout expression. * \brief Layout expression.
* The layout is composed of upper cases, lower cases and numbers, * The layout is composed of upper cases, lower cases and numbers,
* where upper case indicates a (super-)dimension and * where upper case indicates a (super-)dimension and
......
/*! /*!
* Copyright (c) 2016 by Contributors * Copyright (c) 2016 by Contributors
* \file node.h * \file nnvm/node.h
* \brief Graph node data structure. * \brief Graph node data structure.
*/ */
#ifndef NNVM_NODE_H_ #ifndef NNVM_NODE_H_
......
/*! /*!
* Copyright (c) 2016 by Contributors * Copyright (c) 2016 by Contributors
* \file op.h * \file nnvm/op.h
* \brief Operator information structor. * \brief Operator information structor.
*/ */
#ifndef NNVM_OP_H_ #ifndef NNVM_OP_H_
......
/*! /*!
* Copyright (c) 2016 by Contributors * Copyright (c) 2016 by Contributors
* \file pass.h * \file nnvm/pass.h
* \brief Pass that can be applied to a graph. * \brief Pass that can be applied to a graph.
*/ */
#ifndef NNVM_PASS_H_ #ifndef NNVM_PASS_H_
......
/*! /*!
* Copyright (c) 2016 by Contributors * Copyright (c) 2016 by Contributors
* \file pass_functions.h * \file nnvm/pass_functions.h
* \brief Pass functions that simply redirect the calls to ApplyPass * \brief Pass functions that simply redirect the calls to ApplyPass
* *
* This file serves as documentation on how to use functions implemented in "src/pass". * This file serves as documentation on how to use functions implemented in "src/pass".
......
/*! /*!
* Copyright (c) 2016 by Contributors * Copyright (c) 2016 by Contributors
* \file symbolic.h * \file nnvm/symbolic.h
* \brief Symbolic graph construction API * \brief Symbolic graph construction API
* *
* This API is optional, but useful to allow user * This API is optional, but useful to allow user
......
/*! /*!
* Copyright (c) 2017 by Contributors * Copyright (c) 2017 by Contributors
* \file nn.h * \file nnvm/top/nn.h
* \brief Auxiliary param for tensor primitive. * \brief Auxiliary param for tensor primitive.
*/ */
#ifndef NNVM_TOP_NN_H_ #ifndef NNVM_TOP_NN_H_
......
/*! /*!
* Copyright (c) 2017 by Contributors * Copyright (c) 2017 by Contributors
* \file tensor.h * \file nnvm/top/tensor.h
* \brief Auxiliary param for tensor primitive. * \brief Auxiliary param for tensor primitive.
*/ */
#ifndef NNVM_TOP_TENSOR_H_ #ifndef NNVM_TOP_TENSOR_H_
......
/*! /*!
* Copyright (c) 2016 by Contributors * Copyright (c) 2016 by Contributors
* \file tuple.h * \file nnvm/tuple.h
* \brief Data structure Tuple and TShape to store dynamic sized shapes. * \brief Data structure Tuple and TShape to store dynamic sized shapes.
*/ */
#ifndef NNVM_TUPLE_H_ #ifndef NNVM_TUPLE_H_
......
...@@ -59,8 +59,8 @@ inline bool DotCorrectLayout(const NodeAttrs& attrs, ...@@ -59,8 +59,8 @@ inline bool DotCorrectLayout(const NodeAttrs& attrs,
// concat lhs and rhs layout // concat lhs and rhs layout
const Layout& lhs_out = param.transpose_a ? lhs.reverse() : lhs; const Layout& lhs_out = param.transpose_a ? lhs.reverse() : lhs;
const Layout& rhs_out = param.transpose_b ? rhs.reverse() : rhs; const Layout& rhs_out = param.transpose_b ? rhs.reverse() : rhs;
Layout out = std::move(lhs_out.sublayout(0, lhs_out.ndim()-1) + Layout out = lhs_out.sublayout(0, lhs_out.ndim()-1) +
rhs_out.sublayout(1, rhs_out.ndim()-1)); rhs_out.sublayout(1, rhs_out.ndim()-1);
NNVM_ASSIGN_LAYOUT(*olayouts, 0, out); NNVM_ASSIGN_LAYOUT(*olayouts, 0, out);
} }
return true; return true;
......
...@@ -28,6 +28,23 @@ RUN cd recommonmark; python setup.py install ...@@ -28,6 +28,23 @@ 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 libprotobuf-dev protobuf-compiler RUN apt-get update && apt-get install -y doxygen graphviz libprotobuf-dev protobuf-compiler
COPY install/ubuntu_install_java.sh /install/ubuntu_install_java.sh
RUN bash /install/ubuntu_install_java.sh
COPY install/ubuntu_install_nodejs.sh /install/ubuntu_install_nodejs.sh
RUN bash /install/ubuntu_install_nodejs.sh
COPY install/ubuntu_install_rocm.sh /install/ubuntu_install_rocm.sh
RUN bash /install/ubuntu_install_rocm.sh
COPY install/ubuntu_install_opengl.sh /install/ubuntu_install_opengl.sh
RUN bash /install/ubuntu_install_opengl.sh
COPY install/ubuntu_install_vulkan.sh /install/ubuntu_install_vulkan.sh
RUN bash /install/ubuntu_install_vulkan.sh
# DL Frameworks # DL Frameworks
COPY install/ubuntu_install_mxnet.sh /install/ubuntu_install_mxnet.sh COPY install/ubuntu_install_mxnet.sh /install/ubuntu_install_mxnet.sh
RUN bash /install/ubuntu_install_mxnet.sh RUN bash /install/ubuntu_install_mxnet.sh
...@@ -53,3 +70,10 @@ ENV CPLUS_INCLUDE_PATH=/usr/local/cuda/include:${CPLUS_INCLUDE_PATH} ...@@ -53,3 +70,10 @@ ENV CPLUS_INCLUDE_PATH=/usr/local/cuda/include:${CPLUS_INCLUDE_PATH}
ENV C_INCLUDE_PATH=/usr/local/cuda/include:${C_INCLUDE_PATH} ENV C_INCLUDE_PATH=/usr/local/cuda/include:${C_INCLUDE_PATH}
ENV LIBRARY_PATH=/usr/local/cuda/lib64:/usr/local/nvidia/lib64:${LIBRARY_PATH} ENV LIBRARY_PATH=/usr/local/cuda/lib64:/usr/local/nvidia/lib64:${LIBRARY_PATH}
ENV LD_LIBRARY_PATH=/usr/local/cuda/lib64:/usr/local/nvidia/lib64:${LD_LIBRARY_PATH} ENV LD_LIBRARY_PATH=/usr/local/cuda/lib64:/usr/local/nvidia/lib64:${LD_LIBRARY_PATH}
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
#!/bin/bash
echo "Build TVM..."
cd tvm
cp make/config.mk .
echo USE_CUDNN=1 >> config.mk
echo USE_CUDA=1 >> config.mk
echo USE_OPENCL=1 >> 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
make "$@"
cd ..
echo "Build NNVM..."
make "$@"
#!/bin/bash
export PYTHONPATH=python:tvm/python:tvm/topi/python
echo "Running unittest..."
python -m nose -v tests/python/unittest || exit -1
python3 -m nose -v tests/python/unittest || exit -1
echo "Running compiler test..."
python -m nose -v tests/python/compiler || exit -1
python3 -m nose -v tests/python/compiler || exit -1
Tutorials
=========
This page contains the tutorials about NNVM.
FROM nvidia/cuda:8.0-cudnn7-devel FROM nvidia/cuda:8.0-cudnn7-devel
# Base scripts # Base scripts
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
...@@ -11,8 +12,8 @@ RUN bash /install/ubuntu_install_python.sh ...@@ -11,8 +12,8 @@ RUN bash /install/ubuntu_install_python.sh
COPY install/ubuntu_install_llvm.sh /install/ubuntu_install_llvm.sh COPY install/ubuntu_install_llvm.sh /install/ubuntu_install_llvm.sh
RUN bash /install/ubuntu_install_llvm.sh RUN bash /install/ubuntu_install_llvm.sh
COPY install/ubuntu_install_iverilog.sh /install/ubuntu_install_iverilog.sh COPY install/ubuntu_install_opencl.sh /install/ubuntu_install_opencl.sh
RUN bash /install/ubuntu_install_iverilog.sh RUN bash /install/ubuntu_install_opencl.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
...@@ -24,42 +25,31 @@ RUN bash /install/ubuntu_install_sphinx.sh ...@@ -24,42 +25,31 @@ RUN bash /install/ubuntu_install_sphinx.sh
RUN git clone https://github.com/rtfd/recommonmark RUN git clone https://github.com/rtfd/recommonmark
RUN cd recommonmark; python setup.py install RUN cd recommonmark; python setup.py install
COPY install/ubuntu_install_java.sh /install/ubuntu_install_java.sh # Enable doxygen for c++ doc build
RUN bash /install/ubuntu_install_java.sh RUN apt-get update && apt-get install -y doxygen graphviz libprotobuf-dev protobuf-compiler
COPY install/ubuntu_install_nodejs.sh /install/ubuntu_install_nodejs.sh # DL Frameworks
RUN bash /install/ubuntu_install_nodejs.sh COPY install/ubuntu_install_mxnet.sh /install/ubuntu_install_mxnet.sh
RUN bash /install/ubuntu_install_mxnet.sh
COPY install/ubuntu_install_rocm.sh /install/ubuntu_install_rocm.sh COPY install/ubuntu_install_onnx.sh /install/ubuntu_install_onnx.sh
RUN bash /install/ubuntu_install_rocm.sh RUN bash /install/ubuntu_install_onnx.sh
COPY install/ubuntu_install_opengl.sh /install/ubuntu_install_opengl.sh COPY install/ubuntu_install_coreml.sh /install/ubuntu_install_coreml.sh
RUN bash /install/ubuntu_install_opengl.sh RUN bash /install/ubuntu_install_coreml.sh
COPY install/ubuntu_install_opencl.sh /install/ubuntu_install_opencl.sh COPY install/ubuntu_install_keras.sh /install/ubuntu_install_keras.sh
RUN bash /install/ubuntu_install_opencl.sh RUN bash /install/ubuntu_install_keras.sh
# Enable doxygen for c++ doc build COPY install/ubuntu_install_darknet.sh /install/ubuntu_install_darknet.sh
RUN apt-get update && apt-get install -y doxygen graphviz RUN bash /install/ubuntu_install_darknet.sh
# Install vulkan
COPY install/ubuntu_install_vulkan.sh /install/ubuntu_install_vulkan.sh
RUN bash /install/ubuntu_install_vulkan.sh
RUN pip install Pillow
# Environment variables # Environment variables
ENV PATH=/node_modules/.bin:${PATH}
ENV PATH=/usr/local/nvidia/bin:${PATH} ENV PATH=/usr/local/nvidia/bin:${PATH}
ENV PATH=/usr/local/cuda/bin:${PATH} ENV PATH=/usr/local/cuda/bin:${PATH}
ENV CPLUS_INCLUDE_PATH=/usr/local/cuda/include:${CPLUS_INCLUDE_PATH} ENV CPLUS_INCLUDE_PATH=/usr/local/cuda/include:${CPLUS_INCLUDE_PATH}
ENV C_INCLUDE_PATH=/usr/local/cuda/include:${C_INCLUDE_PATH} ENV C_INCLUDE_PATH=/usr/local/cuda/include:${C_INCLUDE_PATH}
ENV LIBRARY_PATH=/usr/local/cuda/lib64:/usr/local/nvidia/lib64:${LIBRARY_PATH} ENV LIBRARY_PATH=/usr/local/cuda/lib64:/usr/local/nvidia/lib64:${LIBRARY_PATH}
ENV LD_LIBRARY_PATH=/usr/local/cuda/lib64:/usr/local/nvidia/lib64:${LD_LIBRARY_PATH} ENV LD_LIBRARY_PATH=/usr/local/cuda/lib64:/usr/local/nvidia/lib64:${LD_LIBRARY_PATH}
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
#install the necessary dependancies, cffi, opencv
wget 'https://github.com/siju-samuel/darknet/blob/master/lib/libdarknet.so?raw=true' -O libdarknet.so
pip2 install opencv-python cffi
pip3 install opencv-python cffi
pip2 install keras tensorflow h5py
pip2 install mxnet
pip3 install mxnet
pip2 install onnx>=1.1.0
pip3 install onnx>=1.1.0
pip2 install http://download.pytorch.org/whl/cu75/torch-0.2.0.post3-cp27-cp27mu-manylinux1_x86_64.whl
pip2 install torchvision
pip3 install http://download.pytorch.org/whl/cu75/torch-0.2.0.post3-cp35-cp35m-manylinux1_x86_64.whl
pip3 install torchvision
#!/bin/bash
echo "Build TVM..."
make "$@"
cd nnvm
echo "Build NNVM..."
make "$@"
#!/bin/bash #!/bin/bash
echo "Cleanup data..." echo "Cleanup data..."
cd tvm cd nnvm
make clean make clean
cd .. cd ..
make clean make clean
#!/bin/bash
export PYTHONPATH=nnvm/python:python:topi/python
echo "Running unittest..."
python -m nose -v nnvm/tests/python/unittest || exit -1
python3 -m nose -v nnvm/tests/python/unittest || exit -1
echo "Running compiler test..."
python -m nose -v nnvm/tests/python/compiler || exit -1
python3 -m nose -v nnvm/tests/python/compiler || exit -1
echo "Running ONNX frontend test..."
python -m nose -v tests/python/frontend/onnx || exit -1
echo "Running MXNet frontend test..."
python -m nose -v tests/python/frontend/mxnet || exit -1
echo "Running Keras frontend test..."
python -m nose -v tests/python/frontend/keras || exit -1
/*! /*!
* Copyright (c) 2017 by Contributors * Copyright (c) 2017 by Contributors
* \brief NN op constructions * \brief NN op constructions
* \file nn.h * \file topi/nn.h
*/ */
#ifndef TOPI_NN_H_ #ifndef TOPI_NN_H_
#define TOPI_NN_H_ #define TOPI_NN_H_
......
Compile Deep Learning Models
----------------------------
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