mirror of
https://github.com/ROCm/composable_kernel.git
synced 2026-05-01 12:11:19 +00:00
[CK_TILE] Add CK Tile bwd weight profiler MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit ## Motivation To compare old CK and CK Tile, we need to extend the current CK profiler to support running also CK Tile instance with the same API. In order to have the same instance coverage in CK Tile compared to the old CK, I've added code generation from old CK configurations to CK Tile instances using the CK Builder. ## Technical Details - The codegen python script for CK Tile fwd convs is extended to support also bwd weight and bwd data. - The generated instances are added to the CMake build (target `device_grouped_conv_bwd_weight_tile_instance`s). - A new profiler op (`grouped_conv_bwd_weight_tile`) has been added to the CK Profiler.
37 lines
1.7 KiB
CMake
37 lines
1.7 KiB
CMake
# Copyright (c) Advanced Micro Devices, Inc., or its affiliates.
|
|
# SPDX-License-Identifier: MIT
|
|
|
|
if(GPU_TARGETS MATCHES "gfx9")
|
|
# Generate instances using python script if instance directories don't exist
|
|
set(INSTANCES_DIR ${CMAKE_CURRENT_SOURCE_DIR}/instances)
|
|
if(NOT EXISTS ${INSTANCES_DIR}/forward OR
|
|
NOT EXISTS ${INSTANCES_DIR}/backward_weight OR
|
|
NOT EXISTS ${INSTANCES_DIR}/backward_data)
|
|
find_package(Python3 COMPONENTS Interpreter Development)
|
|
execute_process(
|
|
COMMAND ${Python3_EXECUTABLE} ${CMAKE_CURRENT_SOURCE_DIR}/generate_instances.py --mode=tests
|
|
RESULT_VARIABLE ret
|
|
OUTPUT_VARIABLE output
|
|
ERROR_VARIABLE error
|
|
)
|
|
|
|
if(NOT ret EQUAL 0)
|
|
message(FATAL_ERROR "Failed to generate instances. Return code: ${ret}\nOutput: ${output}\nError: ${error}")
|
|
endif()
|
|
endif()
|
|
|
|
# Find cpp files and create lib for instances
|
|
file(GLOB_RECURSE GROUPED_CONV_FWD_TILE "instances/forward/*.cpp")
|
|
add_instance_library(device_grouped_conv_fwd_tile_instances ${GROUPED_CONV_FWD_TILE})
|
|
target_include_directories(device_grouped_conv_fwd_tile_instances PRIVATE
|
|
"${PROJECT_SOURCE_DIR}/experimental/builder/test/utils")
|
|
target_compile_options(device_grouped_conv_fwd_tile_instances PRIVATE -DCK_TILE_FLOAT_TO_BFLOAT16_DEFAULT=0)
|
|
|
|
file(GLOB_RECURSE GROUPED_CONV_BWD_WEIGHT_TILE "instances/backward_weight/*.cpp")
|
|
add_instance_library(device_grouped_conv_bwd_weight_tile_instances ${GROUPED_CONV_BWD_WEIGHT_TILE})
|
|
target_include_directories(device_grouped_conv_bwd_weight_tile_instances PRIVATE
|
|
"${PROJECT_SOURCE_DIR}/experimental/builder/test/utils")
|
|
|
|
target_compile_options(device_grouped_conv_bwd_weight_tile_instances PRIVATE -DCK_TILE_FLOAT_TO_BFLOAT16_DEFAULT=0)
|
|
endif()
|