"docs_zh_CN/git@developer.sourcefind.cn:OpenDAS/mmcv.git" did not exist on "ef8ba75202693ea006d2b14c68581898326d2e03"
Commit 3818cb5e authored by illsilin's avatar illsilin
Browse files

Revert "Fix cmake dtype check (#989)"

This reverts commit ac0e0067.
parent ac0e0067
...@@ -11,27 +11,31 @@ function(add_example_executable EXAMPLE_NAME FILE_NAME) ...@@ -11,27 +11,31 @@ function(add_example_executable EXAMPLE_NAME FILE_NAME)
if(DEFINED DTYPES) if(DEFINED DTYPES)
foreach(source IN LISTS FILE_NAME) foreach(source IN LISTS FILE_NAME)
set(test 0) set(test 0)
if((source MATCHES "_fp16" OR source MATCHES "_f16") AND NOT "fp16" IN_LIST DTYPES) foreach(type IN LISTS DTYPES)
set(test 1) if(type MATCHES "fp16")
endif() set(type1 "_f16")
if((source MATCHES "_fp32" OR source MATCHES "_f32") AND NOT "fp32" IN_LIST DTYPES) elseif(type MATCHES "fp32")
set(test 1) set(type1 "_f32")
endif() elseif(type MATCHES "fp8")
if((source MATCHES "_fp64" OR source MATCHES "_f64") AND NOT "fp64" IN_LIST DTYPES) set(type1 "_f8")
set(test 1) elseif(type MATCHES "bf16")
endif() set(type1 "_b16")
if((source MATCHES "_fp8" OR source MATCHES "_f8") AND NOT "fp8" IN_LIST DTYPES) elseif(type MATCHES "fp64")
set(test 1) set(type1 "_f64")
endif() elseif(type MATCHES "int8")
if((source MATCHES "_bf8" OR source MATCHES "_bf8") AND NOT "bf8" IN_LIST DTYPES) set(type1 "_i8")
set(test 1) endif()
endif() if("${source}" MATCHES "${type}" OR "${source}" MATCHES "${type1}")
if((source MATCHES "_bf16" OR source MATCHES "_b16") AND NOT "bf16" IN_LIST DTYPES) #if filename matches any selected type, exit type loop and do no exclude the file from the list
set(test 1) set(test 0)
endif() break()
if((source MATCHES "_int8" OR source MATCHES "_i8") AND NOT "int8" IN_LIST DTYPES) elseif((source MATCHES "fp8" OR source MATCHES "fp32" OR source MATCHES "fp64" OR source MATCHES "bf16" OR source MATCHES "int8" OR source MATCHES "fp16" OR
set(test 1) source MATCHES "_f8" OR source MATCHES "_f32" OR source MATCHES "_f64" OR source MATCHES "_i8" OR source MATCHES "_f16" OR source MATCHES "_b16") AND
endif() NOT(source MATCHES type OR source MATCHES type1))
#if filename contains a type which doesn't match any selected type, mark it for removal
set(test 1)
endif()
endforeach()
if(test EQUAL 1) if(test EQUAL 1)
message("removing example source file ${source} ") message("removing example source file ${source} ")
list(REMOVE_ITEM FILE_NAME "${source}") list(REMOVE_ITEM FILE_NAME "${source}")
...@@ -70,27 +74,31 @@ function(add_example_executable_no_testing EXAMPLE_NAME FILE_NAME) ...@@ -70,27 +74,31 @@ function(add_example_executable_no_testing EXAMPLE_NAME FILE_NAME)
if(DEFINED DTYPES) if(DEFINED DTYPES)
foreach(source IN LISTS FILE_NAME) foreach(source IN LISTS FILE_NAME)
set(test 0) set(test 0)
if((source MATCHES "_fp16" OR source MATCHES "_f16") AND NOT "fp16" IN_LIST DTYPES) foreach(type IN LISTS DTYPES)
set(test 1) if(type MATCHES "fp16")
endif() set(type1 "_f16")
if((source MATCHES "_fp32" OR source MATCHES "_f32") AND NOT "fp32" IN_LIST DTYPES) elseif(type MATCHES "fp32")
set(test 1) set(type1 "_f32")
endif() elseif(type MATCHES "fp8")
if((source MATCHES "_fp64" OR source MATCHES "_f64") AND NOT "fp64" IN_LIST DTYPES) set(type1 "_f8")
set(test 1) elseif(type MATCHES "bf16")
endif() set(type1 "_b16")
if((source MATCHES "_fp8" OR source MATCHES "_f8") AND NOT "fp8" IN_LIST DTYPES) elseif(type MATCHES "fp64")
set(test 1) set(type1 "_f64")
endif() elseif(type MATCHES "int8")
if((source MATCHES "_bf8" OR source MATCHES "_bf8") AND NOT "bf8" IN_LIST DTYPES) set(type1 "_i8")
set(test 1) endif()
endif() if("${source}" MATCHES "${type}" OR "${source}" MATCHES "${type1}")
if((source MATCHES "_bf16" OR source MATCHES "_b16") AND NOT "bf16" IN_LIST DTYPES) #if filename matches any selected type, exit type loop and do no exclude the file from the list
set(test 1) set(test 0)
endif() break()
if((source MATCHES "_int8" OR source MATCHES "_i8") AND NOT "int8" IN_LIST DTYPES) elseif((source MATCHES "fp8" OR source MATCHES "fp32" OR source MATCHES "fp64" OR source MATCHES "bf16" OR source MATCHES "int8" OR source MATCHES "fp16" OR
set(test 1) source MATCHES "_f8" OR source MATCHES "_f32" OR source MATCHES "_f64" OR source MATCHES "_i8" OR source MATCHES "_f16" OR source MATCHES "_b16") AND
endif() NOT(source MATCHES type OR source MATCHES type1))
#if filename contains a type which doesn't match any selected type, mark it for removal
set(test 1)
endif()
endforeach()
if(test EQUAL 1) if(test EQUAL 1)
message("removing example ${source} ") message("removing example ${source} ")
list(REMOVE_ITEM FILE_NAME "${source}") list(REMOVE_ITEM FILE_NAME "${source}")
......
...@@ -69,10 +69,6 @@ FOREACH(subdir_path ${dir_list}) ...@@ -69,10 +69,6 @@ FOREACH(subdir_path ${dir_list})
message("fp8 instance found!") message("fp8 instance found!")
set(add_inst 1) set(add_inst 1)
endif() endif()
if(("${cmake_instance}" MATCHES "_bf8" OR "${cmake_instance}" MATCHES "_b8") AND DTYPES MATCHES "bf8")
message("bf8 instance found!")
set(add_inst 1)
endif()
if(("${cmake_instance}" MATCHES "_fp16" OR "${cmake_instance}" MATCHES "_f16") AND DTYPES MATCHES "fp16") if(("${cmake_instance}" MATCHES "_fp16" OR "${cmake_instance}" MATCHES "_f16") AND DTYPES MATCHES "fp16")
message("fp16 instance found!") message("fp16 instance found!")
set(add_inst 1) set(add_inst 1)
......
...@@ -4,7 +4,8 @@ set(GROUPED_CONV3D_BWD_WEIGHT ...@@ -4,7 +4,8 @@ set(GROUPED_CONV3D_BWD_WEIGHT
xdl/device_grouped_conv3d_bwd_weight_xdl_gndhwc_gkzyxc_gndhwk_bf16_instance.cpp xdl/device_grouped_conv3d_bwd_weight_xdl_gndhwc_gkzyxc_gndhwk_bf16_instance.cpp
xdl/device_grouped_conv3d_bwd_weight_xdl_ndhwgc_gkzyxc_ndhwgk_f16_instance.cpp xdl/device_grouped_conv3d_bwd_weight_xdl_ndhwgc_gkzyxc_ndhwgk_f16_instance.cpp
xdl/device_grouped_conv3d_bwd_weight_xdl_ndhwgc_gkzyxc_ndhwgk_f32_instance.cpp xdl/device_grouped_conv3d_bwd_weight_xdl_ndhwgc_gkzyxc_ndhwgk_f32_instance.cpp
xdl/device_grouped_conv3d_bwd_weight_xdl_ndhwgc_gkzyxc_ndhwgk_bf16_instance.cpp) xdl/device_grouped_conv3d_bwd_weight_xdl_ndhwgc_gkzyxc_ndhwgk_bf16_instance.cpp
xdl/device_grouped_conv3d_bwd_weight_xdl_ndhwgc_gkzyxc_ndhwgk_f16_comp_bf8_fp8_instance.cpp)
if(DL_KERNELS) if(DL_KERNELS)
list(APPEND GROUPED_CONV3D_BWD_WEIGHT list(APPEND GROUPED_CONV3D_BWD_WEIGHT
...@@ -26,9 +27,4 @@ list(APPEND GROUPED_CONV3D_BWD_WEIGHT ...@@ -26,9 +27,4 @@ list(APPEND GROUPED_CONV3D_BWD_WEIGHT
wmma/device_grouped_conv3d_bwd_weight_wmma_gndhwc_gkzyxc_gndhwk_i8_instance.cpp wmma/device_grouped_conv3d_bwd_weight_wmma_gndhwc_gkzyxc_gndhwk_i8_instance.cpp
wmma/device_grouped_conv3d_bwd_weight_wmma_ndhwgc_gkzyxc_ndhwgk_i8_instance.cpp) wmma/device_grouped_conv3d_bwd_weight_wmma_ndhwgc_gkzyxc_ndhwgk_i8_instance.cpp)
if((DTYPES MATCHES "fp8" AND DTYPES MATCHES "bf8" AND DTYPES MATCHES "fp16") OR NOT DEFINED DTYPES)
list(APPEND GROUPED_CONV3D_BWD_WEIGHT
xdl/device_grouped_conv3d_bwd_weight_xdl_ndhwgc_gkzyxc_ndhwgk_f16_comp_bf8_fp8_instance.cpp)
endif()
add_instance_library(device_grouped_conv3d_bwd_weight_instance ${GROUPED_CONV3D_BWD_WEIGHT}) add_instance_library(device_grouped_conv3d_bwd_weight_instance ${GROUPED_CONV3D_BWD_WEIGHT})
...@@ -13,27 +13,31 @@ function(add_test_executable TEST_NAME) ...@@ -13,27 +13,31 @@ function(add_test_executable TEST_NAME)
if(DEFINED DTYPES) if(DEFINED DTYPES)
foreach(source IN LISTS ARGN) foreach(source IN LISTS ARGN)
set(test 0) set(test 0)
if((source MATCHES "_fp16" OR source MATCHES "_f16") AND NOT "fp16" IN_LIST DTYPES) foreach(type IN LISTS DTYPES)
set(test 1) if(type MATCHES "fp16")
endif() set(type1 "_f16")
if((source MATCHES "_fp32" OR source MATCHES "_f32") AND NOT "fp32" IN_LIST DTYPES) elseif(type MATCHES "fp32")
set(test 1) set(type1 "_f32")
endif() elseif(type MATCHES "fp8")
if((source MATCHES "_fp64" OR source MATCHES "_f64") AND NOT "fp64" IN_LIST DTYPES) set(type1 "_f8")
set(test 1) elseif(type MATCHES "bf16")
endif() set(type1 "_b16")
if((source MATCHES "_fp8" OR source MATCHES "_f8") AND NOT "fp8" IN_LIST DTYPES) elseif(type MATCHES "fp64")
set(test 1) set(type1 "_f64")
endif() elseif(type MATCHES "int8")
if((source MATCHES "_bf8" OR source MATCHES "_bf8") AND NOT "bf8" IN_LIST DTYPES) set(type1 "_i8")
set(test 1) endif()
endif() if("${source}" MATCHES "${type}" OR "${source}" MATCHES "${type1}")
if((source MATCHES "_bf16" OR source MATCHES "_b16") AND NOT "bf16" IN_LIST DTYPES) #if filename matches any selected type, exit type loop and do no exclude the file from the list
set(test 1) set(test 0)
endif() break()
if((source MATCHES "_int8" OR source MATCHES "_i8") AND NOT "int8" IN_LIST DTYPES) elseif((source MATCHES "fp8" OR source MATCHES "fp32" OR source MATCHES "fp64" OR source MATCHES "bf16" OR source MATCHES "int8" OR source MATCHES "fp16" OR
set(test 1) source MATCHES "_f8" OR source MATCHES "_f32" OR source MATCHES "_f64" OR source MATCHES "_i8" OR source MATCHES "_f16" OR source MATCHES "_b16") AND
endif() NOT(source MATCHES type OR source MATCHES type1))
#if filename contains a type which doesn't match any selected type, mark it for removal
set(test 1)
endif()
endforeach()
if(test EQUAL 1) if(test EQUAL 1)
message("removing test ${source} ") message("removing test ${source} ")
list(REMOVE_ITEM ARGN "${source}") list(REMOVE_ITEM ARGN "${source}")
...@@ -68,27 +72,31 @@ function(add_gtest_executable TEST_NAME) ...@@ -68,27 +72,31 @@ function(add_gtest_executable TEST_NAME)
if(DEFINED DTYPES) if(DEFINED DTYPES)
foreach(source IN LISTS ARGN) foreach(source IN LISTS ARGN)
set(test 0) set(test 0)
if((source MATCHES "_fp16" OR source MATCHES "_f16") AND NOT "fp16" IN_LIST DTYPES) foreach(type IN LISTS DTYPES)
set(test 1) if(type MATCHES "fp16")
endif() set(type1 "_f16")
if((source MATCHES "_fp32" OR source MATCHES "_f32") AND NOT "fp32" IN_LIST DTYPES) elseif(type MATCHES "fp32")
set(test 1) set(type1 "_f32")
endif() elseif(type MATCHES "fp8")
if((source MATCHES "_fp64" OR source MATCHES "_f64") AND NOT "fp64" IN_LIST DTYPES) set(type1 "_f8")
set(test 1) elseif(type MATCHES "bf16")
endif() set(type1 "_b16")
if((source MATCHES "_fp8" OR source MATCHES "_f8") AND NOT "fp8" IN_LIST DTYPES) elseif(type MATCHES "fp64")
set(test 1) set(type1 "_f64")
endif() elseif(type MATCHES "int8")
if((source MATCHES "_bf8" OR source MATCHES "_bf8") AND NOT "bf8" IN_LIST DTYPES) set(type1 "_i8")
set(test 1) endif()
endif() if("${source}" MATCHES "${type}" OR "${source}" MATCHES "${type1}")
if((source MATCHES "_bf16" OR source MATCHES "_b16") AND NOT "bf16" IN_LIST DTYPES) #if filename matches any selected type, exit type loop and do no exclude the file from the list
set(test 1) set(test 0)
endif() break()
if((source MATCHES "_int8" OR source MATCHES "_i8") AND NOT "int8" IN_LIST DTYPES) elseif((source MATCHES "fp8" OR source MATCHES "fp32" OR source MATCHES "fp64" OR source MATCHES "bf16" OR source MATCHES "int8" OR source MATCHES "fp16" OR
set(test 1) source MATCHES "_f8" OR source MATCHES "_f32" OR source MATCHES "_f64" OR source MATCHES "_i8" OR source MATCHES "_f16" OR source MATCHES "_b16") AND
endif() NOT(source MATCHES type OR source MATCHES type1))
#if filename contains a type which doesn't match any selected type, mark it for removal
set(test 1)
endif()
endforeach()
if(test EQUAL 1) if(test EQUAL 1)
message("removing gtest ${source} ") message("removing gtest ${source} ")
list(REMOVE_ITEM ARGN "${source}") list(REMOVE_ITEM ARGN "${source}")
......
if (USE_BITINT_EXTENSION_INT4) if (USE_BITINT_EXTENSION_INT4)
add_gtest_executable(test_int4 test_int4.cpp) add_gtest_executable(test_int4 int4.cpp)
if(result EQUAL 0) if(result EQUAL 0)
target_link_libraries(test_int4 PRIVATE utility) target_link_libraries(test_int4 PRIVATE utility)
endif() endif()
endif() endif()
add_gtest_executable(test_fp8 test_fp8.cpp) add_gtest_executable(test_fp8 fp8.cpp)
if(result EQUAL 0) if(result EQUAL 0)
target_link_libraries(test_fp8 PRIVATE utility) target_link_libraries(test_fp8 PRIVATE utility)
endif() endif()
add_gtest_executable(test_bf8 test_bf8.cpp) add_gtest_executable(test_bf8 bf8.cpp)
if(result EQUAL 0) if(result EQUAL 0)
target_link_libraries(test_bf8 PRIVATE utility) target_link_libraries(test_bf8 PRIVATE utility)
endif() endif()
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment