Files
composable_kernel/experimental/builder
JH-Leon-KIM-AMD ae55803b39 [CK_BUILDER] ALMIOPEN-522: Testing-specific descriptor initialization
Remove old CK host descriptor helper dependency from CK Builder testing
framework and implement testing-owned descriptor computation.

Core changes (ALMIOPEN-522):
- Remove ck/library/utility/convolution_* includes from conv_fwd.hpp
- Add ConvFwdProblem struct (testing-owned conv parameter description)
- Add Args::make_conv_problem() (computes output spatial, no old CK dependency)
- Rewrite make_input/weight/output_descriptor() with testing-specific
  stride mapping for all supported layouts (GNHWC, NHWGC, etc.)
- Add optional explicit tensor-memory stride API (std::optional fields)
- Update conv_fwd_ck.hpp and conv_fwd_reference.hpp to use make_conv_problem()
- Remove to_ck_conv_param() method

Additional improvements:
- Add CK Tile forward EndToEnd support (conv_fwd_ck_tile.hpp + test)
- Proves shared Args/descriptor design works across backends
- Merge Create + EndToEnd tests into single file (matches old CK pattern)
- Fix unit_validation.cpp BF16 initialization for reliable testing

Results:
- Old CK warnings removed (no more RowMajor/ColumnMajor spam)
- All smoke tests pass (5/5)
- Old CK EndToEnd passes (XDL vs GPU reference)
- CK Tile EndToEnd passes (Tile vs GPU reference)

Note: This PR conflicts with #3518 (tile-builder-testing). Both touch
conv_fwd.hpp but with different approaches. This implementation directly
addresses ALMIOPEN-522 requirements by removing old CK dependency.
2026-01-15 09:52:57 +00:00
..

Builder

This directory contains the experimental builder feature for composable_kernel.

  • Status: In development (October - December 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.

Design descriptions

Directory Structure

  • include/ck_tile/builder/ Core builder headers and public API.
  • include/ck_tile/builder/reflect Reflection mechanism.
  • include/ck_tile/builder/factory Compile-time dispatch from builder descriptors to our exisitng specialized convolution kernel implementations.
  • 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:

cmake                                                                                             \
  -D CMAKE_PREFIX_PATH=/opt/rocm                                                                  \
  -D CMAKE_CXX_COMPILER=/opt/rocm/bin/hipcc                                                       \
  -D CMAKE_BUILD_TYPE=Release                                                                     \
  -D GPU_TARGETS="gfx942"                                                                         \
  -D CK_EXPERIMENTAL_BUILDER=ON                                                                   \
  -D CMAKE_CXX_STANDARD=20                                                                        \
  -G Ninja                                                                                        \
  ..

Note: The tests for WMMA builders are only built when CK_USE_WMMA is enabled. Add e.g. gfx1121 or any of the other gfx11/gfx12 architectures to the GPU targets. Alternatively, one can add flag -D CK_USE_WMMA=ON to build the tests. For the end-to-end tests that use the instances from builder, one needs an actual Navi card.

Building and Testing

The builder test suite is organized into two main categories:

Smoke Tests (Fast Unit Tests)

Quick unit tests that verify the builder's internal logic without compiling GPU kernels. These complete in under 1 second total and are suitable for frequent execution during development.

ninja smoke-builder

Regression Tests (Integration Tests)

Integration tests that compile actual GPU kernels to verify that the builder generates valid, compilable code. These are more expensive than smoke tests (can take minutes to compile) but cover more fuctionality. )

ninja regression-builder

Running All Tests

To build and run the complete test suite:

ninja check-builder

Building Individual Tests

To build and run a specific test:

ninja test_ckb_conv_builder && bin/test_ckb_conv_builder

Test Organization

  • Smoke tests: Fast feedback during active development
  • Regression tests: Thorough validation before submitting changes
  • Factory tests: Expensive tests that build all MIOpen kernels (included in regression tests)

When adding new tests, please follow the convention where the CMake build target starts with a prefix test_ckb. This allows filtering of CK Builder tests from the full CK repository test suite.