Skip to content

perf(qmoe): group prefill expert matmuls - #601

Draft
donghanbj wants to merge 2 commits into
mainfrom
perf/optimize-matmul-nbits-grouped
Draft

perf(qmoe): group prefill expert matmuls#601
donghanbj wants to merge 2 commits into
mainfrom
perf/optimize-matmul-nbits-grouped

Conversation

@donghanbj

Copy link
Copy Markdown
Contributor

Batch symmetric int4 Qwen3.5 expert projections into grid-z WMMA launches to eliminate per-expert dispatch overhead while preserving deterministic scatter order.

Summary

Related issue or design

Why

What

Test plan

Notes for reviewers

Checklist

  • The change is focused, or links a design/series explaining its scope.
  • Relevant tests were added or updated and the results are documented.
  • User-facing or design documentation was updated when needed.
  • Substantial AI assistance is disclosed, and I reviewed and understand the result.

Batch symmetric int4 Qwen3.5 expert projections into grid-z WMMA launches to eliminate per-expert dispatch overhead while preserving deterministic scatter order.

Co-authored-by: Cursor <cursoragent@cursor.com>
@github-actions

Copy link
Copy Markdown

Thanks for opening a PR!

This project follows LLVM's incremental-development and AI-tool-use
guidance. See CONTRIBUTING.md
for the project workflow.

Before requesting review, please check that:

  1. The change is focused. Substantial work links the relevant issue
    or design discussion.
  2. The PR documents relevant test results and updates affected
    documentation.
  3. If AI tools provided substantial assistance, the description
    explains what was assisted and how it was validated, and commit
    trailers identify the tool. The contributor has reviewed and
    understands the result.

Reviewers are assigned through
CODEOWNERS where ownership
is configured.

Co-authored-by: Cursor <cursoragent@cursor.com>
@github-actions

Copy link
Copy Markdown

L2 Accuracy Results (EP vs CPU)

Model Combined L2 Total Elems Skipped NaN/Inf
conv_test_hybrid 4.8668E-07 64 0
GroupQueryAttention_seq256 25.2366 2621440 0
MatMulNBits_o_seq128 259.906 368640 0
QMoE_seq128 34.9552 368640 0

Threshold: 0.01 | Run: 3444 - Commit: 3ed77fc

@github-actions

Copy link
Copy Markdown

MorphiZen EP Performance Results

Model QPS Session (s) 1st Infer (ms) CPU% Mem (MB)
full_model_seq128 7.52 6.14 369 3 1243
GroupQueryAttention_seq128 4499.78 1.79816 11 6 310
matmul_down_seq128 524.24 2.42 74 3 351

EPContext Export Performance

Model QPS Session (s) 1st Infer (ms) CPU% Mem (MB)
full_model_seq128 7.51 45.81 364 3 15590

EPContext Import Performance

Model QPS Session (s) 1st Infer (ms) CPU% Mem (MB)
full_model_seq128 7.53 9.78 363 3 15760

OGA Benchmark Results

Model Warmup Reps Prompt Len Gen Tokens TTFT (ms) TPS Peak Mem (GB) GPU Mem (GB)
gpt-oss-20b-webgpu-int4-rtn-block-32 1 5 128 128 177.5 78.5 1.33 13.54
Llama-3.1-8B-awq-g128-int4-asym-fp16-onnx-dml 1 5 128 128 343.7 40.6 1.22 6.43

OGA Wheel Smoke (Python benchmark_e2e.py)

Model TTFT (ms) TPS
Llama-3.1-8B-awq-g128-int4-asym-fp16-onnx-dml 197 39.7

Run: 3444 - Commit: 3ed77fc

@donghanbj

Copy link
Copy Markdown
Contributor Author

/run-test models=all

@amd-yanjunz

amd-yanjunz commented Jul 30, 2026

Copy link
Copy Markdown
Contributor

ROCm OGA CI finished with result: UNSTABLE.

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