Optimize: EP4 intranode kernel for FP4 dispatch + FP8 combine#170
Merged
Optimize: EP4 intranode kernel for FP4 dispatch + FP8 combine#170
Conversation
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.
Motivation
Optimize EP4 intranode dispatch+combine latency for FP4 dispatch + BF16→FP8 combine through kernel-level optimizations and launch configuration tuning.
Technical Details
atomicAddwith__syncthreads()+ per-blockatomicAddin both dispatch and combine kernels, reducing atomic contention by ~4x.__ballot+__popcllto compact non-null source pointers before accumulation. EP4 deduplication leaves ~50% null pointers; compaction halves the accumulation work. EP8 skips compaction automatically (nearly all pointers valid, ~3 cycle overhead).block_num×warp_per_blockspace for 64/128/256 tokens and update EP4 defaults inbench_dispatch_combine.py.intranode_tuning.sh.Test Result
EP4 Dispatch + Combine total latency (FP4 dispatch + FP8 combine, P2P write, MI355X 4-GPU):
Correctness verified (bench warmup check) and 100k-round stress tested across EP4 FP4+FP8, EP4 BF16 zero-copy, EP8 FP4+FP8, and EP8 BF16 — all pass.