Skip to content

gpu: fused GptOssMoE op (sparse top-4 INT4 MoE) for GPT-OSS-20B - #5258

Open
rlegithub wants to merge 1 commit into
ROCm:developfrom
rlegithub:pr/gptoss-moe-op
Open

rlegithub wants to merge 1 commit into
ROCm:developfrom
rlegithub:pr/gptoss-moe-op

Conversation

@rlegithub

Copy link
Copy Markdown

Summary

Adds a fused GptOssMoE operator — sparse top-4 INT4 Mixture-of-Experts — used by GPT-OSS-20B on the OGA → ONNX Runtime → MIGraphX path (gfx1151 / Strix Halo).

  • Core op op/gptoss_moe.hpp; ONNX contrib parser onnx/parse_gptoss_moe.cpp
  • GPU op + device kernels gpu/gptoss_moe.*, gpu/device/moe.* (routing + fused INT4 dequant expert GEMMs)
  • Registration: onnx.cpp (registry re-query), lowering.cpp (add_extend_op), CMakeLists

1 of 3 PRs enabling GPT-OSS-20B (with the SLN-FP32 and GQA-attention-sink PRs); the model needs all three to decode.

Test plan

  • CI
  • Verified on gfx1151 (Strix Halo, Windows): GPT-OSS-20B decodes coherently ("The capital of France is Paris."), ~56 tok/s, INT4 MoE + INT4 lm_head.

Adds a fused GptOssMoE operator (sparse top-4 INT4 Mixture-of-Experts) used by
GPT-OSS-20B: core op (op/gptoss_moe.hpp), ONNX contrib parser
(parse_gptoss_moe.cpp), GPU op + device kernels (gpu/gptoss_moe.*, device/moe.*),
op registration (onnx.cpp registry re-query, lowering.cpp add_extend_op, CMakeLists).
Verified on gfx1151 (Strix Halo): GPT-OSS-20B decodes coherently, ~56 tok/s.

Co-Authored-By: Claude <noreply@anthropic.com>
make_op("convert", {{"target_type", shape::float_type}}), args[0]);
}

auto moe = info.add_instruction(make_op("gptoss_moe",

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This shouldn't add a new kernel. It should use the existing operators in migraphx.

@rlegithub
rlegithub marked this pull request as ready for review September 14, 2026 21:21
@rlegithub
rlegithub requested a review from causten as a code owner September 14, 2026 21:21
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.

2 participants