From df97e1a881e0922287b4d39755c1262f92c32283 Mon Sep 17 00:00:00 2001 From: Jiqun Tu Date: Fri, 3 Jan 2025 13:05:23 -0800 Subject: [PATCH] When using TF32 and BF16 check if the CC is less than 80. --- lib/targets/cuda/target_cuda.cmake | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/lib/targets/cuda/target_cuda.cmake b/lib/targets/cuda/target_cuda.cmake index 234fbf35a3..fc4a6ab8dd 100644 --- a/lib/targets/cuda/target_cuda.cmake +++ b/lib/targets/cuda/target_cuda.cmake @@ -205,11 +205,16 @@ if(QUDA_MULTIGRID) set(QUDA_MULTIGRID_MMA_TYPES "SIMT" "SMMA" "1xFP16" "3xFP16" "1xTF32" "3xTF32" "3xBF16" "DEFAULT") + set(QUDA_MULTIGRID_MMA_NOT_IN_SM70 "1xTF32" "3xTF32" "3xBF16") + set(QUDA_MULTIGRID_MMA_SETUP_TYPE "DEFAULT" CACHE STRING "MMA type to be used for setup") set_property(CACHE QUDA_MULTIGRID_MMA_SETUP_TYPE PROPERTY STRINGS ${QUDA_MULTIGRID_MMA_TYPES}) if(NOT QUDA_MULTIGRID_MMA_SETUP_TYPE IN_LIST QUDA_MULTIGRID_MMA_TYPES) message(FATAL_ERROR "QUDA_MULTIGRID_MMA_SETUP_TYPE=${QUDA_MULTIGRID_MMA_SETUP_TYPE} must be one of ${QUDA_MULTIGRID_MMA_TYPES}") else() + if(QUDA_MULTIGRID_MMA_SETUP_TYPE IN_LIST QUDA_MULTIGRID_MMA_NOT_IN_SM70 AND ${QUDA_COMPUTE_CAPABILITY} LESS 80) + message(FATAL_ERROR "${QUDA_MULTIGRID_MMA_SETUP_TYPE} not available for SM 70") + endif() message(STATUS "QUDA_MULTIGRID_MMA_SETUP_TYPE=${QUDA_MULTIGRID_MMA_SETUP_TYPE}") endif() @@ -218,6 +223,9 @@ if(QUDA_MULTIGRID) if(NOT QUDA_MULTIGRID_MMA_DSLASH_TYPE IN_LIST QUDA_MULTIGRID_MMA_TYPES) message(FATAL_ERROR "QUDA_MULTIGRID_MMA_DSLASH_TYPE=${QUDA_MULTIGRID_MMA_DSLASH_TYPE} must be one of ${QUDA_MULTIGRID_MMA_TYPES}") else() + if(QUDA_MULTIGRID_MMA_DSLASH_TYPE IN_LIST QUDA_MULTIGRID_MMA_NOT_IN_SM70 AND ${QUDA_COMPUTE_CAPABILITY} LESS 80) + message(FATAL_ERROR "${QUDA_MULTIGRID_MMA_DSLASH_TYPE} not available for SM 70") + endif() message(STATUS "QUDA_MULTIGRID_MMA_DSLASH_TYPE=${QUDA_MULTIGRID_MMA_DSLASH_TYPE}") endif() @@ -226,6 +234,9 @@ if(QUDA_MULTIGRID) if(NOT QUDA_MULTIGRID_MMA_PROLONGATOR_TYPE IN_LIST QUDA_MULTIGRID_MMA_TYPES) message(FATAL_ERROR "QUDA_MULTIGRID_MMA_PROLONGATOR_TYPE=${QUDA_MULTIGRID_MMA_PROLONGATOR_TYPE} must be one of ${QUDA_MULTIGRID_MMA_TYPES}") else() + if(QUDA_MULTIGRID_MMA_PROLONGATOR_TYPE IN_LIST QUDA_MULTIGRID_MMA_NOT_IN_SM70 AND ${QUDA_COMPUTE_CAPABILITY} LESS 80) + message(FATAL_ERROR "${QUDA_MULTIGRID_MMA_PROLONGATOR_TYPE} not available for SM 70") + endif() message(STATUS "QUDA_MULTIGRID_MMA_PROLONGATOR_TYPE=${QUDA_MULTIGRID_MMA_PROLONGATOR_TYPE}") endif() @@ -234,6 +245,9 @@ if(QUDA_MULTIGRID) if(NOT QUDA_MULTIGRID_MMA_RESTRICTOR_TYPE IN_LIST QUDA_MULTIGRID_MMA_TYPES) message(FATAL_ERROR "QUDA_MULTIGRID_MMA_RESTRICTOR_TYPE=${QUDA_MULTIGRID_MMA_RESTRICTOR_TYPE} must be one of ${QUDA_MULTIGRID_MMA_TYPES}") else() + if(QUDA_MULTIGRID_MMA_RESTRICTOR_TYPE IN_LIST QUDA_MULTIGRID_MMA_NOT_IN_SM70 AND ${QUDA_COMPUTE_CAPABILITY} LESS 80) + message(FATAL_ERROR "${QUDA_MULTIGRID_MMA_RESTRICTOR_TYPE} not available for SM 70") + endif() message(STATUS "QUDA_MULTIGRID_MMA_RESTRICTOR_TYPE=${QUDA_MULTIGRID_MMA_RESTRICTOR_TYPE}") endif()