[CK-Tile] add persistent async input scheduler parameters to kernel device-side and host-side args#3520
Merged
ThomasNing merged 2 commits intoJan 20, 2026
Conversation
ThomasNing
requested changes
Jan 15, 2026
12d3006 to
2e6a2b0
Compare
a4145b3 to
6790591
Compare
Contributor
|
@tenpercent Please fix the clang format. |
6790591 to
fa24e26
Compare
Add signal-based synchronization for persistent GEMM kernels where input data becomes available incrementally. Uses modulo wraparound (like PyTorch's AsyncMM) for chunk index calculation: chunk_idx = ((tile_idx + tile_idx_pivot) / tiles_per_chunk) % num_chunks Key components: - PersistentAsyncInputScheduler struct with tiles_per_chunk_m, chunk_signals, tile_idx_pivot_m, and num_chunks fields - wait_eq_wave method using __builtin_amdgcn_s_sleep for power efficiency - IsSupportedArgument validation for scheduler parameters - Example demonstrating async input scheduling with simulated producer - GTest unit tests covering all layout combinations
fa24e26 to
54075df
Compare
ThomasNing
approved these changes
Jan 20, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
PersistentAsyncInputSchedulerstruct for signal-based synchronization in persistent GEMM kernelwait_eq_wavemethod with power-saving sleep for efficient busy-waitingThe future client side here
Description
This PR implements signal-based synchronization for the persistent GEMM kernel, enabling async input streaming use cases where input data arrives in chunks.
Key Features
1. PersistentAsyncInputScheduler struct (
include/ck_tile/core/utility/persistent_async_input_scheduler.hpp):tiles_per_chunk_m- number of M tiles per chunkchunk_signals- pointer to device signal array (one per chunk)tile_idx_pivot_m- pivot offset for chunk index calculationnum_chunks- number of chunks for modulo wraparound2. Kernel signal wait logic (
include/ck_tile/ops/gemm/kernel/universal_gemm_kernel.hpp):chunk_signals != nullptrworkgroup_barrier::wait_eq_wave()with__builtin_amdgcn_s_sleep(1)for power-efficient waitingtiles_per_chunk > 0andnum_chunks > 03. Power-optimized wait_eq_wave (
include/ck_tile/core/arch/workgroup_barrier.hpp):__shfl__builtin_amdgcn_s_sleep(1)to reduce power consumption during busy-wait4. Example and Tests:
test_async=1flag demonstrating async input schedulingChecklist
Please put an
xinto 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-formaton all changed filesDiscussion
If this is a relatively large or complex change, feel free to start a discussion by explaining why you chose the solution you did and what alternatives you considered