Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
26 changes: 26 additions & 0 deletions docs/conceptual/CK-Tile-intra-inter-wave.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
.. meta::
:description: Intrawave and interwave scheduling with CK Tile
:keywords: composable kernel, CK, CK Tile, ROCm, API, scheduling, intrawave, interwave

************************************************************
Intrawave and interwave scheduling with CK Tile
************************************************************

Two different scheduling pipelines are available to use with CK Tile's GEMM implementation.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
Two different scheduling pipelines are available to use with CK Tile's GEMM implementation.
Two scheduling pipelines are available to use with the CK Tile GEMM implementation.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I like mine better


The interwave and intrawave scheduling pipelines coordinate waves in K dimension accumulation loops. Whether to use the interwave or intrawave pipeline depends on whether the workload is memory-bound or compute-bound.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

no hyphen in "k dimension", right? right?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

no


In interwave scheduling, the K dimension is separated into chunks. The same chunk is loaded into each wave. When the chunk has been loaded into all the waves, the same operation is run on the chunk.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
In interwave scheduling, the K dimension is separated into chunks. The same chunk is loaded into each wave. When the chunk has been loaded into all the waves, the same operation is run on the chunk.
In interwave scheduling, the K dimension is separated into chunks. The same chunk is loaded into each wave. Once the chunk has been loaded into all the waves, the same operation is run on the chunk.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Changed the sentences altogether.


Once all the waves have completed the operation, the next chunk is loaded into the waves.

Because all the waves are synchronized, memory accesses are coordinated, and the cache hit rate is optimized, interwave scheduling is best for memory-bound workloads.

In intrawave scheduling, the full K dimension is loaded into each wave. Each wave runs its own operation on the K dimension independently of the other waves, and without any synchronization with the other waves. The compute unit (CU) is responsible for interleaving the independent operations.

Because the CU has flexibility in scheduling operations, intrawave scheduling is best for compute-bound workloads.

An example of both interwave and intrawave scheduling can be found in |gemm_utils.hpp|_, which is part of the `GEMM with CK Tile example <https://github.com/ROCm/composable_kernel/blob/develop/example/ck_tile/03_gemm/README.md>`_.

.. |gemm_utils.hpp| replace:: ``gemm_utils.hpp``
.. _gemm_utils.hpp: https://github.com/ROCm/composable_kernel/blob/develop/example/ck_tile/03_gemm/gemm_utils.hpp#L37
1 change: 1 addition & 0 deletions docs/index.rst
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ The Composable Kernel repository is located at `https://github.com/ROCm/composab

* :doc:`Composable Kernel structure <./conceptual/Composable-Kernel-structure>`
* :doc:`Composable Kernel mathematical basis <./conceptual/Composable-Kernel-math>`
* :doc:`CK Tile intrawave and interwave scheduling <../conceptual/CK-Tile-intra-inter-wave>`
* :doc:`CK Tile conceptual documentation <./conceptual/ck_tile/CK-tile-index>`

.. grid-item-card:: Tutorials
Expand Down
2 changes: 2 additions & 0 deletions docs/sphinx/_toc.yml.in
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,8 @@ subtrees:
title: Structure
- file: conceptual/Composable-Kernel-math.rst
title: Mathematical basis
- file: conceptual/CK-Tile-intra-inter-wave.rst
title: Intrawave and interwave scheduling
- file: conceptual/ck_tile/CK-tile-index.rst
title: CK Tile conceptual documentation

Expand Down