Skip to content

aiter#6643: add relu2 (non-gated squared-ReLU) support to legacy CK XDL 2-stage MoE GEMM - #3792

Open
shantipriya-amd wants to merge 5 commits into
ROCm:developfrom
shantipriya-amd:relu2-legacy-kernel-6643-ck
Open

shantipriya-amd wants to merge 5 commits into
ROCm:developfrom
shantipriya-amd:relu2-legacy-kernel-6643-ck

Conversation

@shantipriya-amd

@shantipriya-amd shantipriya-amd commented Oct 30, 2026 •

Copy link
Copy Markdown
Contributor

Adds ActOp=5 (relu2) support to the CK XDL 2-stage MoE GEMM device/gridwise templates (device_moe_gemm.hpp, gridwise_gemm_xdl_cshuffle_common.hpp, gridwise_moe_gemm.hpp).

Companion change to ROCm/aiter#7139, which wires this activation through aiter's legacy ck_gemm_moe_2stages_codegen kernel for nvidia/NVIDIA-Nemotron-3-Super-120B-A12B (BF16/FP8).

This CK-side change is the equivalent of what PR #4620 (GeluTanh) needed on the CK side when that activation was added to the same kernel family.

@shantipriya-amd

Copy link
Copy Markdown
Contributor Author

Root cause: gridwise_moe_gemm.hpp's BlockwiseGemmPipe passes IsInputGemm alone as the GUFusion arg to BlockGemmBPreshufflePipeline_Selector<...>(). Since relu2 sets IsGateUp=false while IsInputGemm stays true, this selects the gufusion-only (16-arg Run()) pipeline instead of the non-gufusion (13-arg) one.

Fix:

IsInputGemm>())>;
// ->
(IsInputGemm && IsGateUp)>())>;

Verified: compiles clean on gfx950 with this change; kernel output is an exact match vs. torch.relu(x)**2, no regression in the gated silu path.

@shantipriya-amd

Copy link
Copy Markdown
Contributor Author

@shumway @JiaLuo-CAN : May I request for a review at your convenient time please ?.

@shantipriya-amd

Copy link
Copy Markdown
Contributor Author

@illsilin This PR has been pending for a while. May I request a review and suggestion for proceeding?

illsilin added a commit to ROCm/rocm-libraries that referenced this pull request Nov 25, 2026
…DL 2-stage MoE GEMM (#16705)

Adds ActOp=5 (relu2) support to the CK XDL 2-stage MoE GEMM
device/gridwise templates (device_moe_gemm.hpp,
gridwise_gemm_xdl_cshuffle_common.hpp, gridwise_moe_gemm.hpp).

Companion change to ROCm/aiter#7139, which wires this activation through
aiter's legacy ck_gemm_moe_2stages_codegen kernel for
nvidia/NVIDIA-Nemotron-3-Super-120B-A12B (BF16/FP8).

This CK-side change is the equivalent of what PR #4620 (GeluTanh) needed
on the CK side when that activation was added to the same kernel family.

Supersedes ROCm/composable_kernel#3792 (deprecated repo, develop branch
is now a read-only mirror).

ISSUE ID: ROCm/aiter#6643

---------

Signed-off-by: Shantipriya Parida <shantipriya.parida@amd.com>
Co-authored-by: Illia Silin <Illia.Silin@amd.com>
assistant-librarian Bot pushed a commit that referenced this pull request Nov 25, 2026
aiter#6643: add relu2 (non-gated squared-ReLU) support to
 legacy CK XDL 2-stage MoE GEMM (#16705)

Adds ActOp=5 (relu2) support to the CK XDL 2-stage MoE GEMM
device/gridwise templates (device_moe_gemm.hpp,
gridwise_gemm_xdl_cshuffle_common.hpp, gridwise_moe_gemm.hpp).

Companion change to ROCm/aiter#7139, which wires this activation through
aiter's legacy ck_gemm_moe_2stages_codegen kernel for
nvidia/NVIDIA-Nemotron-3-Super-120B-A12B (BF16/FP8).

This CK-side change is the equivalent of what PR #4620 (GeluTanh) needed
on the CK side when that activation was added to the same kernel family.

Supersedes #3792 (deprecated repo, develop branch
is now a read-only mirror).

ISSUE ID: ROCm/aiter#6643

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant