Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
gaoqiong
composable_kernel
Commits
59954f5a
Commit
59954f5a
authored
Aug 30, 2023
by
Rostyslav Geyyer
Browse files
Add bf8 cmake bindings
parent
8c4897d1
Changes
4
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
31 additions
and
7 deletions
+31
-7
CMakeLists.txt
CMakeLists.txt
+12
-1
example/01_gemm/CMakeLists.txt
example/01_gemm/CMakeLists.txt
+4
-2
include/ck/config.h.in
include/ck/config.h.in
+7
-0
test/data_type/CMakeLists.txt
test/data_type/CMakeLists.txt
+8
-4
No files found.
CMakeLists.txt
View file @
59954f5a
...
@@ -15,6 +15,12 @@ if (DTYPES)
...
@@ -15,6 +15,12 @@ if (DTYPES)
if
(
DTYPES MATCHES
"fp8"
)
if
(
DTYPES MATCHES
"fp8"
)
add_definitions
(
-DCK_ENABLE_FP8
)
add_definitions
(
-DCK_ENABLE_FP8
)
set
(
CK_ENABLE_FP8
"ON"
)
set
(
CK_ENABLE_FP8
"ON"
)
add_compile_options
(
-Wno-bit-int-extension
)
endif
()
if
(
DTYPES MATCHES
"bf8"
)
add_definitions
(
-DCK_ENABLE_BF8
)
set
(
CK_ENABLE_BF8
"ON"
)
add_compile_options
(
-Wno-bit-int-extension
)
endif
()
endif
()
if
(
DTYPES MATCHES
"fp16"
)
if
(
DTYPES MATCHES
"fp16"
)
add_definitions
(
-DCK_ENABLE_FP16
)
add_definitions
(
-DCK_ENABLE_FP16
)
...
@@ -34,8 +40,9 @@ if (DTYPES)
...
@@ -34,8 +40,9 @@ if (DTYPES)
endif
()
endif
()
message
(
"DTYPES macro set to
${
DTYPES
}
"
)
message
(
"DTYPES macro set to
${
DTYPES
}
"
)
else
()
else
()
add_definitions
(
-DCK_ENABLE_INT8 -DCK_ENABLE_FP8 -DCK_ENABLE_FP16 -DCK_ENABLE_FP32 -DCK_ENABLE_FP64 -DCK_ENABLE_BF16
)
add_definitions
(
-DCK_ENABLE_INT8 -DCK_ENABLE_FP8
-DCK_ENABLE_BF8
-DCK_ENABLE_FP16 -DCK_ENABLE_FP32 -DCK_ENABLE_FP64 -DCK_ENABLE_BF16
)
set
(
CK_ENABLE_ALL_DTYPES
"ON"
)
set
(
CK_ENABLE_ALL_DTYPES
"ON"
)
add_compile_options
(
-Wno-bit-int-extension
)
# enable fp8 and bf8
endif
()
endif
()
if
(
DL_KERNELS
)
if
(
DL_KERNELS
)
...
@@ -365,6 +372,10 @@ IF(IS_DIRECTORY "${PROJECT_SOURCE_DIR}/library/src/tensor_operation_instance/gpu
...
@@ -365,6 +372,10 @@ IF(IS_DIRECTORY "${PROJECT_SOURCE_DIR}/library/src/tensor_operation_instance/gpu
#message("fp8 instance found!")
#message("fp8 instance found!")
set
(
add_inst 1
)
set
(
add_inst 1
)
endif
()
endif
()
if
(
"
${
cmake_instance
}
"
MATCHES
"DTYPES MATCHES
\"
bf8
\"
"
AND DTYPES MATCHES
"bf8"
)
#message("bf8 instance found!")
set
(
add_inst 1
)
endif
()
if
(
"
${
cmake_instance
}
"
MATCHES
"DTYPES MATCHES
\"
fp16
\"
"
AND DTYPES MATCHES
"fp16"
)
if
(
"
${
cmake_instance
}
"
MATCHES
"DTYPES MATCHES
\"
fp16
\"
"
AND DTYPES MATCHES
"fp16"
)
#message("fp16 instance found!")
#message("fp16 instance found!")
set
(
add_inst 1
)
set
(
add_inst 1
)
...
...
example/01_gemm/CMakeLists.txt
View file @
59954f5a
...
@@ -70,5 +70,7 @@ if(DTYPES MATCHES "fp8" OR NOT DEFINED DTYPES)
...
@@ -70,5 +70,7 @@ if(DTYPES MATCHES "fp8" OR NOT DEFINED DTYPES)
endif
()
endif
()
endif
()
endif
()
add_example_executable
(
example_gemm_xdl_fp16_f8 gemm_xdl_fp16_f8.cpp
)
if
(
DTYPES MATCHES
"fp8"
OR DTYPES MATCHES
"fp16"
OR NOT DEFINED DTYPES
)
add_dependencies
(
example_gemm_xdl example_gemm_xdl_fp16_f8
)
add_example_executable
(
example_gemm_xdl_fp16_f8 gemm_xdl_fp16_f8.cpp
)
add_dependencies
(
example_gemm_xdl example_gemm_xdl_fp16_f8
)
endif
()
include/ck/config.h.in
View file @
59954f5a
...
@@ -43,6 +43,9 @@
...
@@ -43,6 +43,9 @@
#ifndef CK_ENABLE_FP8
#ifndef CK_ENABLE_FP8
#define CK_ENABLE_FP8 "ON"
#define CK_ENABLE_FP8 "ON"
#endif
#endif
#ifndef CK_ENABLE_BF8
#define CK_ENABLE_BF8 "ON"
#endif
#ifndef CK_ENABLE_FP16
#ifndef CK_ENABLE_FP16
#define CK_ENABLE_FP16 "ON"
#define CK_ENABLE_FP16 "ON"
#endif
#endif
...
@@ -66,6 +69,10 @@
...
@@ -66,6 +69,10 @@
#cmakedefine CK_ENABLE_FP8 @CK_ENABLE_FP8@
#cmakedefine CK_ENABLE_FP8 @CK_ENABLE_FP8@
#endif
#endif
#ifndef CK_ENABLE_BF8
#cmakedefine CK_ENABLE_BF8 @CK_ENABLE_BF8@
#endif
#ifndef CK_ENABLE_FP16
#ifndef CK_ENABLE_FP16
#cmakedefine CK_ENABLE_FP16 @CK_ENABLE_FP16@
#cmakedefine CK_ENABLE_FP16 @CK_ENABLE_FP16@
#endif
#endif
...
...
test/data_type/CMakeLists.txt
View file @
59954f5a
...
@@ -3,8 +3,12 @@ if (USE_BITINT_EXTENSION_INT4)
...
@@ -3,8 +3,12 @@ if (USE_BITINT_EXTENSION_INT4)
target_link_libraries
(
test_int4 PRIVATE utility
)
target_link_libraries
(
test_int4 PRIVATE utility
)
endif
()
endif
()
add_gtest_executable
(
test_f8 f8.cpp
)
if
(
DTYPES MATCHES
"fp8"
OR NOT DEFINED DTYPES
)
target_link_libraries
(
test_f8 PRIVATE utility
)
add_gtest_executable
(
test_f8 f8.cpp
)
target_link_libraries
(
test_f8 PRIVATE utility
)
endif
()
add_gtest_executable
(
test_bf8 bf8.cpp
)
if
(
DTYPES MATCHES
"bf8"
OR NOT DEFINED DTYPES
)
target_link_libraries
(
test_bf8 PRIVATE utility
)
add_gtest_executable
(
test_bf8 bf8.cpp
)
target_link_libraries
(
test_bf8 PRIVATE utility
)
endif
()
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment