[Unity] Cutlass kernel compatibility with cmake 3.18+ #16302
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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_FLAGSin theCMakeLists.txtfor each kernel, cmake 3.18+ also sets it based on theCMAKE_CUDA_ARCHITECTURESvalue. If not set, cmake will explicitly pass the compute capability as nvidia's default of 5.2, EVEN IF it has already been specified inNVCC_FLAGS. Because the kernels cannot compile with compute capability of 5.2, this causes compilation errors.By setting
CMAKE_CUDA_ARCHITECTUREStoOFF, 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://stackoverflow.com/a/28933055 for the default CUDA architecture for each version of CUDA.