From f8b2ff1bfea46ddbab905267f782c3fd9482a470 Mon Sep 17 00:00:00 2001 From: Ruihang Lai Date: Mon, 11 Dec 2023 13:45:55 -0500 Subject: [PATCH] [MLC] CI Tweaks - Revert "[CMake][MSVC] Disable permissive mode for MSVC builds (#16343)" - Skip MSC tests - Disable NNPack and TFLite - Tweak CMAKE_CUDA_ARCHITECTURES --- CMakeLists.txt | 5 ----- cmake/modules/CUDA.cmake | 24 ++++++++++++++++++++++++ tests/scripts/task_config_build_cpu.sh | 6 +++--- tests/scripts/task_config_build_gpu.sh | 2 +- tests/scripts/unity/task_python_relax.sh | 2 +- 5 files changed, 29 insertions(+), 10 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 058f477dbd..410ed439f1 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -168,11 +168,6 @@ if(MSVC) set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} /MP") add_compile_options(/bigobj) - # Use standard-conforming two-phase name resolution for templates. - # This minimizes the differences between g++/clang builds on Linux, - # and MSVC builds on Windows. - set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} /permissive-") - # MSVC already errors on undefined symbols, no additional flag needed. set(TVM_NO_UNDEFINED_SYMBOLS "") diff --git a/cmake/modules/CUDA.cmake b/cmake/modules/CUDA.cmake index 84f466f591..9be3d3421e 100644 --- a/cmake/modules/CUDA.cmake +++ b/cmake/modules/CUDA.cmake @@ -109,6 +109,30 @@ if(USE_CUDA) # Add CUDA builtins to RelaxVM tvm_file_glob(GLOB RELAX_VM_CUDA_BUILTIN_SRC_CC src/runtime/relax_vm/cuda/*.cc) list(APPEND RUNTIME_SRCS ${RELAX_VM_CUDA_BUILTIN_SRC_CC}) + + if(USE_CUTLASS) + if(NOT DEFINED CMAKE_CUDA_ARCHITECTURES) + set(CMAKE_CUDA_COMPILER ${CUDA_TOOLKIT_ROOT_DIR}/bin/nvcc) + execute_process( + COMMAND ${CMAKE_CUDA_COMPILER} --version + OUTPUT_VARIABLE NVCC_VERSION_OUTPUT + ) + if(NVCC_VERSION_OUTPUT MATCHES "release ([^,]+),") + set(CUDA_VERSION "${CMAKE_MATCH_1}") + endif(NVCC_VERSION_OUTPUT MATCHES "release ([^,]+),") + message(STATUS "CUDA_VERSION=${CUDA_VERSION}") + + if(CUDA_VERSION VERSION_GREATER_EQUAL 11.8) + set(CMAKE_CUDA_ARCHITECTURES "75;80;86;89;90") + else(CUDA_VERSION VERSION_GREATER_EQUAL 11.8) + set(CMAKE_CUDA_ARCHITECTURES "75;80;86") + endif(CUDA_VERSION VERSION_GREATER_EQUAL 11.8) + message(STATUS "Set CMAKE_CUDA_ARCHITECTURES=${CMAKE_CUDA_ARCHITECTURES}") + else(NOT DEFINED CMAKE_CUDA_ARCHITECTURES) + message(STATUS "Found CMAKE_CUDA_ARCHITECTURES=${CMAKE_CUDA_ARCHITECTURES}") + endif(NOT DEFINED CMAKE_CUDA_ARCHITECTURES) + endif(USE_CUTLASS) + else(USE_CUDA) list(APPEND COMPILER_SRCS src/target/opt/build_cuda_off.cc) endif(USE_CUDA) diff --git a/tests/scripts/task_config_build_cpu.sh b/tests/scripts/task_config_build_cpu.sh index 0d6c0e2cae..df5761b861 100755 --- a/tests/scripts/task_config_build_cpu.sh +++ b/tests/scripts/task_config_build_cpu.sh @@ -30,7 +30,7 @@ echo set\(USE_PROFILER ON\) >> config.cmake echo set\(USE_DNNL ON\) >> config.cmake echo set\(USE_ARM_COMPUTE_LIB ON\) >> config.cmake echo set\(USE_LLVM \"/usr/bin/llvm-config-15 --link-static\"\) >> config.cmake -echo set\(USE_NNPACK ON\) >> config.cmake +echo set\(USE_NNPACK OFF\) >> config.cmake echo set\(NNPACK_PATH /NNPACK/build/\) >> config.cmake echo set\(USE_ANTLR ON\) >> config.cmake echo set\(CMAKE_CXX_FLAGS \"-Werror -Wno-error=range-loop-construct\"\) >> config.cmake @@ -40,9 +40,9 @@ echo set\(HIDE_PRIVATE_SYMBOLS ON\) >> config.cmake # with the change in the way TFLite is built. It can be # removed once we migrate to TensorFlow and TFLite > 2.9.1 if [ -d "/opt/tflite" ]; then - echo set\(USE_TFLITE \"/opt/tflite\"\) >> config.cmake + echo set\(USE_TFLITE OFF\) >> config.cmake else - echo set\(USE_TFLITE ON\) >> config.cmake + echo set\(USE_TFLITE OFF\) >> config.cmake fi echo set\(USE_TENSORFLOW_PATH \"/tensorflow\"\) >> config.cmake diff --git a/tests/scripts/task_config_build_gpu.sh b/tests/scripts/task_config_build_gpu.sh index e68e646ce1..6096169051 100755 --- a/tests/scripts/task_config_build_gpu.sh +++ b/tests/scripts/task_config_build_gpu.sh @@ -33,7 +33,7 @@ echo set\(USE_OPENCL_GTEST \"/googletest\"\) >> config.cmake echo set\(USE_MICRO ON\) >> config.cmake echo set\(USE_MICRO_STANDALONE_RUNTIME ON\) >> config.cmake echo set\(USE_LLVM \"/usr/bin/llvm-config-15 --link-static\"\) >> config.cmake -echo set\(USE_NNPACK ON\) >> config.cmake +echo set\(USE_NNPACK OFF\) >> config.cmake echo set\(NNPACK_PATH /NNPACK/build/\) >> config.cmake echo set\(USE_RPC ON\) >> config.cmake echo set\(USE_SORT ON\) >> config.cmake diff --git a/tests/scripts/unity/task_python_relax.sh b/tests/scripts/unity/task_python_relax.sh index 121ba1389a..6d6751aaa3 100755 --- a/tests/scripts/unity/task_python_relax.sh +++ b/tests/scripts/unity/task_python_relax.sh @@ -38,4 +38,4 @@ TVM_TEST_TARGETS="${TVM_RELAY_TEST_TARGETS:-llvm}" pytest tests/python/dlight # python3 ./apps/relax_examples/resnet.py # Test for MSC -pytest tests/python/contrib/test_msc +# pytest tests/python/contrib/test_msc