Commit fed6298b by Tianqi Chen Committed by GitHub

[BUILD] Add clang to build matrix, -Werror (#1273)

parent a81ebd90
......@@ -82,8 +82,8 @@ if(MSVC)
else(MSVC)
include(CheckCXXCompilerFlag)
check_cxx_compiler_flag("-std=c++11" SUPPORT_CXX11)
set(CMAKE_C_FLAGS "-O3 -Wall -fPIC")
set(CMAKE_CXX_FLAGS "${CMAKE_C_FLAGS} -std=c++11")
set(CMAKE_C_FLAGS "-O2 -Wall -fPIC ${CMAKE_C_FLAGS}")
set(CMAKE_CXX_FLAGS "-O2 -Wall -fPIC -std=c++11 ${CMAKE_CXX_FLAGS}")
endif(MSVC)
# add source group
......
......@@ -96,6 +96,8 @@ stage('Build') {
echo set\\(USE_SORT ON\\) >> config.cmake
echo set\\(USE_GRAPH_RUNTIME ON\\) >> config.cmake
echo set\\(USE_BLAS openblas\\) >> config.cmake
echo set\\(CMAKE_CXX_COMPILER g++\\) >> config.cmake
echo set\\(CMAKE_CXX_FLAGS -Werror\\) >> config.cmake
"""
make('gpu', 'build', '-j2')
pack_lib('gpu', tvm_multilib)
......@@ -106,7 +108,9 @@ stage('Build') {
cp ../cmake/config.cmake .
echo set\\(USE_OPENCL ON\\) >> config.cmake
echo set\\(USE_ROCM ON\\) >> config.cmake
echo set\\(USE_VULKAN OFF\\) >> config.cmake
echo set\\(USE_VULKAN ON\\) >> config.cmake
echo set\\(CMAKE_CXX_COMPILER clang-6.0\\) >> config.cmake
echo set\\(CMAKE_CXX_FLAGS -Werror\\) >> config.cmake
"""
make('gpu', 'build2', '-j2')
}
......@@ -122,6 +126,8 @@ stage('Build') {
cp ../cmake/config.cmake .
echo set\\(USE_SORT ON\\) >> config.cmake
echo set\\(USE_LLVM llvm-config-4.0\\) >> config.cmake
echo set\\(CMAKE_CXX_COMPILER g++\\) >> config.cmake
echo set\\(CMAKE_CXX_FLAGS -Werror\\) >> config.cmake
"""
make('cpu', 'build', '-j2')
pack_lib('cpu', tvm_lib)
......@@ -142,6 +148,8 @@ stage('Build') {
echo set\\(USE_SORT ON\\) >> config.cmake
echo set\\(USE_RPC ON\\) >> config.cmake
echo set\\(USE_LLVM llvm-config-5.0\\) >> config.cmake
echo set\\(CMAKE_CXX_COMPILER g++\\) >> config.cmake
echo set\\(CMAKE_CXX_FLAGS -Werror\\) >> config.cmake
"""
make('i386', 'build', '-j2')
pack_lib('i386', tvm_multilib)
......
<img src=https://raw.githubusercontent.com/tqchen/tvm.ai/master/images/logo/tvm-logo-small.png width=128/> Open Deep Learning Compiler Stack
==============================================
[![GitHub license](http://dmlc.github.io/img/apache2.svg)](./LICENSE)
[![GitHub license](https://dmlc.github.io/img/apache2.svg)](./LICENSE)
[![Build Status](http://mode-gpu.cs.washington.edu:8080/buildStatus/icon?job=dmlc/tvm/master)](http://mode-gpu.cs.washington.edu:8080/job/dmlc/job/tvm/job/master/)
[Documentation](http://docs.tvm.ai) |
[Documentation](https://docs.tvm.ai) |
[Contributors](CONTRIBUTORS.md) |
[Community](http://tvm.ai/community.html) |
[Community](https://tvm.ai/community.html) |
[Release Notes](NEWS.md)
TVM is a compiler stack for deep learning systems. It is designed to close the gap between the
productivity-focused deep learning frameworks, and the performance- and efficiency-focused hardware backends.
TVM works with deep learning frameworks to provide end to end compilation to different backends.
Checkout the [tvm stack homepage](http://tvm.ai/) for more information.
Checkout the [tvm stack homepage](https://tvm.ai/) for more information.
License
-------
......@@ -21,7 +21,7 @@ License
Contribute to TVM
-----------------
TVM adopts apache committer model, we aim to create an open source project that is maintained and owned by the community.
Checkout the [Contributor Guide](http://docs.tvm.ai/contribute/)
Checkout the [Contributor Guide](https://docs.tvm.ai/contribute/)
Acknowledgement
---------------
......
......@@ -200,7 +200,7 @@ std::vector<NodePtr> Symbol::ListInputs(ListInputOption option) const {
std::vector<NodePtr> vlist;
vlist.reserve(this->outputs.size());
static auto& fmutate_inputs = Op::GetAttr<FMutateInputs>("FMutateInputs");
DFSVisit(this->outputs, [&ret, &mutable_set, &vlist](const NodePtr &node) {
DFSVisit(this->outputs, [&mutable_set, &vlist](const NodePtr &node) {
if (node->is_variable()) {
vlist.push_back(node);
} else if (fmutate_inputs.count(node->op())) {
......
......@@ -78,12 +78,14 @@ TVM_REGISTER_GLOBAL("tvm.contrib.sort.argsort")
int64_t full_idx = base_idx + k * axis_mul_after;
sorter.emplace_back(std::make_pair(k, *(data_ptr + full_idx)));
}
std::stable_sort(sorter.begin(), sorter.end(),
is_descend ? CompareDescend<float>
: CompareAscend<float>);
if (is_descend) {
std::stable_sort(sorter.begin(), sorter.end(), CompareDescend<float>);
} else {
std::stable_sort(sorter.begin(), sorter.end(), CompareAscend<float>);
}
for (int32_t k = 0; k < input->shape[axis]; ++k) {
*(static_cast<int32_t *>(output->data) + base_idx + k * axis_mul_after)
= k < sorter.size() ? sorter[k].first : k;
= k < static_cast<int32_t>(sorter.size()) ? sorter[k].first : k;
}
}
}
......
......@@ -328,10 +328,11 @@ static TextureFormat GetTextureFormat(TVMType type) {
LOG(FATAL) << "Unsupported type bits " << type.bits;
}
}
default:
default: {
LOG(FATAL) << "Unsupported type code" << type.code;
}
}
assert(false);
return {GL_R32F, GL_RED, GL_FLOAT};
}
Texture OpenGLWorkspace::CreateTexture(TVMType type, size_t nbytes) {
......
......@@ -88,8 +88,10 @@ inline std::string OpenGLArgKind2String(OpenGLArgKind kind) {
return "input_texture";
case OpenGLArgKind::kUniform:
return "uniform";
default:
LOG(FATAL) << "invalid arg kind";
return "";
}
assert(false);
}
inline OpenGLArgKind String2OpenGLArgKind(const std::string& str) {
......@@ -101,7 +103,7 @@ inline OpenGLArgKind String2OpenGLArgKind(const std::string& str) {
return OpenGLArgKind::kUniform;
} else {
LOG(FATAL) << "Invalid OpenGL arg kind.";
assert(false);
return OpenGLArgKind::kUniform;
}
}
......
......@@ -60,8 +60,8 @@ RUN bash /install/ubuntu_install_onnx.sh
RUN pip3 install Pillow
# disable vulkan for now
# COPY install/ubuntu_install_vulkan.sh /install/ubuntu_install_vulkan.sh
# RUN bash /install/ubuntu_install_vulkan.sh
COPY install/ubuntu_install_vulkan.sh /install/ubuntu_install_vulkan.sh
RUN bash /install/ubuntu_install_vulkan.sh
# Environment variables
ENV PATH=/usr/local/nvidia/bin:${PATH}
......
......@@ -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
......@@ -238,8 +238,8 @@ inline FCommReduce MakeCommReducer(FCombine fcombine,
for (size_t i = 0; i < exprs.size(); ++i) {
auto dtype = exprs[i].type();
dtypes.push_back(dtype);
lhs.push_back(var("lhs_" + std::to_string(i), dtype));
rhs.push_back(var("rhs_" + std::to_string(i), dtype));
lhs.push_back(var(name + "_lhs_" + std::to_string(i), dtype));
rhs.push_back(var(name + "_rhs_" + std::to_string(i), dtype));
}
auto result = fcombine(lhs, rhs);
......
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