Skip to content

Commit a586a1f

Browse files
[rocm-libraries] ROCm/rocm-libraries#6135 (commit 91f0518)
[CK][CK_Tile] Ensure CK Tile engine benchmarking targets are excluded from default build. (#6135) ## Motivation Ensuring that tile engine benchmarking does not build by default and slow other developers. ## Technical Details - Added EXCLUDE_FROM_ALL to all add_subdirectory calls in tile_engine/CMakeLists.txt and ops/gemm/CMakeLists.txt, so none of the tile engine ops targets are part of the default all build. - Added missing EXCLUDE_FROM_ALL to add_executable in ops/pooling/CMakeLists.txt and ops/reduce/CMakeLists.txt (the GEMM variants already had it). - Downgraded message(STATUS ...) to message(VERBOSE ...) (or DEBUG for per-target creation) in ops/pooling/, ops/gemm_streamk/, and ops/reduce/ CMakeLists. The other four GEMM variants (gemm_universal, gemm_multi_d, gemm_preshuffle, grouped_gemm) already used VERBOSE. - Targets can still be built on demand via their aggregate names (e.g. make benchmark_pooling_all, make benchmark_gemm_streamk_all). ## Test Plan Tile engine benchmark testing stage should be unaffected. ## Test Result N/A ## Submission Checklist - [x] Look over the contributing guidelines at https://github.com/ROCm/ROCm/blob/develop/CONTRIBUTING.md#pull-requests.
1 parent 3fb26ec commit a586a1f

5 files changed

Lines changed: 42 additions & 41 deletions

File tree

tile_engine/CMakeLists.txt

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,8 @@ include_directories(BEFORE
55
${CMAKE_CURRENT_LIST_DIR}/include
66
)
77

8-
add_subdirectory(ops/gemm)
9-
add_subdirectory(ops/gemm_streamk)
10-
add_subdirectory(ops/pooling)
11-
add_subdirectory(ops/reduce)
8+
add_subdirectory(ops/gemm EXCLUDE_FROM_ALL)
9+
add_subdirectory(ops/gemm_streamk EXCLUDE_FROM_ALL)
10+
add_subdirectory(ops/pooling EXCLUDE_FROM_ALL)
11+
add_subdirectory(ops/reduce EXCLUDE_FROM_ALL)
1212

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
# Copyright (c) Advanced Micro Devices, Inc., or its affiliates.
22
# SPDX-License-Identifier: MIT
33

4-
add_subdirectory(gemm_universal)
5-
add_subdirectory(gemm_multi_d)
6-
add_subdirectory(gemm_preshuffle)
7-
add_subdirectory(grouped_gemm)
4+
add_subdirectory(gemm_universal EXCLUDE_FROM_ALL)
5+
add_subdirectory(gemm_multi_d EXCLUDE_FROM_ALL)
6+
add_subdirectory(gemm_preshuffle EXCLUDE_FROM_ALL)
7+
add_subdirectory(grouped_gemm EXCLUDE_FROM_ALL)

tile_engine/ops/gemm_streamk/CMakeLists.txt

Lines changed: 18 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -124,15 +124,15 @@ function(build_individual_gemm_targets datatype layout)
124124
if(DEFINED ENV{GEMM_STREAMK_CONFIG_FILE} AND NOT "$ENV{GEMM_STREAMK_CONFIG_FILE}" STREQUAL "")
125125
set(config_filename "$ENV{GEMM_STREAMK_CONFIG_FILE}")
126126
set(json_blob "${CMAKE_CURRENT_LIST_DIR}/configs/${config_filename}")
127-
message(STATUS " Using config from environment variable: ${config_filename}")
127+
message(VERBOSE " Using config from environment variable: ${config_filename}")
128128
elseif(NOT "${GEMM_STREAMK_CONFIG_FILE}" STREQUAL "")
129129
# Use CMake variable if set
130130
set(json_blob "${CMAKE_CURRENT_LIST_DIR}/configs/${GEMM_STREAMK_CONFIG_FILE}")
131-
message(STATUS " Using custom config: ${GEMM_STREAMK_CONFIG_FILE}")
131+
message(VERBOSE " Using custom config: ${GEMM_STREAMK_CONFIG_FILE}")
132132
else()
133133
# Use default config for all layouts
134134
set(json_blob "${CMAKE_CURRENT_LIST_DIR}/configs/default_config.json")
135-
message(STATUS " Using default config for layout ${layout}")
135+
message(VERBOSE " Using default config for layout ${layout}")
136136
endif()
137137

138138
# Check if config file exists
@@ -153,17 +153,17 @@ function(build_individual_gemm_targets datatype layout)
153153
endif()
154154

155155
# Generate individual kernel files using parallel version
156-
message(STATUS "Generating individual kernels for ${datatype} ${layout} using ${num_workers} workers...")
157-
message(STATUS " Working path: ${working_path}")
158-
message(STATUS " Config file: ${json_blob}")
159-
message(STATUS " Python executable: ${Python3_EXECUTABLE}")
160-
message(STATUS " Script path: ${CMAKE_CURRENT_LIST_DIR}/gemm_streamk_instance_builder.py")
156+
message(VERBOSE "Generating individual kernels for ${datatype} ${layout} using ${num_workers} workers...")
157+
message(VERBOSE " Working path: ${working_path}")
158+
message(VERBOSE " Config file: ${json_blob}")
159+
message(VERBOSE " Python executable: ${Python3_EXECUTABLE}")
160+
message(VERBOSE " Script path: ${CMAKE_CURRENT_LIST_DIR}/gemm_streamk_instance_builder.py")
161161

162162
# Create working directory first
163163
file(MAKE_DIRECTORY ${working_path})
164164

165165
# First, just list the kernels (fast operation)
166-
message(STATUS " Listing kernel configurations...")
166+
message(VERBOSE " Listing kernel configurations...")
167167
execute_process(
168168
COMMAND ${Python3_EXECUTABLE} -u ${CMAKE_CURRENT_LIST_DIR}/gemm_streamk_instance_builder.py
169169
--working_path ${working_path}
@@ -185,7 +185,7 @@ function(build_individual_gemm_targets datatype layout)
185185
if(EXISTS ${working_path}/gemm_kernel_count.txt)
186186
file(READ ${working_path}/gemm_kernel_count.txt kernel_count)
187187
string(STRIP "${kernel_count}" kernel_count)
188-
message(STATUS " Found ${kernel_count} kernel configurations")
188+
message(VERBOSE " Found ${kernel_count} kernel configurations")
189189
else()
190190
message(FATAL_ERROR "Kernel count file not found")
191191
endif()
@@ -209,10 +209,10 @@ function(build_individual_gemm_targets datatype layout)
209209
endfunction()
210210

211211
# Main build logic - Only individual builds supported
212-
message(STATUS "=== Starting Tile Engine StreamK GEMM Configuration ===")
213-
message(STATUS "GEMM_STREAMK_DATATYPE: ${GEMM_STREAMK_DATATYPE}")
214-
message(STATUS "GEMM_STREAMK_LAYOUT: ${GEMM_STREAMK_LAYOUT}")
215-
message(STATUS "SUPPORTED_GPU_TARGETS: ${SUPPORTED_GPU_TARGETS}")
212+
message(VERBOSE "=== Starting Tile Engine StreamK GEMM Configuration ===")
213+
message(VERBOSE "GEMM_STREAMK_DATATYPE: ${GEMM_STREAMK_DATATYPE}")
214+
message(VERBOSE "GEMM_STREAMK_LAYOUT: ${GEMM_STREAMK_LAYOUT}")
215+
message(VERBOSE "SUPPORTED_GPU_TARGETS: ${SUPPORTED_GPU_TARGETS}")
216216

217217
# Filter GPU targets to only gfx90a, gfx942
218218
set(GEMM_GPU_TARGETS_INDIVIDUAL "")
@@ -221,15 +221,15 @@ set(DESIRED_TARGETS "gfx90a;gfx942") # TODO: Add gfx950 when supported
221221
foreach(target IN LISTS SUPPORTED_GPU_TARGETS)
222222
if(target IN_LIST DESIRED_TARGETS)
223223
list(APPEND GEMM_GPU_TARGETS_INDIVIDUAL ${target})
224-
message(STATUS " Adding GPU target: ${target}")
224+
message(VERBOSE " Adding GPU target: ${target}")
225225
endif()
226226
endforeach()
227227

228228
# Skip build if no matching targets found
229229
if(NOT GEMM_GPU_TARGETS_INDIVIDUAL)
230230
message(WARNING "Skipping Tile Engine GEMM build: No supported GPU targets (gfx90a, gfx942) found in SUPPORTED_GPU_TARGETS: ${SUPPORTED_GPU_TARGETS}")
231231
else()
232-
message(STATUS "Building individual GEMM targets for GPU targets: ${GEMM_GPU_TARGETS_INDIVIDUAL}")
232+
message(VERBOSE "Building individual GEMM targets for GPU targets: ${GEMM_GPU_TARGETS_INDIVIDUAL}")
233233

234234
# Enable parallel compilation optimizations
235235
# Set up job pools for better parallel compilation control
@@ -244,12 +244,12 @@ else()
244244
find_program(CCACHE_PROGRAM ccache)
245245
if(CCACHE_PROGRAM)
246246
set(CMAKE_CXX_COMPILER_LAUNCHER ${CCACHE_PROGRAM})
247-
message(STATUS "Using ccache for faster compilation")
247+
message(VERBOSE "Using ccache for faster compilation")
248248
else()
249249
message(WARNING "ccache requested but not found")
250250
endif()
251251
else()
252-
message(STATUS "ccache disabled for GEMM ops (use -DENABLE_CCACHE_GEMM=ON to enable)")
252+
message(VERBOSE "ccache disabled for GEMM ops (use -DENABLE_CCACHE_GEMM=ON to enable)")
253253
endif()
254254

255255
# Create master collection targets

tile_engine/ops/pooling/CMakeLists.txt

Lines changed: 13 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -55,6 +55,7 @@ function(create_individual_pool_target datatype kernel_name trait tile_config co
5555

5656
# Create the executable
5757
add_executable(${target_name}
58+
EXCLUDE_FROM_ALL
5859
${target_source}
5960
${instance_header}
6061
)
@@ -90,7 +91,7 @@ function(create_individual_pool_target datatype kernel_name trait tile_config co
9091
add_dependencies(benchmark_pooling_all ${target_name})
9192
add_dependencies(benchmark_pooling_${datatype} ${target_name})
9293

93-
message(STATUS " Created pooling benchmark target: ${target_name}")
94+
message(DEBUG " Created pooling benchmark target: ${target_name}")
9495
endfunction()
9596

9697
# ============================================================================
@@ -105,13 +106,13 @@ function(build_individual_pool_targets datatype)
105106
if(DEFINED ENV{POOLING_CONFIG_FILE} AND NOT "$ENV{POOLING_CONFIG_FILE}" STREQUAL "")
106107
set(config_filename "$ENV{POOLING_CONFIG_FILE}")
107108
set(json_blob "${CMAKE_CURRENT_LIST_DIR}/configs/${config_filename}")
108-
message(STATUS " Using config from environment variable: ${config_filename}")
109+
message(VERBOSE " Using config from environment variable: ${config_filename}")
109110
elseif(NOT "${POOLING_CONFIG_FILE}" STREQUAL "")
110111
set(json_blob "${CMAKE_CURRENT_LIST_DIR}/configs/${POOLING_CONFIG_FILE}")
111-
message(STATUS " Using custom config: ${POOLING_CONFIG_FILE}")
112+
message(VERBOSE " Using custom config: ${POOLING_CONFIG_FILE}")
112113
else()
113114
set(json_blob "${CMAKE_CURRENT_LIST_DIR}/configs/default_config.json")
114-
message(STATUS " Using default config for pooling")
115+
message(VERBOSE " Using default config for pooling")
115116
endif()
116117

117118
if(NOT EXISTS ${json_blob})
@@ -121,7 +122,7 @@ function(build_individual_pool_targets datatype)
121122
file(MAKE_DIRECTORY ${working_path})
122123

123124
# Step 1: List kernels
124-
message(STATUS " Listing pooling kernel configurations for ${datatype}...")
125+
message(VERBOSE " Listing pooling kernel configurations for ${datatype}...")
125126
execute_process(
126127
COMMAND ${Python3_EXECUTABLE} -u ${CMAKE_CURRENT_LIST_DIR}/pooling_instance_builder.py
127128
--working_path ${working_path}
@@ -142,7 +143,7 @@ function(build_individual_pool_targets datatype)
142143
if(EXISTS ${working_path}/pool_kernel_count.txt)
143144
file(READ ${working_path}/pool_kernel_count.txt kernel_count)
144145
string(STRIP "${kernel_count}" kernel_count)
145-
message(STATUS " Found ${kernel_count} pooling kernel configurations")
146+
message(VERBOSE " Found ${kernel_count} pooling kernel configurations")
146147
else()
147148
message(FATAL_ERROR "Pooling kernel count file not found")
148149
endif()
@@ -169,9 +170,9 @@ endfunction()
169170
# MAIN EXECUTION
170171
# ============================================================================
171172

172-
message(STATUS "=== Starting Tile Engine Pooling Configuration ===")
173-
message(STATUS "POOLING_DATATYPE: ${POOLING_DATATYPE}")
174-
message(STATUS "SUPPORTED_GPU_TARGETS: ${SUPPORTED_GPU_TARGETS}")
173+
message(VERBOSE "=== Starting Tile Engine Pooling Configuration ===")
174+
message(VERBOSE "POOLING_DATATYPE: ${POOLING_DATATYPE}")
175+
message(VERBOSE "SUPPORTED_GPU_TARGETS: ${SUPPORTED_GPU_TARGETS}")
175176

176177
# Filter GPU targets
177178
set(POOLING_GPU_TARGETS "")
@@ -180,21 +181,21 @@ set(DESIRED_TARGETS "gfx90a;gfx942;gfx950;gfx1201")
180181
foreach(target IN LISTS SUPPORTED_GPU_TARGETS)
181182
if(target IN_LIST DESIRED_TARGETS)
182183
list(APPEND POOLING_GPU_TARGETS ${target})
183-
message(STATUS " Adding GPU target for pooling: ${target}")
184+
message(VERBOSE " Adding GPU target for pooling: ${target}")
184185
endif()
185186
endforeach()
186187

187188
if(NOT POOLING_GPU_TARGETS)
188189
message(WARNING "Skipping Tile Engine Pooling build: No supported GPU targets (gfx90a, gfx942, gfx950, gfx1201) found in SUPPORTED_GPU_TARGETS: ${SUPPORTED_GPU_TARGETS}")
189190
else()
190-
message(STATUS "Building pooling targets for GPU targets: ${POOLING_GPU_TARGETS}")
191+
message(VERBOSE "Building pooling targets for GPU targets: ${POOLING_GPU_TARGETS}")
191192

192193
# Enable ccache if requested
193194
if(ENABLE_CCACHE_POOLING)
194195
find_program(CCACHE_PROGRAM ccache)
195196
if(CCACHE_PROGRAM)
196197
set(CMAKE_CXX_COMPILER_LAUNCHER ${CCACHE_PROGRAM})
197-
message(STATUS "Using ccache for pooling compilation")
198+
message(VERBOSE "Using ccache for pooling compilation")
198199
endif()
199200
endif()
200201

tile_engine/ops/reduce/CMakeLists.txt

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ function(build_multi_reduce_for_datatype datatype variant)
2626
return()
2727
endif()
2828

29-
message(STATUS "Building Reduction for GPU targets: ${GPU_TARGETS}")
29+
message(VERBOSE "Building Reduction for GPU targets: ${GPU_TARGETS}")
3030

3131
set(working_path "${CMAKE_CURRENT_BINARY_DIR}/${datatype}/${variant}")
3232
file(MAKE_DIRECTORY "${working_path}")
@@ -75,7 +75,7 @@ function(build_multi_reduce_for_datatype datatype variant)
7575
message(FATAL_ERROR "Failed to generate kernels for ${datatype} ${variant}: ${ret}")
7676
endif()
7777

78-
message(STATUS "Generated ${datatype} ${variant} reduction kernel blobs at: ${working_path}")
78+
message(VERBOSE "Generated ${datatype} ${variant} reduction kernel blobs at: ${working_path}")
7979

8080
# # Add test executables for each generated test
8181
file(STRINGS "${working_path}/reduce_${variant}_blobs_list.txt" test_basenames)
@@ -85,7 +85,7 @@ function(build_multi_reduce_for_datatype datatype variant)
8585
set(test_src "${working_path}/${test_base}.cpp")
8686
set(test_target "${test_base}")
8787

88-
add_executable(${test_target} ${test_src})
88+
add_executable(${test_target} EXCLUDE_FROM_ALL ${test_src})
8989
target_include_directories(${test_target} PRIVATE
9090
"${CMAKE_SOURCE_DIR}/test/ck_tile/reduce/"
9191
${working_path}

0 commit comments

Comments
 (0)