-
Notifications
You must be signed in to change notification settings - Fork 252
[CK Tile] enable building examples by default #3259
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: develop
Are you sure you want to change the base?
Changes from 16 commits
2ef2e17
c28fc83
ad0fea1
d11e902
3c71895
9b493dd
556dbab
82889e5
f3ade8d
499366f
ef441bf
10f157e
ffddd31
86e8f22
159dccc
57789fd
a48f479
a533e1c
d51efbd
ad969d5
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,20 +1,22 @@ | ||
| add_executable(tile_example_gemm_basic EXCLUDE_FROM_ALL gemm_basic.cpp) | ||
| add_executable(tile_example_gemm_universal EXCLUDE_FROM_ALL universal_gemm.cpp) | ||
| add_executable(tile_example_gemm_weight_preshuffle EXCLUDE_FROM_ALL gemm_weight_preshuffle.cpp) | ||
| add_executable(tile_example_gemm_reduce EXCLUDE_FROM_ALL gemm_splitk_two_stage_reduce.cpp) | ||
| add_executable(tile_example_gemm_splitk_two_stage EXCLUDE_FROM_ALL gemm_splitk_two_stage.cpp) | ||
| set(EXAMPLE_GEMM_COMPILE_OPTIONS) | ||
| set(EXAMPLE_WEIGHT_PRESHUFFLE_COMPILE_OPTIONS) | ||
| if(CK_USE_OCP_FP8) | ||
| list(APPEND EXAMPLE_GEMM_COMPILE_OPTIONS -DCK_TILE_USE_OCP_FP8) | ||
| if(GPU_TARGETS MATCHES "gfx94|gfx95|gfx90a|gfx11|gfx12") | ||
| add_executable(tile_example_gemm_basic gemm_basic.cpp) | ||
| add_executable(tile_example_gemm_universal universal_gemm.cpp) | ||
| add_executable(tile_example_gemm_weight_preshuffle gemm_weight_preshuffle.cpp) | ||
| add_executable(tile_example_gemm_reduce gemm_splitk_two_stage_reduce.cpp) | ||
| add_executable(tile_example_gemm_splitk_two_stage gemm_splitk_two_stage.cpp) | ||
| set(EXAMPLE_GEMM_COMPILE_OPTIONS) | ||
| set(EXAMPLE_WEIGHT_PRESHUFFLE_COMPILE_OPTIONS) | ||
| if(CK_USE_OCP_FP8) | ||
| list(APPEND EXAMPLE_GEMM_COMPILE_OPTIONS -DCK_TILE_USE_OCP_FP8) | ||
| endif() | ||
| list(APPEND EXAMPLE_GEMM_COMPILE_OPTIONS -mllvm -enable-noalias-to-md-conversion=0) | ||
| list(APPEND EXAMPLE_WEIGHT_PRESHUFFLE_COMPILE_OPTIONS -Wno-unused-local-typedef) | ||
| list(APPEND EXAMPLE_WEIGHT_PRESHUFFLE_COMPILE_OPTIONS -Wno-gnu-line-marker) | ||
| list(APPEND EXAMPLE_WEIGHT_PRESHUFFLE_COMPILE_OPTIONS --save-temps) | ||
| list(APPEND EXAMPLE_WEIGHT_PRESHUFFLE_COMPILE_OPTIONS "SHELL: -mllvm -greedy-reverse-local-assignment=1 -mllvm -enable-noalias-to-md-conversion=0") | ||
| target_compile_options(tile_example_gemm_basic PRIVATE ${EXAMPLE_GEMM_COMPILE_OPTIONS}) | ||
| target_compile_options(tile_example_gemm_universal PRIVATE ${EXAMPLE_GEMM_COMPILE_OPTIONS}) | ||
| target_compile_options(tile_example_gemm_weight_preshuffle PRIVATE ${EXAMPLE_WEIGHT_PRESHUFFLE_COMPILE_OPTIONS}) | ||
| target_compile_options(tile_example_gemm_reduce PRIVATE ${EXAMPLE_GEMM_COMPILE_OPTIONS}) | ||
| target_compile_options(tile_example_gemm_splitk_two_stage PRIVATE ${EXAMPLE_GEMM_COMPILE_OPTIONS}) | ||
| endif() | ||
| list(APPEND EXAMPLE_GEMM_COMPILE_OPTIONS -mllvm -enable-noalias-to-md-conversion=0) | ||
| list(APPEND EXAMPLE_WEIGHT_PRESHUFFLE_COMPILE_OPTIONS -Wno-unused-local-typedef) | ||
| list(APPEND EXAMPLE_WEIGHT_PRESHUFFLE_COMPILE_OPTIONS -Wno-gnu-line-marker) | ||
| list(APPEND EXAMPLE_WEIGHT_PRESHUFFLE_COMPILE_OPTIONS --save-temps) | ||
| list(APPEND EXAMPLE_WEIGHT_PRESHUFFLE_COMPILE_OPTIONS "SHELL: -mllvm -greedy-reverse-local-assignment=1 -mllvm -enable-noalias-to-md-conversion=0") | ||
| target_compile_options(tile_example_gemm_basic PRIVATE ${EXAMPLE_GEMM_COMPILE_OPTIONS}) | ||
| target_compile_options(tile_example_gemm_universal PRIVATE ${EXAMPLE_GEMM_COMPILE_OPTIONS}) | ||
| target_compile_options(tile_example_gemm_weight_preshuffle PRIVATE ${EXAMPLE_WEIGHT_PRESHUFFLE_COMPILE_OPTIONS}) | ||
| target_compile_options(tile_example_gemm_reduce PRIVATE ${EXAMPLE_GEMM_COMPILE_OPTIONS}) | ||
| target_compile_options(tile_example_gemm_splitk_two_stage PRIVATE ${EXAMPLE_GEMM_COMPILE_OPTIONS}) | ||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -683,7 +683,7 @@ int run_gemm_example_with_layouts_two_stage(ck_tile::ArgParser& arg_parser, | |
|
|
||
| if constexpr(preshuffle) | ||
| { | ||
| ck_tile::HostTensor<BDataType> b_shuffle_host = shuffle_b<GemmConfig>(b_k_n); | ||
| ck_tile::HostTensor<BDataType> b_shuffle_host = ck_tile::shuffle_b<GemmConfig>(b_k_n); | ||
|
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Can't call without explicit namespace prior to C++20 |
||
| // shuffled buffer B for device implementation | ||
| b_k_n_dev_buf.ToDevice(b_shuffle_host.data()); | ||
| } | ||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,3 +1,3 @@ | ||
| # not using add_example_executable() to add this target, since we don't want this to have | ||
| # to be included in "make all/install/check" | ||
| add_executable(tile_example_img2col EXCLUDE_FROM_ALL image_to_column.cpp) | ||
| add_executable(tile_example_img2col image_to_column.cpp) |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -402,22 +402,6 @@ float fused_moesorting_mp(fused_moesorting_trait t, | |
| using ms_index_t = ck_tile::index_t; | ||
| using ms_weight_type = float; | ||
|
|
||
| auto maybe_clear_workspace = [=](const ck_tile::stream_config& s_) { | ||
| if(t.clear_workspace_inside_api) | ||
|
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. there is no such member and the macro is not defined |
||
| { | ||
| if(is_local_token) | ||
| { | ||
| auto k = MOR_SORTING_CLEAR_WS_DISPATCH_(true, 1024, 1); | ||
| k(s_); | ||
| } | ||
| else | ||
| { | ||
| auto k = MOR_SORTING_CLEAR_WS_DISPATCH_(false, 1024, 1); | ||
| k(s_); | ||
| } | ||
| } | ||
| }; | ||
|
|
||
| if(a.tokens < 2048) | ||
| { | ||
| if(ck_tile::impl::moe_sorting_get_smem_size_p23(a.num_experts) > | ||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1 +1 @@ | ||
| add_executable(tile_example_batched_gemm EXCLUDE_FROM_ALL batched_gemm.cpp) | ||
| add_executable(tile_example_batched_gemm batched_gemm.cpp) |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,12 +1,12 @@ | ||
| add_executable(tile_example_grouped_gemm EXCLUDE_FROM_ALL grouped_gemm.cpp) | ||
| add_executable(tile_example_quant_grouped_gemm EXCLUDE_FROM_ALL quant_grouped_gemm.cpp) | ||
| add_executable(tile_example_grouped_gemm_preshuffle EXCLUDE_FROM_ALL grouped_gemm_preshuffle.cpp) | ||
| add_executable(tile_example_grouped_gemm_multi_d EXCLUDE_FROM_ALL grouped_gemm_multi_d.cpp) | ||
| add_executable(tile_example_grouped_gemm grouped_gemm.cpp) | ||
| add_executable(tile_example_quant_grouped_gemm quant_grouped_gemm.cpp) | ||
| add_executable(tile_example_grouped_gemm_preshuffle grouped_gemm_preshuffle.cpp) | ||
| add_executable(tile_example_grouped_gemm_multi_d grouped_gemm_multi_d.cpp) | ||
| set(EXAMPLE_GEMM_COMPILE_OPTIONS) | ||
| if(CK_USE_OCP_FP8) | ||
| list(APPEND EXAMPLE_GEMM_COMPILE_OPTIONS -DCK_TILE_USE_OCP_FP8) | ||
| endif() | ||
| target_compile_options(tile_example_grouped_gemm PRIVATE ${EXAMPLE_GEMM_COMPILE_OPTIONS}) | ||
| target_compile_options(tile_example_grouped_gemm_preshuffle PRIVATE ${EXAMPLE_GEMM_COMPILE_OPTIONS}) | ||
| target_compile_options(tile_example_grouped_gemm_multi_d PRIVATE ${EXAMPLE_GEMM_COMPILE_OPTIONS}) | ||
| target_compile_options(tile_example_quant_grouped_gemm PRIVATE ${EXAMPLE_GEMM_COMPILE_OPTIONS}) | ||
| target_compile_options(tile_example_quant_grouped_gemm PRIVATE ${EXAMPLE_GEMM_COMPILE_OPTIONS}) |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -17,6 +17,20 @@ | |
| #include "ck_tile/host.hpp" | ||
| #include "quant_grouped_gemm.hpp" | ||
|
|
||
| struct QuantGroupSize | ||
| { | ||
| static constexpr auto kM = 128; | ||
| static constexpr auto kN = 1; | ||
| static constexpr auto kK = 1; | ||
| }; | ||
|
|
||
| struct BQuantGroupSize | ||
| { | ||
| static constexpr auto kM = 1; | ||
| static constexpr auto kN = 1; | ||
| static constexpr auto kK = 128; | ||
|
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. my best guess about the tile shape |
||
| }; | ||
|
|
||
| template <typename GemmConfig, | ||
| typename ALayout, | ||
| typename AQLayout, | ||
|
|
@@ -75,7 +89,7 @@ float grouped_gemm_tileloop(const ck_tile::stream_config& s, | |
| AccDataType, | ||
| GemmShape, | ||
| GemmUniversalTraits, | ||
| 128>, // QuantGroupSize | ||
|
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. this argument must be a typename which has kM kN and kK as static integer members |
||
| BQuantGroupSize>, | ||
| ck_tile::GemmRowColTensorQuantPipelineProblem<ADataType, | ||
| BDataType, | ||
| AccDataType, | ||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
TBD provide the list of valid architectures for each target