Skip to content

Commit

Permalink
[MLC] CI Tweaks
Browse files Browse the repository at this point in the history
- Revert "[CMake][MSVC] Disable permissive mode for MSVC builds (#16343)"
- Skip MSC tests
- Disable NNPack and TFLite
- Tweak CMAKE_CUDA_ARCHITECTURES
  • Loading branch information
MasterJH5574 committed Mar 24, 2024
1 parent d7a35dd commit 3dbceda
Show file tree
Hide file tree
Showing 5 changed files with 29 additions and 10 deletions.
5 changes: 0 additions & 5 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -170,11 +170,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 "")

Expand Down
24 changes: 24 additions & 0 deletions cmake/modules/CUDA.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -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)
6 changes: 3 additions & 3 deletions tests/scripts/task_config_build_cpu.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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
Expand Down
2 changes: 1 addition & 1 deletion tests/scripts/task_config_build_gpu.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion tests/scripts/unity/task_python_relax.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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

0 comments on commit 3dbceda

Please sign in to comment.