composable_kernel icon indicating copy to clipboard operation
composable_kernel copied to clipboard

[CK_BUILDER] Fwd instance test improvements

Open vpietila-amd opened this issue 1 month ago • 0 comments

Proposed changes

Cleaned-up test code for the forward convolution instance creation tests for the CK Builder. Addressed some leftover comments from PR #3138. Main changes

  • Refactored tests such that they reflect better the builder pattern (cf. comments https://github.com/ROCm/composable_kernel/pull/3138#discussion_r2482778243 and https://github.com/ROCm/composable_kernel/pull/3138#discussion_r2482786428). This also reduced the amount of duplicated code.
  • Moved tests into anonymous namespace (cf. comment https://github.com/ROCm/composable_kernel/pull/3138#discussion_r2482780409).
  • The convolution factory had lot of if-else constructs when CK Builder types were converted into CK library types. I had initially trouble in using static_assert in the default branch of switch as the static_assert was evaluated at compile time even for valid types. However, if we change the static_assert to throw "<error message>", it will result in a compile-time error only if the default branch is actually hit. This assumes that the function is consteval. Hence, changed all conversions in the convolution factory to use switch, which is more intuitive (cf. comment https://github.com/ROCm/composable_kernel/pull/3138#discussion_r2482782459). Added also using statements to remove repeated namespace usages.

vpietila-amd avatar Nov 04 '25 11:11 vpietila-amd