Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
33 changes: 33 additions & 0 deletions dnn-providers/hip-kernel-provider/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,7 @@ option(HIPKERNELPROVIDER_ENABLE_TESTS "Build tests" ON)
option(HIPKERNELPROVIDER_ENABLE_ROCKE "Build rocKE engine and smoke tests" OFF)
option(ENABLE_ASM_SDPA_ENGINE "Build the ASM SDPA engine" ON)
option(ENABLE_HIP_MLOPS_ENGINE "Build the HIP kernel engine" ON)
option(ENABLE_ROCKE_CONV_ENGINE "Build the rocKE implicit-GEMM conv engine" OFF)

option(BUILD_ADDRESS_SANITIZER "Build with Address Sanitizer enabled" OFF)
option(ENABLE_CLANG_FORMAT "Enable Clang-Format checks" ON)
Expand Down Expand Up @@ -231,3 +232,35 @@ if(ENABLE_ASM_SDPA_ENGINE)
DESTINATION ${HIPDNN_RELATIVE_INSTALL_PLUGIN_ENGINE_DIR}/hip_kernel_provider/asm_kernels
FILES_MATCHING PATTERN "*.co")
endif()

if(ENABLE_ROCKE_CONV_ENGINE)
# Decompress .lgbm.gz model files and install alongside feature_spec.json.
# The plain .lgbm is not committed; gunzip once at install time.
set(_rocke_models_src
"${CMAKE_CURRENT_SOURCE_DIR}/rocke/platform/Python/rocke/heuristics/models")
set(_rocke_models_dst
"${HIPDNN_RELATIVE_INSTALL_PLUGIN_ENGINE_DIR}/hip_kernel_provider/rocke_models")
install(CODE "
file(GLOB _arch_dirs LIST_DIRECTORIES true \"${_rocke_models_src}/grouped_conv_forward_fp16_*\")
foreach(_src_dir \${_arch_dirs})
get_filename_component(_arch_name \${_src_dir} NAME)
set(_dst_dir \"\$ENV{DESTDIR}\${CMAKE_INSTALL_PREFIX}/${_rocke_models_dst}/\${_arch_name}\")
file(MAKE_DIRECTORY \"\${_dst_dir}\")
set(_gz \"\${_src_dir}/model_tflops.lgbm.gz\")
if(EXISTS \"\${_gz}\")
message(STATUS \"Decompressing \${_gz}\")
execute_process(
COMMAND gunzip -c \"\${_gz}\"
OUTPUT_FILE \"\${_dst_dir}/model_tflops.lgbm\"
RESULT_VARIABLE _ret)
if(NOT _ret EQUAL 0)
message(WARNING \"gunzip failed for \${_gz} (exit \${_ret})\")
endif()
endif()
set(_spec \"\${_src_dir}/feature_spec.json\")
if(EXISTS \"\${_spec}\")
file(COPY \"\${_spec}\" DESTINATION \"\${_dst_dir}\")
endif()
endforeach()
")
endif()
Original file line number Diff line number Diff line change
Expand Up @@ -149,6 +149,7 @@ set(ROCKE_PYTHON_INSTALL_DIR "${_ROCKE_DEFAULT_PYTHON_INSTALL_DIR}"
# pybind bindings under Cpp/bindings are a separate target and are excluded.
file(GLOB_RECURSE ROCKE_CORE_SOURCES CONFIGURE_DEPENDS "${CMAKE_CURRENT_SOURCE_DIR}/Cpp/*.cpp")
list(FILTER ROCKE_CORE_SOURCES EXCLUDE REGEX "/Cpp/bindings/")
list(FILTER ROCKE_CORE_SOURCES EXCLUDE REGEX "/Cpp/tools/")

add_library(rocke_core STATIC ${ROCKE_CORE_SOURCES})
target_include_directories(rocke_core PUBLIC
Expand Down Expand Up @@ -191,6 +192,11 @@ if(ROCKE_BUILD_PYBIND)
add_subdirectory(Cpp/bindings)
endif()

option(ROCKE_BUILD_CONV_SWEEP "Build the rocke_conv_sweep candidate sweep tool" OFF)
if(ROCKE_BUILD_CONV_SWEEP)
add_subdirectory(Cpp/tools/conv_sweep)
endif()

# --- Installable engine + test artifacts -------------------------------------
install(TARGETS rocke_core
EXPORT ckcTargets
Expand Down
Loading
Loading