mirror of
https://github.com/ROCm/composable_kernel.git
synced 2026-05-14 02:02:46 +00:00
[CK_BUILDER] Add experimental builder directory and configuration for composable_kernel (#3043)
Add experimental builder infrastructure for composable_kernel
- Add experimental/builder directory with README documentation.
- Create initial test infrastructure with CMakeLists.txt and placeholder test.
- Update root CMakeLists.txt to support CK_EXPERIMENTAL_BUILDER option.
- Update .gitignore to not treat `experimental/builder` as a CMake build directory.
This establishes the directory structure for a high-level builder pattern that will provide a semantically-clear interface for constructing CK operations, with initial focus on convolution kernels for MIOpen integration.
[ROCm/composable_kernel commit: f18b79f328]
This commit is contained in:
8
.gitignore
vendored
8
.gitignore
vendored
@@ -36,7 +36,7 @@ tags
|
||||
# Editors
|
||||
.vscode
|
||||
|
||||
# build-in-source directory
|
||||
# build-in-source directory (see exceptions below)
|
||||
build*
|
||||
|
||||
# emacs temporary/backup files
|
||||
@@ -58,7 +58,7 @@ _doxygen/
|
||||
docs/doxygen/html
|
||||
docs/doxygen/xml
|
||||
|
||||
# JetBrains IDE
|
||||
# JetBrains IDE (see build* exceptions below)
|
||||
.idea/
|
||||
cmake-build*/
|
||||
build*/
|
||||
@@ -71,3 +71,7 @@ __pycache__/
|
||||
|
||||
.cache/
|
||||
|
||||
# Exceptions to build* patterns above
|
||||
# The experimental/builder directory should be tracked despite matching build*
|
||||
!experimental/builder
|
||||
!experimental/builder/**
|
||||
|
||||
@@ -37,6 +37,7 @@ include(CTest)
|
||||
|
||||
option(ENABLE_CLANG_CPP_CHECKS "Enables clang tidy, cppcheck" ON)
|
||||
option(MIOPEN_REQ_LIBS_ONLY "Build only the MIOpen required libraries" OFF)
|
||||
option(CK_EXPERIMENTAL_BUILDER "Enable experimental builder" OFF)
|
||||
option(BUILD_MHA_LIB "Build the static library for flash attention" OFF)
|
||||
|
||||
# Usage: for customized Python location cmake -DCK_USE_ALTERNATIVE_PYTHON="/opt/Python-3.8.13/bin/python3.8"
|
||||
@@ -692,6 +693,10 @@ if (NOT MIOPEN_REQ_LIBS_ONLY)
|
||||
add_subdirectory(profiler)
|
||||
endif()
|
||||
|
||||
if (CK_EXPERIMENTAL_BUILDER)
|
||||
add_subdirectory(experimental/builder)
|
||||
endif()
|
||||
|
||||
if(CK_USE_CODEGEN AND (SUPPORTED_GPU_TARGETS MATCHES "gfx9" OR GPU_ARCHS))
|
||||
add_subdirectory(codegen)
|
||||
endif()
|
||||
|
||||
@@ -1,3 +1,4 @@
|
||||
include_guard(GLOBAL)
|
||||
include(FetchContent)
|
||||
|
||||
set(GOOGLETEST_DIR "" CACHE STRING "Location of local GoogleTest repo to build against")
|
||||
|
||||
3
experimental/builder/CMakeLists.txt
Normal file
3
experimental/builder/CMakeLists.txt
Normal file
@@ -0,0 +1,3 @@
|
||||
if(BUILD_TESTING)
|
||||
add_subdirectory(test)
|
||||
endif()
|
||||
34
experimental/builder/README.md
Normal file
34
experimental/builder/README.md
Normal file
@@ -0,0 +1,34 @@
|
||||
# Builder
|
||||
|
||||
This directory contains the experimental builder feature for composable_kernel.
|
||||
|
||||
* Status: In development (October - November 2025)
|
||||
|
||||
## Overview
|
||||
|
||||
The builder provides a high-level, semantically-clear interface for constructing composable kernel operations, with an initial focus on convolution kernels for MIOpen. It leverages modern C++20 features (such as POD structs as non-type template parameters, concepts, and designated initializers) to simplify kernel instantiation and improve developer experience.
|
||||
|
||||
This project is a prototype for a more general builder pattern for all of composable_kernel (CK) and CKTile, but is currently limited to formalizing the interface between MIOpen and CK.
|
||||
|
||||
## Directory Structure
|
||||
|
||||
- `include/ck_tile/builder/`
|
||||
Core builder headers and public API.
|
||||
- `test/`
|
||||
Unit tests and example usage of the builder pattern.
|
||||
- `CMakeLists.txt`
|
||||
CMake configuration for building the experimental builder and its tests.
|
||||
|
||||
## CMake Configuration
|
||||
|
||||
To enable the experimental builder, configure your build with:
|
||||
|
||||
```sh
|
||||
cmake -DCK_EXPERIMENTAL_BUILDER=ON -DCMAKE_CXX_STANDARD=20 ...
|
||||
```
|
||||
## Building and testing
|
||||
|
||||
During development, build and test from the CK build directory with
|
||||
```sh
|
||||
ninja test_conv_builder && bin/test_conv_builder
|
||||
```
|
||||
@@ -0,0 +1 @@
|
||||
# Empty placeholder until we add library code.
|
||||
20
experimental/builder/test/CMakeLists.txt
Normal file
20
experimental/builder/test/CMakeLists.txt
Normal file
@@ -0,0 +1,20 @@
|
||||
|
||||
include(gtest)
|
||||
|
||||
# Helper function to create a gtest executable with common properties
|
||||
function(add_ck_builder_test test_name)
|
||||
add_executable(${test_name} ${ARGN})
|
||||
target_compile_features(${test_name} PRIVATE cxx_std_20)
|
||||
target_include_directories(${test_name} PRIVATE
|
||||
"${PROJECT_SOURCE_DIR}/experimental/builder/include"
|
||||
"${PROJECT_SOURCE_DIR}/include"
|
||||
)
|
||||
target_compile_options(${test_name} PRIVATE
|
||||
-Wno-global-constructors
|
||||
-Wno-c++20-compat
|
||||
)
|
||||
target_link_libraries(${test_name} PRIVATE GTest::gtest_main GTest::gmock)
|
||||
endfunction()
|
||||
|
||||
add_ck_builder_test(test_conv_builder
|
||||
test_conv_builder.cpp)
|
||||
11
experimental/builder/test/test_conv_builder.cpp
Normal file
11
experimental/builder/test/test_conv_builder.cpp
Normal file
@@ -0,0 +1,11 @@
|
||||
#include <gtest/gtest.h>
|
||||
|
||||
class ConvBuilderTest : public ::testing::Test
|
||||
{
|
||||
};
|
||||
|
||||
TEST_F(ConvBuilderTest, PlaceholderTest)
|
||||
{
|
||||
// TODO: Implement actual test
|
||||
EXPECT_TRUE(true);
|
||||
}
|
||||
Reference in New Issue
Block a user