Skip to content
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

Refactor SMEM to RMEM Loader/Storer with SwizzleLayout #42

Open
KuangjuX opened this issue Jan 18, 2025 · 0 comments
Open

Refactor SMEM to RMEM Loader/Storer with SwizzleLayout #42

KuangjuX opened this issue Jan 18, 2025 · 0 comments
Assignees
Labels
enhancement New feature or request

Comments

@KuangjuX
Copy link
Collaborator

KuangjuX commented Jan 18, 2025

In the original implementation, $16 \times 16$ was used as the basic unit for swizzle and stored as a nested layout in shared memory, where each swizzle block is stored contiguously. This allows the use of Swizzle<2, 3, 3> for address remapping and achieving bank conflict. The original layout is shown in the following diagram:

Image

However, when considering the copy from GMEM to SMEM, we need to copy 128 Bytes along the column dimension to achieve the maximum memory access coalescing. In this case, it is not possible to tile the $16 \times 16$ matrix in contiguous memory.

In the new design, we plan to use Swizzle<3, 3, 3> as a basic swizzle block, which can distribute different threads within a transaction across different banks.

In this scenario, a $16 \times 16$ matrix of data will be distributed across two Swizzle<3, 3, 3> blocks. Therefore, the shared memory needs to keep track of how many swizzle blocks are stored within a single shared memory (using [kTM, kTN] as the shape of the shared memory) and map them to different swizzle blocks when indexing with (i, j).

@KuangjuX KuangjuX added the enhancement New feature or request label Jan 18, 2025
@KuangjuX KuangjuX self-assigned this Jan 18, 2025
@KuangjuX KuangjuX changed the title Refactor SMEM to RMEM loader/storer with SwizzleLayout Refactor SMEM to RMEM Loader/Storer with SwizzleLayout Jan 18, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

1 participant