Skip to content

Commit

Permalink
When using TF32 and BF16 check if the CC is less than 80.
Browse files Browse the repository at this point in the history
  • Loading branch information
hummingtree committed Jan 3, 2025
1 parent 53c8e31 commit df97e1a
Showing 1 changed file with 14 additions and 0 deletions.
14 changes: 14 additions & 0 deletions lib/targets/cuda/target_cuda.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -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()

Expand All @@ -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()

Expand All @@ -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()

Expand All @@ -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()

Expand Down

0 comments on commit df97e1a

Please sign in to comment.