Skip to content

Commit ff89459

Browse files
author
eliotwang
committed
rename example folder
1 parent 43db1f7 commit ff89459

26 files changed

+12
-285
lines changed
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
1-
add_executable(tile_example_fp4_uint8_gemm EXCLUDE_FROM_ALL fp4_uint8_gemm.cpp)
1+
add_executable(tile_exampl_bf16_mxfp4_gemm EXCLUDE_FROM_ALL bf16_mxfp4_blockscale_gemm.cpp)
22

33
set(EXAMPLE_GEMM_COMPILE_OPTIONS)
44
if(CK_USE_OCP_FP8)
55
list(APPEND EXAMPLE_GEMM_COMPILE_OPTIONS -DCK_TILE_USE_OCP_FP8)
66
endif()
77
list(APPEND EXAMPLE_GEMM_COMPILE_OPTIONS -mllvm -enable-noalias-to-md-conversion=0)
8-
target_compile_options(tile_example_fp4_uint8_gemm PRIVATE ${EXAMPLE_GEMM_COMPILE_OPTIONS})
8+
target_compile_options(tile_exampl_bf16_mxfp4_gemm PRIVATE ${EXAMPLE_GEMM_COMPILE_OPTIONS})

example/ck_tile/40_fp4_uint8_gemm/README.md renamed to example/ck_tile/40_bf16_mxfp4_blockscale_gemm/README.md

Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -8,12 +8,11 @@ This folder contains example for GEMM using ck_tile tile-programming implementat
88
mkdir build && cd build
99
# you can replace <arch> with the appropriate architecture (for example gfx90a or gfx942) or leave it blank
1010
sh ../script/cmake-ck-dev.sh ../ <arch>
11-
# The basic pipeline method on the gemm calculation
12-
make tile_example_gemm_basic -j
13-
# The memory bound pipeline on the gemm calculation
14-
make tile_example_gemm_universal -j
11+
# The pipeline method on the gemm calculation
12+
make tile_exampl_bf16_mxfp4_gemm -j
13+
1514
```
16-
This will result in an executable `build/bin/tile_example_gemm_basic` & `build/bin/tile_example_gemm_universal`
15+
This will result in an executable `build/bin/tile_exampl_bf16_mxfp4_gemm`
1716

1817
## example
1918
```
@@ -28,9 +27,9 @@ args:
2827
-stride_a Tensor A stride (default:0)
2928
-stride_b Tensor B stride (default:0)
3029
-stride_c Tensor C stride (default:0)
31-
-v 0. No validation, 1. Validation on CPU, 2. Validation on GPU (default:2)
30+
-v 0. No validation, 1. Validation on CPU
3231
-e Absolute error tolerance (default:1e-5)
33-
-prec data type. fp16/bf16/fp8/bf8/int8 (default:fp16)
32+
-prec data type. fp16/bf16/fp8/bf8/int8/pk_fp4_t (default:fp16)
3433
-warmup number of iterations before benchmark the kernel (default:10)
3534
-repeat number of iterations to benchmark the kernel (default:100)
3635
-timer gpu:gpu timer, cpu:cpu timer (default:gpu)

example/ck_tile/40_fp4_uint8_gemm/fp4_uint8_gemm.cpp renamed to example/ck_tile/40_bf16_mxfp4_blockscale_gemm/bf16_mxfp4_blockscale_gemm.cpp

Lines changed: 2 additions & 50 deletions
Original file line numberDiff line numberDiff line change
@@ -175,17 +175,16 @@ struct UniversalInvoker
175175

176176
auto size_a_buffer = a_m.get_element_space_size_in_bytes();
177177
auto size_b_buffer = b_n.get_element_space_size_in_bytes();
178-
178+
179179
rotating_mem_ptr =
180180
std::make_unique<ck_tile::RotatingMemWrapper<ADataType, BInDataType>>(
181181
kargs.as_ptr[0],
182182
kargs.bs_ptr[0],
183183
s.rotating_count_,
184184
size_a_buffer,
185185
size_b_buffer);
186-
rotating_mem_ptr->Print();
186+
rotating_mem_ptr->Print();
187187

188-
189188
preprocess = [&]() {
190189
ck_tile::flush_icache();
191190
rotating_mem_ptr->Next();
@@ -297,53 +296,6 @@ int run_gemm_example(ck_tile::ArgParser& arg_parser)
297296
std::string b_layout = arg_parser.get_str("b_layout");
298297

299298
using Invoker = UniversalInvoker;
300-
// if(data_type == "fp16")
301-
// {
302-
// return run_gemm_example_prec_type<GemmConfig<ck_tile::half_t>, ck_tile::half_t>(
303-
// a_layout, b_layout, argc, argv);
304-
// }
305-
// else if(data_type == "bf16")
306-
// {
307-
// return run_gemm_example_prec_type<GemmConfig<ck_tile::half_t>, ck_tile::bf16_t>(
308-
// a_layout, b_layout, argc, argv);
309-
// }
310-
// else if(data_type == "fp8")
311-
// {
312-
// return run_gemm_example_prec_type<GemmConfig<ck_tile::fp8_t>,
313-
// ck_tile::fp8_t,
314-
// ck_tile::fp8_t,
315-
// ck_tile::bf16_t>(a_layout, b_layout, argc, argv);
316-
// }
317-
// else if(data_type == "bf8")
318-
// {
319-
// return run_gemm_example_prec_type<GemmConfig<ck_tile::bf8_t>,
320-
// ck_tile::bf8_t,
321-
// ck_tile::bf8_t,
322-
// ck_tile::half_t>(a_layout, b_layout, argc, argv);
323-
// }
324-
// else if(data_type == "int8")
325-
// {
326-
// return run_gemm_example_prec_type<GemmConfig<ck_tile::int8_t>,
327-
// ck_tile::int8_t,
328-
// ck_tile::int8_t,
329-
// ck_tile::int32_t>(a_layout, b_layout, argc, argv);
330-
// }
331-
// else if(data_type == "pk_int4_t")
332-
// {
333-
// // TODO: Add support for bhalf_t ADataType
334-
// if constexpr(GemmConfig<ck_tile::half_t>::Pipeline == CK_TILE_PIPELINE_COMPUTE_V3)
335-
// {
336-
// return run_gemm_example_prec_type<GemmConfig<ck_tile::half_t>,
337-
// ck_tile::half_t,
338-
// ck_tile::pk_int4_t,
339-
// ck_tile::half_t>(a_layout, b_layout, argc, argv);
340-
// }
341-
// else
342-
// {
343-
// throw std::runtime_error("Unsupported pipeline for this operation !!!");
344-
// }
345-
// }
346-
// else if(data_type == "pk_fp4_t")
347299
if(data_type == "pk_fp4_t")
348300
{
349301
// TODO: Add support for bhalf_t ADataType

0 commit comments

Comments
 (0)