Repository navigation
Conversation
…rigger kernel The host-initiated variant launched the GEMM and then submitted every (batch, rank) transfer from Python, so the transfers started only after the host had queued them and the submission cost sat on the critical path. Now the host transfers are queued behind a trigger: the first transfer on each destination queue polls workspace.trigger_flag until it reaches the call's generation, and a one-workgroup _trigger_kernel bumps the flag right before the GEMM. all_gather_matmul_copy_engine_prepost_transfers() queues one launch's transfers ahead of time; the op takes copy_engine_transfers_preposted=True to use them. Without it the op queues the transfers itself right after the trigger and GEMM launches, which keeps the previous behavior. Adds the all_gather_matmul_copy_engine_host_prepost benchmark (transfers queued in the untimed preamble) and runs the op test twice per workspace, with and without preposting, to cover the generation pairing and the GEMM's wait counters. Co-Authored-By: Claude <noreply@anthropic.com>
dsidler
requested review from
BKP,
artulab,
drprajap,
efric,
mawad-amd,
neoblizz and
nirvedhmeshram
as code owners
November 25, 2026 18:00
This branch has not been deployed
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.
Stacked on #496 (base
dev/dasidler/sdma-benchmark).Summary
The host-initiated variant of
all_gather_matmul_copy_enginelaunched the GEMM and then submitted every (batch, rank) transfer from Python. The transfers started only once the host had queued them, so the submission cost sat on the critical path.The host transfers are now queued behind a trigger:
workspace.trigger_flaguntil it reaches the call's generation._trigger_kernelbumps the flag right before the GEMM.all_gather_matmul_copy_engine_prepost_transfers()queues one launch's transfers ahead of time.copy_engine_transfers_preposted=Trueto use them. Without it, the op queues the transfers itself right after the trigger and GEMM launches, which keeps the previous behavior.This is the unmanaged form of the triggered plans on
main: there is no queue-ledger bookkeeping, and each prepost must be paired with exactly one call.Benchmark
all_gather_matmul_copy_engine_host_prepostqueues the transfers in the untimed preamble. 8× MI300X, N=3584, K=8192:One run of 100 iterations per variant; run-to-run drift at M=1024 is ~±0.05 ms.
Tests
tests/ops/test_all_gather_matmul_copy_engine.pygains aprepostparameter and calls the op twice per workspace. This covers the generation pairing and the GEMM's wait counters.Run with the pinned tritonBLAS
b9baf7dand rocm-xio97fa1663.🤖 Generated with Claude Code