Skip to content

Commit bc4819e

Browse files
committed
Add per-example gfx arch checks
Signed-off-by: Jan Stephan <[email protected]>
1 parent 84a1f83 commit bc4819e

File tree

22 files changed

+158
-19
lines changed

22 files changed

+158
-19
lines changed

Libraries/ComposableKernel/CMakeLists.txt

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -31,14 +31,6 @@ endif()
3131
file(RELATIVE_PATH folder_bin ${CMAKE_SOURCE_DIR} ${CMAKE_CURRENT_SOURCE_DIR})
3232
set(CMAKE_RUNTIME_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/bin/${folder_bin})
3333

34-
set(CK_SUPPORTED_ARCH gfx90a gfx942 gfx950)
35-
36-
foreach(ARCH ${CMAKE_HIP_ARCHITECTURES})
37-
if(NOT ARCH IN_LIST CK_SUPPORTED_ARCH)
38-
message(STATUS "CK Tile examples are not supported for ${ARCH}. Not building CK Tile examples")
39-
return()
40-
endif()
41-
endforeach()
4234

4335
include(CTest)
4436

Libraries/ComposableKernel/attention/fmha/CMakeLists.txt

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,14 @@ select_gpu_language()
4141
enable_language(${ROCM_EXAMPLES_GPU_LANGUAGE})
4242
select_hip_platform()
4343

44+
set(EXAMPLE_SUPPORTED_ARCH gfx942)
45+
foreach(ARCH ${CMAKE_HIP_ARCHITECTURES})
46+
if(NOT ARCH IN_LIST EXAMPLE_SUPPORTED_ARCH)
47+
message(STATUS "CK Tile FMHA examples are not supported for ${ARCH}. Not building CK Tile FMHA examples")
48+
return()
49+
endif()
50+
endforeach()
51+
4452
if(ROCM_EXAMPLES_GPU_LANGUAGE STREQUAL "CUDA")
4553
message(STATUS "Composable Kernel examples are not supported for CUDA.")
4654
return()

Libraries/ComposableKernel/attention/fmha/Makefile

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ ICPPFLAGS += $(CPPFLAGS)
4444
ILDFLAGS += $(LDFLAGS)
4545
ILDLIBS += $(LDLIBS)
4646

47-
FWD_PP_DEFS := -DCK_TILE_FMHA_FWD_FAST_EXP2=1 -DCK_TILE_FMHA_FWD_SPLITKV_API=1 -DCK_TILE_FMHA_FWD_APPENDKV_API=1 -DCK_TILE_FMHA_FWD_PAGEDKV_API=1
47+
FWD_PP_DEFS := -DCK_TILE_FMHA_FWD_FAST_EXP2=1
4848
FWD_SRC_DIR := fwd_sources
4949
FWD_OBJ_DIR := fwd_objects
5050
BWD_SRC_DIR := bwd_sources
@@ -64,11 +64,11 @@ $(FWD_SRC_DIR) $(FWD_OBJ_DIR) $(BWD_SRC_DIR) $(BWD_OBJ_DIR):
6464
generate: $(FWD_GENERATION_DONE) $(BWD_GENERATION_DONE)
6565

6666
$(FWD_GENERATION_DONE): $(EXAMPLE_GENERATOR) | $(FWD_SRC_DIR)
67-
python3 $(EXAMPLE_GENERATOR) --api fwd,fwd_splitkv,fwd_appendkv --optdim 32,64,128,256 --output_dir $(FWD_SRC_DIR)
67+
python3 $(EXAMPLE_GENERATOR) --api fwd --receipt 2 --optdim 64 --filter "*fp16_group*" --output_dir $(FWD_SRC_DIR)
6868
@touch $@
6969

7070
$(BWD_GENERATION_DONE): $(EXAMPLE_GENERATOR) | $(BWD_SRC_DIR)
71-
python3 $(EXAMPLE_GENERATOR) --api bwd --receipt 3 --optdim 32,64,128,256 --output_dir $(BWD_SRC_DIR)
71+
python3 $(EXAMPLE_GENERATOR) --api bwd --receipt 3 --optdim 64 --filter "*fp16_group*" --output_dir $(BWD_SRC_DIR)
7272
@touch $@
7373

7474
FWD_SRCS := fmha_fwd.cpp

Libraries/ComposableKernel/attention/fmha/README.md

Lines changed: 1 addition & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -7,14 +7,7 @@ with the `_fwd` suffix contain the algorithm's forward pass, while the `_bwd` fi
77

88
### Supported architectures
99

10-
The forward pass example is supported for the following GPU architectures:
11-
12-
* `gfx908`
13-
* `gfx90a`
14-
* `gfx942`
15-
* `gfx950`
16-
17-
The backward pass is only supported for the `gfx942` architecture.
10+
The example is only supported for the `gfx942` architecture.
1811

1912
### Application flow
2013

Libraries/ComposableKernel/basic/batched_transpose/CMakeLists.txt

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,14 @@ select_gpu_language()
3636
enable_language(${ROCM_EXAMPLES_GPU_LANGUAGE})
3737
select_hip_platform()
3838

