Repository navigation
Conversation
…(64-row tiers up, when an expert has several blocks) Signed-off-by: Sergei Shliapnikov <sergei.shliapnikov@amd.com>
… in the 8-wave tiers Signed-off-by: Sergei Shliapnikov <sergei.shliapnikov@amd.com>
…when the current item ends Signed-off-by: Sergei Shliapnikov <sergei.shliapnikov@amd.com>
…fter its rows are acknowledged Signed-off-by: Sergei Shliapnikov <sergei.shliapnikov@amd.com>
…-wave tiers, all inbox loads in flight Signed-off-by: Sergei Shliapnikov <sergei.shliapnikov@amd.com>
Signed-off-by: Sergei Shliapnikov <sergei.shliapnikov@amd.com>
…rites Signed-off-by: Sergei Shliapnikov <sergei.shliapnikov@amd.com>
… as min / max Signed-off-by: Sergei Shliapnikov <sergei.shliapnikov@amd.com>
…OR-swizzled by row Signed-off-by: Sergei Shliapnikov <sergei.shliapnikov@amd.com>
…kip their MFMAs Signed-off-by: Sergei Shliapnikov <sergei.shliapnikov@amd.com>
Signed-off-by: Sergei Shliapnikov <sergei.shliapnikov@amd.com>
Collaborator
|
Hi @sshlyapn thanks for the PR, can you test your kernel on some real workloads? e.g. an hour long agentx test |
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.
This PR speeds up the fused expert-parallel MoE kernel for DeepSeek-V4.1-Flash decode on 8x MI355X, mostly when expert routing is skewed. Outputs are bit-identical to the current kernel on every tested case. The largest change gives each XCD its own work queue over a run of consecutive row blocks, so that a hot expert's blocks share one XCD's L2. The other changes are smaller scheduling, dispatch, load-addressing and epilogue changes.
Changes (one commit each, in order).
s_nop 1after the store gives the 2 wait states the ISA requires before its data registers change. LLVM does not insert them after inline asm. The current builds complied only by scheduling; a reordered build produced wrong, nondeterministic outputs (standalone repro: 6.1% / 0.1% / 0 wrong dwords at 0 / 1 / 2 wait states).v_min_f32/v_max_f32. Results differ only for a -inf gate accumulator.Results: kernel. Measured on 8 x MI355X with graph replay, 8 rotated weight sets (cold), max over ranks. Synthetic routing at M = tokens per rank (C128 / C160 / C256 with DSpark k=5 = M96 / M120 / M192). Ratio = new / current kernel, lower is better. Measured on an intermediate head, same hour as the current kernel:
Results: end to end. Recipe G's serving configuration (DeepSeek-V4.1-Flash-1017, DEP8, DSpark k=5, S49 plan, input 8192 / output 6144, real acceptance). Median ITL over 2 runs, with this branch's package mounted over the image's
amd_kernels:Correctness.
pytest tests/moe/fused_ep_mxfp4_h5120_i2304_e48_top6_ranks8: 4 passed.