-
Notifications
You must be signed in to change notification settings - Fork 188
Ck tile tutorial examples #2206
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?
Conversation
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.
Everything looks!
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.
Doesn't look like there's anything for docs to review
We have a README file https://github.com/ROCm/composable_kernel/blob/ck_tile_tutorial/example/ck_tile/tutorial/README.md in the tutorial folder that contains the following content. It provides basic examples of ck_tile. In addition to the explanations found in the comments of the examples, there are currently some ongoing internal CK materials, and the demonstrations within them will refer to the examples located under this tutorial. CK_TILE Tutorial ExampleThis folder demonstrates the examples implemented using ck_tile Build InstructionsFollow these steps to build the examples: cd composable_kernel
mkdir build
cd build
cmake -D CMAKE_PREFIX_PATH=/opt/rocm \
-D CMAKE_CXX_COMPILER=/opt/rocm/bin/hipcc \
-D CMAKE_BUILD_TYPE=Release \
-D GPU_TARGETS="gfx942" \
-Dkernel=N .. Compile ExamplesBasic Add Examplemake -j add_basic Elementwise Add Examplemake -j add GEMM Examplemake -j basic_gemm Flash Attention Forward Examplemake -j basic_flash_attention_fwd Running ExamplesBasic Add Example./bin/add_basic Elementwise Add./bin/add GEMM Example./bin/basic_gemm 1 Flash Attention Forward Example./bin/basic_flash_attention_fwd 1 1 Advanced partGEMM ExampleFollow these steps to build and run the different kernels:cd composable_kernel
mkdir build
cd build
# for naive kernel
cmake -D CMAKE_PREFIX_PATH=/opt/rocm -D CMAKE_CXX_COMPILER=/opt/rocm/bin/hipcc -D CMAKE_BUILD_TYPE=Release -D GPU_TARGETS="gfx942" -Dkernel=N .. && make -j basic_gemm
# for kernel A
cmake -D CMAKE_PREFIX_PATH=/opt/rocm -D CMAKE_CXX_COMPILER=/opt/rocm/bin/hipcc -D CMAKE_BUILD_TYPE=Release -D GPU_TARGETS="gfx942" -Dkernel=A .. && make -j basic_gemm
# for kernel B
cmake -D CMAKE_PREFIX_PATH=/opt/rocm -D CMAKE_CXX_COMPILER=/opt/rocm/bin/hipcc -D CMAKE_BUILD_TYPE=Release -D GPU_TARGETS="gfx942" -Dkernel=B .. && make -j basic_gemm
...
# for kernel H
cmake -D CMAKE_PREFIX_PATH=/opt/rocm -D CMAKE_CXX_COMPILER=/opt/rocm/bin/hipcc -D CMAKE_BUILD_TYPE=Release -D GPU_TARGETS="gfx942" -Dkernel=H .. && make -j basic_gemm
./bin/basic_gemm 1 Flash Attention Forward ExampleFollow these steps to build the kernels# for naive kernel
cmake -D CMAKE_PREFIX_PATH=/opt/rocm -D CMAKE_CXX_COMPILER=/opt/rocm/bin/hipcc -D CMAKE_BUILD_TYPE=Release -D GPU_TARGETS="gfx942" .. && make -j basic_flash_attention_fwd
# for optimized kernel
cmake -D CMAKE_PREFIX_PATH=/opt/rocm -D CMAKE_CXX_COMPILER=/opt/rocm/bin/hipcc -D CMAKE_BUILD_TYPE=Release -D GPU_TARGETS="gfx942" -DENABLE_TOY_FA_FWD_OPT=ON .. && make -j basic_flash_attention_fwd ./bin/basic_flash_attention_fwd 1 1 Follow these steps to build and run the codegen instancesmkdir build
cd build
../script/cmake-ck-release.sh .. gfx942
make -j codegen_basic_flash_attention_fwd ./bin/codegen_basic_flash_attention_fwd 1 1 64 16384 16384 128 128 |
Proposed changes
Examples of educational materials related to CK TILE.
Checklist
Please put an
x
into the boxes that apply. You can also fill these out after creating the PR. If you're not sure, please don't hesitate to ask.clang-format
on all changed files