39+
set(EXAMPLE_SUPPORTED_ARCH gfx908 gfx90a gfx942 gfx950)
40+
foreach(ARCH ${CMAKE_HIP_ARCHITECTURES})
41+
if(NOT ARCH IN_LIST EXAMPLE_SUPPORTED_ARCH)
42+
message(STATUS "CK Tile batched transpose example is not supported for ${ARCH}. Not building CK Tile batched transpose example")
43+
return()
44+
endif()
45+
endforeach()
46+
3947
if(ROCM_EXAMPLES_GPU_LANGUAGE STREQUAL "CUDA")
4048
message(STATUS "Composable Kernel examples are not supported for CUDA.")
4149
return()

Libraries/ComposableKernel/basic/permute/CMakeLists.txt

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,14 @@ select_gpu_language()
3737
enable_language(${ROCM_EXAMPLES_GPU_LANGUAGE})
3838
select_hip_platform()
3939

40+
set(EXAMPLE_SUPPORTED_ARCH gfx908 gfx90a gfx942 gfx950)
41+
foreach(ARCH ${CMAKE_HIP_ARCHITECTURES})
42+
if(NOT ARCH IN_LIST EXAMPLE_SUPPORTED_ARCH)
43+
message(STATUS "CK Tile permute example is not supported for ${ARCH}. Not building CK Tile permute example")
44+
return()
45+
endif()
46+
endforeach()
47+
4048
if(ROCM_EXAMPLES_GPU_LANGUAGE STREQUAL "CUDA")
4149
message(STATUS "Composable Kernel examples are not supported for CUDA.")
4250
return()

Libraries/ComposableKernel/convolution/grouped_convolution/CMakeLists.txt

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,14 @@ select_gpu_language()
3737
enable_language(${ROCM_EXAMPLES_GPU_LANGUAGE})
3838
select_hip_platform()
3939

40+
set(EXAMPLE_SUPPORTED_ARCH gfx908 gfx90a gfx942 gfx950)
41+
foreach(ARCH ${CMAKE_HIP_ARCHITECTURES})
42+
if(NOT ARCH IN_LIST EXAMPLE_SUPPORTED_ARCH)
43+
message(STATUS "CK Tile grouped convolution example is not supported for ${ARCH}. Not building CK Tile grouped convolution example")
44+
return()
45+
endif()
46+
endforeach()
47+
4048
if(ROCM_EXAMPLES_GPU_LANGUAGE STREQUAL "CUDA")
4149
message(STATUS "Composable Kernel examples are not supported for CUDA.")
4250
return()

Libraries/ComposableKernel/gemm/batched_gemm/CMakeLists.txt

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,14 @@ select_gpu_language()
3535
enable_language(${ROCM_EXAMPLES_GPU_LANGUAGE})
3636
select_hip_platform()
3737

38+
set(EXAMPLE_SUPPORTED_ARCH gfx908 gfx90a gfx942 gfx950)
39+
foreach(ARCH ${CMAKE_HIP_ARCHITECTURES})
40+
if(NOT ARCH IN_LIST EXAMPLE_SUPPORTED_ARCH)
41+
message(STATUS "CK Tile batched GEMM example is not supported for ${ARCH}. Not building CK Tile batched GEMM example")
42+
return()
43+
endif()
44+
endforeach()
45+
3846
if(ROCM_EXAMPLES_GPU_LANGUAGE STREQUAL "CUDA")
3947
message(STATUS "Composable Kernel examples are not supported for CUDA.")
4048
return()

Libraries/ComposableKernel/gemm/block_scale_gemm/CMakeLists.txt

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,14 @@ select_gpu_language()
3535
enable_language(${ROCM_EXAMPLES_GPU_LANGUAGE})
3636
select_hip_platform()
3737

38+
set(EXAMPLE_SUPPORTED_ARCH gfx942 gfx950)
39+
foreach(ARCH ${CMAKE_HIP_ARCHITECTURES})
40+
if(NOT ARCH IN_LIST EXAMPLE_SUPPORTED_ARCH)
41+
message(STATUS "CK Tile block-scale GEMM example is not supported for ${ARCH}. Not building CK Tile block-scale GEMM example")
42+
return()
43+
endif()
44+
endforeach()
45+
3846
if(ROCM_EXAMPLES_GPU_LANGUAGE STREQUAL "CUDA")
3947
message(STATUS "Composable Kernel examples are not supported for CUDA.")
4048
return()

Libraries/ComposableKernel/gemm/flatmm/CMakeLists.txt

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,14 @@ select_gpu_language()
3636
enable_language(${ROCM_EXAMPLES_GPU_LANGUAGE})
3737
select_hip_platform()
3838

39+
set(EXAMPLE_SUPPORTED_ARCH gfx908 gfx90a gfx942 gfx950)
40+
foreach(ARCH ${CMAKE_HIP_ARCHITECTURES})
41+
if(NOT ARCH IN_LIST EXAMPLE_SUPPORTED_ARCH)
42+
message(STATUS "CK Tile FLATMM example is not supported for ${ARCH}. Not building CK Tile FLATMM example")
43+
return()
44+
endif()
45+
endforeach()
46+
3947
if(ROCM_EXAMPLES_GPU_LANGUAGE STREQUAL "CUDA")
4048
message(STATUS "Composable Kernel examples are not supported for CUDA.")
4149
return()

0 commit comments

Comments
 (0)