Optimized rocm specific multicast transpose kernel#586
Open
alextmagro wants to merge 1 commit into
Open
Conversation
ipanfilo
reviewed
May 15, 2026
| HIP_CHECK(hipEventCreate(&stop)); | ||
|
|
||
| nvte_multi_cast_transpose(num_experts, nvte_in.data(), nvte_out.data(), stream); | ||
| HIP_CHECK(hipStreamSynchronize(stream)); |
Collaborator
There was a problem hiding this comment.
Is synchronize needed here?
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.
Optimizes the multi_cast_transpose kernel for rocm.
Benchmark Results
Qwen has 128 experts, DS has 256 experts. Benchmarked with shapes derived from MBS={1,2,4}
Balanced Experts
Skewed routing
Performance Summary
Average speedup (balanced): 5.0x
Average speedup (skewed): 5.8x
Average % peak (balanced): 49.4%
Average % peak (skewed): 49.0%
Change Summary
Vec::store_towhich pollutes L2 (CDNA4 L2 is write-allocate)rocm_pack_4xfloat8— 2v_cvt_pk_fp8_f32per 4 values vs upstream's scalarOType(scale * x)castsrocm_block_reduce_maxwithrocm_atomicMaxFloat— usesatomicMaxon int-reinterpreted float (single instruction) vs upstream's CAS looptile_m = local_bid % tiles_mfor L2 input localityRejected/skipped optimizations (click to expand)