diff --git a/CMakeLists.txt b/CMakeLists.txt index c53fb1cfe8cd3..972e2cbe712d1 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -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 diff --git a/Jenkinsfile b/Jenkinsfile index ba75ee47c0ed0..b677ccd2b78d2 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -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) diff --git a/README.md b/README.md index 7d4d6d8c26bb4..d1e0a4472a1f2 100644 --- a/README.md +++ b/README.md @@ -1,18 +1,18 @@ 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 --------------- diff --git a/nnvm/src/core/symbolic.cc b/nnvm/src/core/symbolic.cc index 927dd2b70e449..89d87d32ff745 100644 --- a/nnvm/src/core/symbolic.cc +++ b/nnvm/src/core/symbolic.cc @@ -200,7 +200,7 @@ std::vector Symbol::ListInputs(ListInputOption option) const { std::vector vlist; vlist.reserve(this->outputs.size()); static auto& fmutate_inputs = Op::GetAttr("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())) { diff --git a/src/contrib/sort/sort.cc b/src/contrib/sort/sort.cc index ced5021fd1aa7..160e479b86b53 100644 --- a/src/contrib/sort/sort.cc +++ b/src/contrib/sort/sort.cc @@ -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 - : CompareAscend); + if (is_descend) { + std::stable_sort(sorter.begin(), sorter.end(), CompareDescend); + } else { + std::stable_sort(sorter.begin(), sorter.end(), CompareAscend); + } for (int32_t k = 0; k < input->shape[axis]; ++k) { *(static_cast(output->data) + base_idx + k * axis_mul_after) - = k < sorter.size() ? sorter[k].first : k; + = k < static_cast(sorter.size()) ? sorter[k].first : k; } } } diff --git a/src/runtime/opengl/opengl_device_api.cc b/src/runtime/opengl/opengl_device_api.cc index 96ffb3192b7b7..4357e610f478a 100644 --- a/src/runtime/opengl/opengl_device_api.cc +++ b/src/runtime/opengl/opengl_device_api.cc @@ -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) { diff --git a/src/runtime/opengl/opengl_module.h b/src/runtime/opengl/opengl_module.h index 9e5f4044b3b6c..a55a09b6c1bd2 100644 --- a/src/runtime/opengl/opengl_module.h +++ b/src/runtime/opengl/opengl_module.h @@ -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; } } diff --git a/tests/ci_build/Dockerfile.gpu b/tests/ci_build/Dockerfile.gpu index 3e2c6f2eb7b5c..0d9c1be420f7b 100644 --- a/tests/ci_build/Dockerfile.gpu +++ b/tests/ci_build/Dockerfile.gpu @@ -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} diff --git a/tests/ci_build/install/ubuntu_install_llvm.sh b/tests/ci_build/install/ubuntu_install_llvm.sh index ba0afcd18cc9d..16d0fe150b7ed 100644 --- a/tests/ci_build/install/ubuntu_install_llvm.sh +++ b/tests/ci_build/install/ubuntu_install_llvm.sh @@ -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 diff --git a/topi/include/topi/reduction.h b/topi/include/topi/reduction.h index a4a3e4e999ac8..cb89be30a32d1 100644 --- a/topi/include/topi/reduction.h +++ b/topi/include/topi/reduction.h @@ -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);