From e76f294f857717552542a668b316f44d2b986896 Mon Sep 17 00:00:00 2001 From: Anton Gorenko Date: Sat, 13 Sep 2025 01:44:25 +0600 Subject: [PATCH] [CK_TILE] FMHA Reduce build time by disabling instances that are not tested (#2834) * Use lse = false for PagedKV tests There are no instances with lse = true so splitkv is actually launched as a fallback. * Reduce build time by disabling instances that are not tested [ROCm/composable_kernel commit: 847834a408dbbe56092f4d5ba8a548dfcf1a8e97] --- example/ck_tile/01_fmha/CMakeLists.txt | 11 ++++++++++- test/ck_tile/fmha/test_fmha_fwd.inc | 2 +- 2 files changed, 11 insertions(+), 2 deletions(-) diff --git a/example/ck_tile/01_fmha/CMakeLists.txt b/example/ck_tile/01_fmha/CMakeLists.txt index b1e2373657..68db468a7c 100644 --- a/example/ck_tile/01_fmha/CMakeLists.txt +++ b/example/ck_tile/01_fmha/CMakeLists.txt @@ -26,7 +26,7 @@ endforeach() # "fwd" is a must-have api for the fmha_fwd example, add it if not specified if(NOT "fwd" IN_LIST FMHA_FWD_ENABLE_APIS) - list(APPEND FMHA_FWD_ENABLE_APIS "fwd") + list(PREPEND FMHA_FWD_ENABLE_APIS "fwd") endif() file(GLOB_RECURSE CODE_GEN_SCRIPTS CONFIGURE_DEPENDS @@ -51,6 +51,15 @@ set(FMHA_BWD_CODE_GEN_COMMON_ARGS # --filter fmha_bwd_dot...@fmha_bwd_convert...@fmha_bwd... ) +# Reduce building time by disabling instances that are not currently used in the gtests +# TODO: Consider to use a special receipt for testing only, or even two receipts: a small subset of +# instances for quick CI runs and a larger subset for scheduled runs (the tests skip tests when +# there is no corresponding instance for parameters). +if(BUILD_TESTING) + # Filters are in the order of FMHA_FWD_KNOWN_APIS: fwd,fwd_splitkv_combine@fwd_splitkv,fwd_appendkv,pagedkv_prefill + list(APPEND FMHA_FWD_CODE_GEN_COMMON_ARGS --filter *_nlogits*_nskip*,*@*_nlogits*_nbias*,*,*_nlogits*_nskip*_pagedkv) +endif() + # generate a list of kernels, but not actually emit files at config sta execute_process( COMMAND ${Python3_EXECUTABLE} ${FMHA_FWD_CODE_GEN_COMMON_ARGS} diff --git a/test/ck_tile/fmha/test_fmha_fwd.inc b/test/ck_tile/fmha/test_fmha_fwd.inc index 9ff5b442b4..f02ef1e55e 100644 --- a/test/ck_tile/fmha/test_fmha_fwd.inc +++ b/test/ck_tile/fmha/test_fmha_fwd.inc @@ -401,7 +401,7 @@ TEST_P(PagedKV, Test) 0, // scale_s 0, // logits_soft_cap is_v_rowmajor, // is_v_rowmajor - def_lse, // lse + false, // lse page_block_size, // page_block_size false, // use_cache_batch_idx "n", // bias_str