Skip to content

Commit

Permalink
[Unity] Set CMAKE_CUDA_ARCHITECTURES default to native (#16335)
Browse files Browse the repository at this point in the history
CI images should also be updated to install cmake 3.24
  • Loading branch information
vinx13 authored Jan 10, 2024
1 parent 45532d7 commit 474c06b
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 24 deletions.
2 changes: 1 addition & 1 deletion 3rdparty/cutlass_fpA_intB_gemm
2 changes: 1 addition & 1 deletion CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
cmake_minimum_required(VERSION 3.18)
cmake_minimum_required(VERSION 3.24)
project(tvm C CXX)

# Utility functions
Expand Down
25 changes: 4 additions & 21 deletions cmake/modules/CUDA.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -38,27 +38,10 @@ if(USE_CUDA)
list(APPEND TVM_RUNTIME_LINKER_LIBS ${CUDA_CUDA_LIBRARY})
list(APPEND TVM_RUNTIME_LINKER_LIBS ${CUDA_NVRTC_LIBRARY})

# Compatibility with cmake 3.18+
#
# The updates to the cutlass kernels made in TVM PR#16244 require
# symbols provided in cuda 7.5+. While the cuda architecture is
# specified by setting `NVCC_FLAGS` in the `CMakeLists.txt` for each
# kernel, cmake 3.18+ also sets it based on the
# `CMAKE_CUDA_ARCHITECTURES` value. If not set, cmake will explicitly
# pass the compute capability as nvidia's default of 5.2, *EVEN IF* it
# has already been specified in `NVCC_FLAGS`. Because the kernels
# cannot compile with compute capability of 5.2, this causes
# compilation errors.
#
# By setting `CMAKE_CUDA_ARCHITECTURES` to `OFF`, cmake does not add
# 5.2 as a target architecture.
#
# See https://cmake.org/cmake/help/latest/policy/CMP0104.html for
# details on CMake's policy for CUDA architecture flags.
#
# See https://cmake.org/cmake/help/latest/policy/CMP0104.html for the
# default CUDA architecture for each version of CUDA.
set(CMAKE_CUDA_ARCHITECTURES OFF)
if(NOT DEFINED CMAKE_CUDA_ARCHITECTURES)
message(STATUS "CMAKE_CUDA_ARCHITECTURES not set, using native")
set(CMAKE_CUDA_ARCHITECTURES native)
endif()

if(USE_CUDNN)
message(STATUS "Build with cuDNN support")
Expand Down
1 change: 0 additions & 1 deletion tests/scripts/task_config_build_gpu.sh
Original file line number Diff line number Diff line change
Expand Up @@ -54,4 +54,3 @@ echo set\(USE_PIPELINE_EXECUTOR ON\) >> config.cmake
echo set\(USE_CUTLASS ON\) >> config.cmake
echo set\(USE_CMSISNN ON\) >> config.cmake
echo set\(USE_MSC ON\) >> config.cmake
echo set\(CMAKE_CUDA_ARCHITECTURES 75\) >> config.cmake

0 comments on commit 474c06b

Please sign in to comment.