Commit 10bc2fdf by Edward Z. Yang Committed by Tianqi Chen

Conda build recipe (#288)

* Typofix.

Signed-off-by: Edward Z. Yang <ezyang@fb.com>

* Probe for nvrtc in lib directory as well.

Signed-off-by: Edward Z. Yang <ezyang@fb.com>

* Conda build recipe for TVM.

Signed-off-by: Edward Z. Yang <ezyang@fb.com>
parent fe3b8857
......@@ -90,7 +90,8 @@ find_package(CUDA)
list(APPEND TVM_LINKER_LIBS ${CUDA_NVRTC_LIB})
else(MSVC)
find_library(CUDA_NVRTC_LIB nvrtc
${CUDA_TOOLKIT_ROOT_DIR}/lib64)
${CUDA_TOOLKIT_ROOT_DIR}/lib64
${CUDA_TOOLKIT_ROOT_DIR}/lib)
list(APPEND TVM_LINKER_LIBS ${CUDA_NVRTC_LIB})
endif(MSVC)
add_definitions(-DTVM_CUDA_RUNTIME=1)
......
......@@ -17,6 +17,6 @@ See also [This Issue](https://github.com/dmlc/tvm/issues/151)
TVM's relation to libDNN cuDNN
------------------------------
TVM can incoporate these library as external calls. One goal of TVM is to be able to
TVM can incorporate these library as external calls. One goal of TVM is to be able to
generate high performing kernels. We will evolve TVM an incremental manner as
we learn from the technics of manual kernel crafting and add these as primitives in DSL.
......@@ -348,7 +348,7 @@ constexpr const char* tvm_thread_context = "tvm_thread_context";
*/
constexpr const char* tvm_call_packed_lowered = "tvm_call_packed_lowered";
/*!
* \brief See pesudo code
* \brief See pseudo code
*
* int tvm_storage_sync(std::string storage_scope) {
* __sync(storage_scope);
......
#!/bin/bash
set -e
# See Note [CUDA_TOOLKIT_ROOT_DIR versus CUDA_BIN_PATH]
if [ -z "$CONDA_CUDA_HOME" ]; then
CUDA_ARGS=""
else
# See Note [Bash argument quoting]
CUDA_ARGS="-DCUDA_TOOLKIT_ROOT_DIR=$(printf %q "$CONDA_CUDA_HOME")"
fi
if [ -z "$PREFIX" ]; then
PREFIX="$CONDA_PREFIX"
fi
if [ "$(uname)" = 'Darwin' ]
then
# Without this, Apple's default shipped clang will refuse to see any
# headers like mutex.
export MACOSX_DEPLOYMENT_TARGET=10.9
fi
rm -rf build || true
mkdir -p build
cd build
# Enable static-libstdc++ to make it easier to link this library with
# other C++ compilers
CXXFLAGS=-static-libstdc++ cmake3 -DCMAKE_PREFIX_PATH=${PREFIX} -DCMAKE_INSTALL_PREFIX=${PREFIX} -DUSE_CUDA=1 -DUSE_LLVM=1 -DINSTALL_DEV=1 $CUDA_ARGS ..
make -j20 VERBOSE=1
make install/fast
cd ..
# Also install the headers for libraries that TVM vendored
mkdir -p "$PREFIX/include"
# TODO: arguably dlpack and dmlc-core should get its own packaging and
# install their headers themselves
cp -R dlpack/include/. "$PREFIX/include"
cp -R dmlc-core/include/. "$PREFIX/include"
# TODO: HalideIR's includes could conflict, but TVM currently assumes they
# are installed here, awfully enough
cp -R HalideIR/src/. "$PREFIX/include"
cd python
$PYTHON setup.py install
cd ..
{% set version = "0.1.dev" %}
package:
name: tvm
version: {{ version }}
source:
path: ../..
build:
number: 1
skip: True # [win]
script_env:
- CONDA_CUDA_HOME
requirements:
build:
- llvmdev ==4.0.0
- python >=3
- numpy
- setuptools
- nose
- decorator
run:
- python >=3
- numpy
- decorator
about:
home: https://github.com/dmlc/tvm
license: Apache2
summary: a low level domain specific language for compiling tensor computation pipelines
......@@ -95,11 +95,11 @@ print('Opt1: %f' % evaluator(a, b, c).mean)
# Vectorization
# -------------
# Another important trick is vectorization. When the memory access pattern is uniform, the compiler
# can dectect this pattern and pass the continuous memory to vector processor. In TVM, we can use
# can detect this pattern and pass the continuous memory to vector processor. In TVM, we can use
# `vectorize` interface to hint the compiler this pattern, so that we can accelerate it vastly.
#
# After trying different schedule, we finally found that we can benefit from vectorizing
# After trying different schedule, we finally found that we can benefit from vectorizing
# the row loop most, i.e. yi.
s[C].vectorize(yi)
func = tvm.build(s, [A, B, C], name = 'mmult')
......
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